Skip to content

Instantly share code, notes, and snippets.

@searls
Created March 21, 2011 21:49
Show Gist options
  • Save searls/880290 to your computer and use it in GitHub Desktop.
Save searls/880290 to your computer and use it in GitHub Desktop.
Feature: halt the build when a spec failure occurs
In order to prevent unstable builds from finishing
I want the maven build to terminate in failure when specs fail
Scenario: project with a single failure # features/halt_on_failure.feature:6
Given I am currently in the "jasmine-webapp-single-failing" project # features/step_definitions/mvn_steps.rb:1
When I run "mvn clean test" # features/step_definitions/mvn_steps.rb:6
Then the build should fail # features/step_definitions/mvn_steps.rb:10
And I should see "Results: 5 specs, 1 failure" # features/step_definitions/mvn_steps.rb:18
And I should see "There were Jasmine spec failures" # features/step_definitions/mvn_steps.rb:18
Scenario: project with multiple failures # features/halt_on_failure.feature:14
Given I am currently in the "jasmine-webapp-many-failing" project # features/step_definitions/mvn_steps.rb:1
When I run "mvn clean test" # features/step_definitions/mvn_steps.rb:6
Then the build should fail # features/step_definitions/mvn_steps.rb:10
And I should see "Results: 5 specs, 4 failures" # features/step_definitions/mvn_steps.rb:18
And I should see "There were Jasmine spec failures" # features/step_definitions/mvn_steps.rb:18
Scenario: project with no failures # features/halt_on_failure.feature:22
Given I am currently in the "jasmine-webapp-custom-dirs" project # features/step_definitions/mvn_steps.rb:1
When I run "mvn clean test" # features/step_definitions/mvn_steps.rb:6
Then the build should succeed # features/step_definitions/mvn_steps.rb:14
And I should see "Results: 1 specs, 0 failures" # features/step_definitions/mvn_steps.rb:18
And I should not see "There were Jasmine spec failures" # features/step_definitions/mvn_steps.rb:22
Scenario: project with failures and haltOnFailure set to false # features/halt_on_failure.feature:30
4 scenarios (4 passed)
15 steps (15 passed)
0m18.722s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment