Skip to content

Instantly share code, notes, and snippets.

@jordelver
Last active January 13, 2017 07:23
Show Gist options
  • Save jordelver/5998870 to your computer and use it in GitHub Desktop.
Save jordelver/5998870 to your computer and use it in GitHub Desktop.
Find where stuff broke using git bisect with cucumber

Find where stuff broke using git bisect with Cucumber

Start git bisect

git bisect start

Specify a good and bad commit

git bisect good <commit-where-stuff-is-working>

git bisect bad <commit-where-stuff-is-not-working>

Run cucumber with git bisect

git will continue to run your Cucumber feature until they don't pass. Narrowing down to the commit which broke things.

git bisect run bundle exec cucumber features/a-feature.feature

Finish

When finished, reset your branch to the previous state before git bisect.

git bisect reset
@sstarr
Copy link

sstarr commented Aug 30, 2013

Also works nicely with Rspec and Capybara :godmode:

git bisect run bundle exec rspec spec/features/global-thermonuclear-war.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment