Skip to content

Adding async cleanup to tests#4103

Merged
moniika merged 4 commits into
RaspberryPiFoundation:developfrom
moniika:async-cleanup-followup
Aug 5, 2020
Merged

Adding async cleanup to tests#4103
moniika merged 4 commits into
RaspberryPiFoundation:developfrom
moniika:async-cleanup-followup

Conversation

@moniika

@moniika moniika commented Aug 4, 2020

Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

Part of #4070
Part of #4064

Proposed Changes

  • Adds calls for sharedTestSetup and sharedTestTeardown to handle running all async Blockly code in teardown
  • Updates calls in setup/teardown for disposing of workspace to use workspaceTeardown in order to handle runnning any async tasks and catching if any error (so remaining tests still run).

Reason for Changes

  • Preventing leakage between tests.

Test Coverage

Ran mocha tests

Tested on:

  • Desktop Chrome

Additional Information

navigation_modify_test.js, insertion_marker_test.js and theme_test.js not included in this PR. To be addressed in follow up as there were errors that need to be investigated when shared setup/teardown was tried.

Comment thread tests/mocha/index.html Outdated
});

teardown(function() {
workspaceTeardown.call(this, this.workspace);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this also go in the parent teardown function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't be moved, parent teardown doesn't have access to this.workspace. Could be moved if this.workspace was re-defined in outer scope, but there's a lot of other similar instances and I'm not yet convinced that's the best plan. See #4080 for more explanation (if I do move things, I'd probably do it as part of addressing that bug).

@moniika
moniika merged commit 2e92123 into RaspberryPiFoundation:develop Aug 5, 2020
@moniika
moniika deleted the async-cleanup-followup branch August 5, 2020 23:00
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