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

Optimise CI testing for third-party-polyfills #254

Merged
merged 5 commits into from
Jul 4, 2019

Conversation

JakeChampion
Copy link
Owner

Currently when a change is made to the package.json file it will cause all the tests within the project to be executed in CI, which is painfully painfully slow and labor-intensive. This is a real issue for the project because we have the ability to use an npm package as the source of a polyfill (known as third-party-polyfills) and this is used more and more by contributors to the project.

We can speed up the scenario where a third-party-polyfill has been added or updated within the project by making the CI test-runner aware of the changes made within the package.json file and figure out if the changes were for a third-party-polyfill or not.

…e not for a dependency that is used within the feature (or the features dependencies).
@JakeChampion JakeChampion force-pushed the third-party-polyfill-test-optimisation branch from 7d71770 to a0773f5 Compare July 4, 2019 18:27
@JakeChampion JakeChampion merged commit 482948f into master Jul 4, 2019
@chee chee deleted the third-party-polyfill-test-optimisation branch July 5, 2019 08:50
test/polyfills/test-individual-feature.js Show resolved Hide resolved
test/polyfills/test-individual-feature.js Show resolved Hide resolved
}).filter(thirdPartyPolyfills => thirdPartyPolyfills !== undefined);

const thirdPartyPolyfillHasBeenAddedOrChangedForFeature = intersection(thirdPartyPolyfillsWhichHaveBeenAddedOrChanged, thirdPartyDependenciesForFeature).length > 0;
const packageJsonHasOnlyHadThirdPartyPolyfillChangesAppliedToIt = packageJsonDependenciesChanges.every(dep => thirdPartyPolyfills.includes(dep));
Copy link
Collaborator

Choose a reason for hiding this comment

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

if polyfill-library uses a one of these third-party-polyfills itself, then updating that will not run the other tests?

Copy link
Owner Author

Choose a reason for hiding this comment

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

You're right! Hmm, what do you think we should do here? Not use polyfills in polyfill-library itself?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm not sure, i was making sure that i'd understood that right before even thinking about it. it's a hard one

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2020
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.

None yet

2 participants