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

Turn on esm tests #28336

Merged
merged 29 commits into from
Nov 2, 2020
Merged

Conversation

erwinmombay
Copy link
Member

No description provided.

Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up, @erwinmombay! I've made some preliminary comments in case they might help you debug / troubleshoot.


if (!isTravisPullRequestBuild()) {
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp dist --fortesting --esm');
Copy link
Contributor

@rsimha rsimha May 12, 2020

Choose a reason for hiding this comment

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

No need to compile here. You can download what was built in the ESM Dist job from the build stage (added in #27705). This will shave off ~10 mins from the total build time.

/**
* Downloads and unzips esm dist output from storage
* @param {string} functionName
*/
function downloadEsmDistOutput(functionName) {
downloadOutput_(functionName, ESM_DIST_OUTPUT_FILE, BUILD_OUTPUT_DIRS);
}

Recommended order of steps:

downloadEsmDistOutput(FILENAME);
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp integration --nobuild --compiled --headless');

build-system/pr-check/esm-tests.js Outdated Show resolved Hide resolved
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp dist --fortesting --esm');
timedExecOrDie(
'gulp integration --nobuild --compiled --headless --coverage'
Copy link
Contributor

@rsimha rsimha May 12, 2020

Choose a reason for hiding this comment

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

Drop --coverage. (Coverage mode only works for unminified code.)

if (!isTravisPullRequestBuild()) {
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp dist --fortesting --esm');
timedExecOrDie('gulp integration --nobuild --compiled --headless');
Copy link
Contributor

@rsimha rsimha May 12, 2020

Choose a reason for hiding this comment

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

Couple comments:

const IS_GULP_INTEGRATION = argv._[0] === 'integration';
const IS_GULP_UNIT = argv._[0] === 'unit';
const IS_GULP_E2E = argv._[0] === 'e2e';
const IS_LOCAL_CHANGES = !!argv.local_changes;
const IS_SAUCELABS = !!argv.saucelabs;
const IS_SAUCELABS_STABLE = !!argv.saucelabs && !!argv.stable;
const IS_SAUCELABS_BETA = !!argv.saucelabs && !!argv.beta;
const IS_SINGLE_PASS = !!argv.single_pass;
const TEST_TYPE_SUBTYPES = new Map([
[
'integration',
['local', 'single-pass', 'saucelabs-beta', 'saucelabs-stable'],
],
['unit', ['local', 'local-changes', 'saucelabs']],
['e2e', ['local']],
]);

@lgtm-com
Copy link

lgtm-com bot commented Sep 22, 2020

This pull request introduces 2 alerts when merging 0b3203c into f3612a9 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Useless conditional

@amp-owners-bot
Copy link

amp-owners-bot bot commented Oct 20, 2020

Hey @rsimha! These files were changed:

build-system/pr-check/esm-tests.js
build-system/pr-check/utils.js

@erwinmombay erwinmombay force-pushed the turn-on-esm-tests branch 2 times, most recently from eda171c to 30d778c Compare October 20, 2020 16:30
@erwinmombay erwinmombay requested review from estherkim and removed request for jridgewell October 20, 2020 17:55
@erwinmombay erwinmombay force-pushed the turn-on-esm-tests branch 2 times, most recently from 338b1fd to 5f8a783 Compare October 21, 2020 17:27
@CLAassistant
Copy link

CLAassistant commented Oct 29, 2020

CLA assistant check
All committers have signed the CLA.

@erwinmombay erwinmombay force-pushed the turn-on-esm-tests branch 2 times, most recently from 7303998 to bc92991 Compare November 2, 2020 20:05
Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

🎉

@erwinmombay erwinmombay merged commit f479ea6 into ampproject:master Nov 2, 2020
ed-bird pushed a commit to ed-bird/amphtml that referenced this pull request Dec 10, 2020
* temp

* temp

* add conditional to the css removal

* add travis entry

* add esm-tests.js file

* minor fix to add coverage

* remove compiled to test

* add compiled back in

* Revert "🏗♻️ Consolidate all `babel` configs into `babel.config.js` (ampproject#27576)"

This reverts commit f801a93.

* temp

* temp

* reset this to be close to master

* temp

* temp

* temp

* temp

* for non dev builds (compiled, rtv) take into account the module build for regex replace

* temp

* remove debuggers

* temp

* apply recs

* remove runner.js

* apply recs

* add --esm flag to integration run

* download dist output as we need f.js/integration.js from dist nomodule

* allow cors explicitly for mjs files GET requests

* add flag to overwrite when unzipping

* fix test type inference

* apply recs
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.

5 participants