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

Prevent spurious extra errors in e2e tests when before* fails #85

Merged

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Jan 18, 2019

Previously, when browser initialization in a before* block of an e2e test fails, Jest would still try to run all the corresponding tests and after* methods, and you'd get a bunch of noise in the test logs unrelated to the real error.

This PR:

  • Prevents test/it bodies from running after a beforeEach/beforeAll failure by switching our testRunner from the default (jasmine) to jest-circus per Jest team's recommendation at Tests are run even when beforeAll throws error jestjs/jest#2713
  • Prevents spurious afterEach/afterAll failures after a beforeEach/beforeAll failure by adding defensive checks to all our e2e tests' after* methods to prevent them from trying to close browser instances that weren't successfully constructed

The results are that if a browser-initialization error happens, you'll see exactly 1 error per test suite (in beforeAll initialization cases) or per test (in beforeEach initialization cases), as expected.

@dbjorge dbjorge requested a review from a team January 18, 2019 22:11
@dbjorge
Copy link
Contributor Author

dbjorge commented Jan 22, 2019

Queued 5x manual PR builds to test for any flakiness due to the test runner change, tracking PR builds 20190122.6 through 20190122.10. All passed

@dbjorge dbjorge merged commit d920bbb into master Jan 22, 2019
@dbjorge dbjorge deleted the users/dbjorge/improve-test-behavior-when-before-functions-fail branch January 22, 2019 20:32
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.

None yet

2 participants