0.0
No commit activity in last 3 years
No release in over 3 years
RSpec-Pipeline helps you to write and test your pipeline manifests
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

RSpec tests for your pipelines

Create tests for your pipelines to validate dependencies between blocks and other characteristics.

Only Azure YAML Pipelines are supported at the moment.

Installation

Add this line to your application's Gemfile:

gem 'rspec-pipeline'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install rspec-pipeline

Usage

Add this at the beginning of your spec_helper.rb:

require 'rspec-pipeline'

When writing your test you can use the keywords pipeline, stage, job and step as example groups, and the example's subject will be the corresponding item, filtered by its description. For example:

pipeline 'pipeline.yml' do
  stage 'DeployToDev' do
    it { is_expected.to run_after('Build') }
  end
end

The test will pass if your pipeline is defined like this:

stages:
- stage: Build
  jobs:
  - job: Build
    steps:
      - bash: echo "Build"

- stage: DeployToDev
  dependsOn: Build
  jobs:
  - job: B1
    steps:
    - bash: echo "Deploy to Dev"

Please go to the examples folder to see a few more use cases.

About remote templates

Note that if you try to use a template from a remote git repository you need to have clone permission and your git credentials configured if it is a private repository.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/thiagomarinho/rspec-pipeline.

License

The gem is available as open source under the terms of the MIT License.