Skip to content

Only unregister unit test event listeners when **all** testing is complete#2431

Merged
d3r3kk merged 5 commits into
microsoft:masterfrom
d3r3kk:issue2143_rerun_failed
Aug 23, 2018
Merged

Only unregister unit test event listeners when **all** testing is complete#2431
d3r3kk merged 5 commits into
microsoft:masterfrom
d3r3kk:issue2143_rerun_failed

Conversation

@d3r3kk
Copy link
Copy Markdown

@d3r3kk d3r3kk commented Aug 22, 2018

Addendum to fixes for #2143

  • Add test to ensure re-running failed tests count correctly

  • We use promise-chains for 'queuing' up our tests when they span multiple files/suites/functions, add one last member to the chain that un-registers the event handlers.

  • Title summarizes what is changing

  • Has a news entry file (Still using the originally created news file)

  • Has unit tests & system/integration tests

d3r3kk added 2 commits August 21, 2018 23:24
- Add test to ensure re-running failed tests count correctly
- also remove delay for `updatesetting` call (microsoft#2356)
@d3r3kk
Copy link
Copy Markdown
Author

d3r3kk commented Aug 22, 2018

Also forcing #2356 (comment out artificial wait when we update settings during testing). In the debugger.test.ts we are most certainly skirting the timeout limit with this additional wait.

- Ensure the promise chain passes results through
- (was swallowing the value in the final promise chain to remove listeners)
- Remove increased timeout limit in debugger.test
Copy link
Copy Markdown

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/client/unittests/unittest/runner.ts Outdated
// Test everything.
if (testPaths.length === 0) {
await runTestInternal();
await this.removeListenersAfter(runTestInternal());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI, it took me a sec to realize what happened to runTestInternal(). :) I'm not a huge fan of cramming several things onto one line (even if it's the Javascript way ). It hurts readability. Feel free to clean this up. I'll leave it up to you. :)

suiteSetup(async () => {
// Test disvovery is where the delay is, hence give 10 seconds (as we discover tests at least twice in each test).
// tslint:disable-next-line:no-invalid-this
this.timeout(10000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice :)

@d3r3kk d3r3kk merged commit e3a6bc2 into microsoft:master Aug 23, 2018
@d3r3kk d3r3kk deleted the issue2143_rerun_failed branch December 19, 2018 17:57
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants