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

fix(build): Fix event tests, improve buildDeps #6773

Merged
merged 3 commits into from
Jan 26, 2023

Conversation

cpcallen
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

npm test output had become increasingly cluttered with miscellaneous WARNINGs from closure-make-deps. Investigating this, it turned out that two recently-added test files were not being run at all.

Proposed Changes

  • Fix actual syntax errors in imports in event_marker_move_test.js and event_selected.test.js, which were preventing those tests from being run.

  • Remove suite.only directives in those tests that would prevent all the other tests from running.

  • Run closure-make-deps only once, instead of separately for core/ and tests/.

  • Specify a larger exec maxBuffer size, to ensure output and diagnostics are not truncated.

  • Change stderr filtering in buildDeps to filter out bounded generics messages and blank lines.

  • Attempt to suppress warnings in stderr output when closure-make-deps returns a non-zero exit code.

    Unfortunately, there seems to be a race condition which usually causes the stderr argument to the exec callback not to contain the complete output, so in that case print a helpful message.

  • Have buildDeps just return a Promise instead of using a callback.

Behaviour Before Change

Two of the tests were not being run.

Behaviour After Change

All tests are run; buildDeps runs about twice as fast as before.

Test Coverage

Improved.

- Fix actual syntax errors in imports in event_marker_move_test.js
  and event_selected.test.js, which were preventing those tests from
  being run.

- Remove suite.only directives in those tests that would prevent
  all the other tests from running.
- Run closure-make-deps only once, instead of separately for core/
  and tests/.

- Specify a larger exec maxBuffer size, to ensure output and
  diagnostics are not truncated.

- Change stderr filtering in buildDeps to filter out bounded
  generics messages and blank lines.

- Attempt to suppress warnings in stderr output when
  closure-make-deps returns a non-zero exit code.

  Unfortunately, there seems to be a race condition which usually
  the stderr argument to the exec callback not to contain the
  complete output, so in that case print a helpful message.

- Have buildDeps just return a Promise instead of using a callback.
/**
* Log unexpected diagnostics, after removing expected warnings.
*
* @param {string} test Standard error output from closure-make-deps
Copy link
Contributor

Choose a reason for hiding this comment

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

s/test/text

Copy link
Contributor

@NeilFraser NeilFraser left a comment

Choose a reason for hiding this comment

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

Other than the @param typo, LGTM.

@maribethb maribethb changed the title fix(builld): Fix event tests, improve buildDeps fix(build): Fix event tests, improve buildDeps Jan 25, 2023
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Jan 25, 2023
@cpcallen cpcallen merged commit a7f498a into google:develop Jan 26, 2023
@cpcallen cpcallen deleted the fix/deps-warnings branch January 26, 2023 20:09
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.

2 participants