Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A Ruby gem to automate integration testing of gems before release

License

Notifications You must be signed in to change notification settings

jaynetics/gouteur

Repository files navigation

👨‍🍳 Gouteur

Gem Version Build Status Coverage

Treat the people that use your gem like royalty! Send for a gouteur before serving them something new!

What?

This gem runs the build tasks of other projects against your unreleased changes.

Why?

Sometimes, other projects start depending on your gem.

When you release a new version of your gem, these projects might break.

Semantic versioning obviously helps. People make mistakes, though. The boundary between public and private APIs can also be fuzzy, particularly in an open language like Ruby.

Thus, when you update your gem, you might feel as if you should check whether things that depend on it will keep working before you release the new version.

Gouteur automates this step.

Installation

Add gouteur to the development dependencies of your gem.

Usage

Recommended usage

Create a .gouteur.yml in the root of your project:

repos:
  - uri: https://github.com/someone/some_gem
    ref: some_specific_branch # optional, default is the default branch
    before: setup_special_dependency # optional, bundle is always installed
    tasks: ['rspec', 'rake foo'] # optional, default is `rake`
    name: cool_gem # optional, defaults to repo name from uri, e.g. `some_gem`
    locked: true # optional, prevents setting an incompatible VERSION
    force: true # optional, forces test even if VERSION is incompatible

Then simply bundle exec gouteur or add the rake task to your Rakefile:

require 'gouteur/rake_task'
Gouteur::RakeTask.new

# default name is :gouteur, e.g. to include it in the default task:
task default: %i[rspec gouteur]

Pro tip: for large repos, running only relevant specs can speed up things a lot, e.g.:

tasks: 'rspec spec/known_relevant_spec.rb'
tasks: 'rspec --pattern "**/{,*}{keyword1,keyword2}{,*,*/**/*}_spec.rb"'`

Manual usage

From the shell:

# example: check one dependent repo
gouteur 'https://github.com/foo/bar'

# see other usage options:
gouteur --help

From Ruby:

repo = Gouteur::Repo.new(uri: 'https://github.com/foo/bar')
success, message = Gouteur::Checker.call(repo)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jaynetics/gouteur.

Outlook

Possible future improvements:

  • consider caching of dependent repositories in CI, e.g. in GitHub workflows
  • support more sources of code, e.g. latest release, private GitHub repositories
  • improve performance by tracing & rerunning only specs/tests that use the gem
  • save time in MiniTest by forcing it to run in fail-fast mode like RSpec
  • other ideas? open an issue!

License

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

About

A Ruby gem to automate integration testing of gems before release

Topics

Resources

License

Stars

Watchers

Forks