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

chore(testrunner): distinguish between TERMINATED and CRASHED #4821

Merged
merged 3 commits into from
Aug 8, 2019

Conversation

aslushnikov
Copy link
Contributor

testRunner.run() might have 4 different outcomes:

  • ok - all non-skipped tests passed
  • failed - some tests failed or timed out
  • terminated - process received SIGHUP/SIGINT while testrunner was running tests. This happens on CI's under certain circumstances, e.g. when
    VM is getting re-scheduled.
  • crashed - testrunner terminated test execution due to either UnhandledPromiseRejection or
    some of the hooks (beforeEach/afterEach/beforeAll/afterAll) failures.

As an implication, there are 2 new test results: terminated and crashed.
All possible test results are:

  • ok - test worked just fine
  • skipped - test was skipped with xit
  • timedout - test timed out
  • failed - test threw an exception while running
  • terminated - testrunner got terminated while running this test
  • crashed - some beforeEach / afterEach hook corresponding to this
    test timed out of threw an exception.

This patch changes a few parts of the testrunner API:

  • testRunner.run() now returns an object {result: string, terminationError?: Error, terminationMessage?: string}
  • the same object is dispatched via testRunner.on('finished') event
  • testRunner.on('terminated') got removed
  • tests now might have crashed and terminated results
  • testRunner.on('teststarted') dispatched before running all related
    beforeEach hooks, and testRunner.on('testfinished') dispatched after
    running all related afterEach hooks.

`testRunner.run()` might have 4 different outcomes:
- `ok` - all non-skipped tests passed
- `failed` - some tests failed or timed out
- `terminated` - process received SIGHUP/SIGINT while testrunner was running tests. This happens on CI's under certain circumstances, e.g. when
  VM is getting re-scheduled.
- `crashed` - testrunner terminated test execution due to either `UnhandledPromiseRejection` or
  some of the hooks (`beforeEach/afterEach/beforeAll/afterAll`) failures.

As an implication, there are 2 new test results: `terminated` and `crashed`.
All possible test results are:
- `ok` - test worked just fine
- `skipped` - test was skipped with `xit`
- `timedout` - test timed out
- `failed` - test threw an exception while running
- `terminated` - testrunner got terminated while running this test
- `crashed` - some `beforeEach` / `afterEach` hook corresponding to this
test timed out of threw an exception.

This patch changes a few parts of the testrunner API:
- `testRunner.run()` now returns an object `{result: string,
terminationError?: Error, terminationMessage?: string}`
- the same object is dispatched via `testRunner.on('finished')` event
- `testRunner.on('terminated')` got removed
- tests now might have `crashed` and `terminated` results
- `testRunner.on('teststarted')` dispatched before running all related
`beforeEach` hooks, and `testRunner.on('testfinished')` dispatched after
running all related `afterEach` hooks.
@aslushnikov aslushnikov merged commit f753ec6 into puppeteer:master Aug 8, 2019
@aslushnikov aslushnikov deleted the testrunner-crashes branch August 8, 2019 22:15
rfojtik pushed a commit to rfojtik/puppeteer that referenced this pull request Dec 21, 2019
…eer#4821)

`testRunner.run()` might have 4 different outcomes:
- `ok` - all non-skipped tests passed
- `failed` - some tests failed or timed out
- `terminated` - process received SIGHUP/SIGINT while testrunner was running tests. This happens on CI's under certain circumstances, e.g. when
  VM is getting re-scheduled.
- `crashed` - testrunner terminated test execution due to either `UnhandledPromiseRejection` or
  some of the hooks (`beforeEach/afterEach/beforeAll/afterAll`) failures.

As an implication, there are 2 new test results: `terminated` and `crashed`.
All possible test results are:
- `ok` - test worked just fine
- `skipped` - test was skipped with `xit`
- `timedout` - test timed out
- `failed` - test threw an exception while running
- `terminated` - testrunner got terminated while running this test
- `crashed` - some `beforeEach` / `afterEach` hook corresponding to this
test timed out of threw an exception.

This patch changes a few parts of the testrunner API:
- `testRunner.run()` now returns an object `{result: string,
terminationError?: Error, terminationMessage?: string}`
- the same object is dispatched via `testRunner.on('finished')` event
- `testRunner.on('terminated')` got removed
- tests now might have `crashed` and `terminated` results
- `testRunner.on('teststarted')` dispatched before running all related
`beforeEach` hooks, and `testRunner.on('testfinished')` dispatched after
running all related `afterEach` hooks.
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