Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug when an exception occurs in a before all block #90

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

dan-manges
Copy link
Member

No description provided.

@@ -87,9 +87,10 @@ def run_with_abq(reporter)
# be sent to us from ABQ, we now loop over all the examples, and mark
# every one that we must run in this group as a failure.
for_filtered_examples(reporter) do |example|
next unless Abq.target_test_case.is_example?(example)

example.fail_with_exception(abq_reporter, ex)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were two issues here:

  • abq_reporter was undefined
  • we were looping over all of the examples but only marking the one currently assigned to the worker as failed. This causes a problem if the worker pulls another spec in the example group, but we've already moved past that in iterating over the tests

@doxavore doxavore force-pushed the dan/fix-before-all-exception branch 2 times, most recently from b466cfd to 3a927ef Compare January 24, 2023 16:13

it 'fails' do
# should fail without running because of the exception in the after(:all)
exit 9999
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you're still working on this, but I wanted to mention that I intended this comment and exit 9999 to indicate "this code should never run" for the before(:all) case. This probably doesn't make sense for an after(:all) test.

@doxavore doxavore force-pushed the dan/fix-before-all-exception branch 4 times, most recently from defef5e to 3cfc69d Compare January 26, 2023 15:24
@doxavore doxavore merged commit 970e133 into main Jan 26, 2023
@doxavore doxavore deleted the dan/fix-before-all-exception branch January 26, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants