I've just encountered the following behaviour with the rspec runner of ci-queue:
- Modify a spec to reference an uninitialized constant so as to trigger a
NameError, e.g. by referring to a non-existent class:
describe MyNonExistentClass do
...
end
- Run rspec-queue
- rspec-queue exits successfully.
I guessed wrongly that rspec-queue would fail with a non-zero exit code, but it exited with 0.
Bare rspec exits with 1 in the above situation.
I'm wondering if this is intended behaviour - perhaps its needed for retries to work?
The error message output is:
NameError: uninitialized constant MyNonExistentClass
Debugging shows that line 400 is where the 0 exit code is returned, because the NameError causes @world.non_example_failure to be true. Syntax errors appear to have the same result:
|
success = true |
|
@configuration.reporter.report(examples_count) do |reporter| |
|
@configuration.add_formatter(BuildStatusRecorder) |
|
|
|
@configuration.with_suite_hooks do |
|
break if @world.wants_to_quit |
|
queue.poll do |example| |
|
success &= example.run(QueueReporter.new(reporter, queue, example)) |
|
break if @world.wants_to_quit |
|
end |
|
end |
|
end |
|
|
|
return 0 if @world.non_example_failure |
|
success ? 0 : @configuration.failure_exit_code |
I've just encountered the following behaviour with the rspec runner of ci-queue:
NameError, e.g. by referring to a non-existent class:I guessed wrongly that
rspec-queuewould fail with a non-zero exit code, but it exited with0.Bare
rspecexits with1in the above situation.I'm wondering if this is intended behaviour - perhaps its needed for retries to work?
The error message output is:
Debugging shows that line 400 is where the
0exit code is returned, because theNameErrorcauses@world.non_example_failureto betrue. Syntax errors appear to have the same result:ci-queue/ruby/lib/rspec/queue.rb
Lines 387 to 401 in cba2cdd