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

refactor(tests): Migrate generator tests to import shims; delete bootstrap.js #7414

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

cpcallen
Copy link
Contributor

The basics

The details

Resolves

Part of #6858.

Proposed Changes

  1. Use shims instead of bootstrap to load Blockly:
    • Modify tests/generators/index.html to import the test shims instead of using bootstrap.js to load Blockly.
    • Modify test/generators/webdriver.js to have it wait for the workspace to exist before calling loadSelected(). There was previously a race which index.html had been winning, but now webdriver.js is winning (and the tests failing because there is no workspace yet when start() is called.
  2. Delete tests/bootstrap.js, bootstrap_helper.js, and bootstrap_done.mjs.
    • Remove remaining references to bootstrap.js.
  3. Remove the deps npm script. The buildDeps gulp task is now only needed by buildCompiled, not ever for runnning in uncompressed mode, so:
    • Remove the deps gulp task (and the deps npm script that runs it).
    • Have the minify task run buildJavaScript and buildDeps directly.
    • Additionally, the buildAdvanceCompilationTest target hasn't needed deps.js for some time (if ever), so skip having it run buildDeps entirely.
  4. Repatriate const DEPS_FILE to build_tasks.js, since it is no longer used anywhere else and so does not need to be declared in in common.js.

Behaviour After Change

Unchanged.

Reason for Changes

Remove bootstrap.js.

Test Coverage

Unchanged.

Documentation

Need to remove mention of npm run deps from developer documentation.

- Modify tests/generators/index.html to import the test shims
  instead of using bootstrap.js to load Blockly.

- Modify test/generators/webdriver.js to have it wait for the
  workspace to exist before calling loadSelected().  There was
  previously a race which index.html had been winning, but
  now webdriver.js is winning (and the tests failing because
  there is no workspace yet when start() is called.
- Delete bootstrap.js, bootstrap_helper.js, and bootstrap_done.mjs.
- Remove remaining references to bootstrap.js
buildDeps is now only needed by buildCompiled, not ever for
runnning in uncompressed mode, so:

- Remove the deps gulp task (and the deps npm script.
- Have the minify task run buildJavaScript and buildDeps directly.

Additionally, the buildAdvanceCompilationTest target hasn't
needed deps.js for some time (if ever), so skip having it run
buildDeps entirely.
Since this is no longer used anywhere else it doesn't need to
live in common.js.
@cpcallen cpcallen merged commit be809d9 into google:develop Aug 30, 2023
7 checks passed
@cpcallen cpcallen deleted the refactor/6858/generators branch August 30, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants