-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fail on missing snapshots (#57) * include fork of rspec-snapshot that fails the build when the snapshot is written * confirm missing snapshots fail the build * Revert "confirm missing snapshots fail the build" This reverts commit b4e3dd2. * test exit more carefully (#56) * graceful exit within abq was masking rspec tests on older versions of rspec * add an additional exit safeguard * check num tests vs expected tests * sanitize backtrace tweaks * regenerate snapshots * break test to ensure bin/check_num_tests.rb works * Revert "break test to ensure bin/check_num_tests.rb works" This reverts commit 1da32a2. * set subprocess ENV outside of the global context (#54) * use captain cli (#55) * use captain cli * unset RWX_ACCESS_TOKEN to be compatible with captain-cli
- Loading branch information
1 parent
f91022e
commit 00e5559
Showing
70 changed files
with
253 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# rspec-abq calls exit(0). Loading the code path that calls exit(0) returns from rspec immediately with a exit status of 0 | ||
# which shows as "passing" in CI even if tests failed. | ||
# | ||
# Here, we compare the number of tests run to the expected number. | ||
|
||
DEFAULT_TEST_JSON_PATH = 'tmp/rspec.json' | ||
EXPECTED_TEST_NUMBER_SNAPSHOT_PATH = 'spec/NUM_TESTS' | ||
|
||
json_path = ARGV[0] || DEFAULT_TEST_JSON_PATH | ||
unless File.exists?(json_path) | ||
warn "no test file found at #{json_path}" | ||
warn "usage: bin/snapshot_num_tests.rb (path to json file) (default: #{DEFAULT_TEST_JSON_PATH}" | ||
exit 1 | ||
end | ||
|
||
require 'json' | ||
|
||
actual_num_tests = JSON.parse(File.read(json_path))['examples'].length | ||
expected_num_tests = File.read(EXPECTED_TEST_NUMBER_SNAPSHOT_PATH).strip.to_i | ||
|
||
if actual_num_tests != expected_num_tests | ||
warn "We ran #{actual_num_tests} tests, but expected to run #{expected_num_tests}." | ||
exit 1 | ||
end | ||
|
||
puts "We ran #{actual_num_tests} tests, as expected." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.