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

core(smoke): support a per-runner test exclusion list #14316

Merged
merged 13 commits into from
Aug 29, 2022

Conversation

alexnj
Copy link
Member

@alexnj alexnj commented Aug 24, 2022

Fixes #14127.

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

This will be very useful!

cli/test/smokehouse/config/config.js Outdated Show resolved Hide resolved
cli/test/smokehouse/config/config.js Outdated Show resolved Hide resolved
cli/test/smokehouse/frontends/smokehouse-bin.js Outdated Show resolved Hide resolved
@@ -193,8 +194,12 @@ async function begin() {
const requestedTestIds = argv._;
const {default: rawTestDefns} = await import(url.pathToFileURL(testDefnPath).href);
const allTestDefns = updateTestDefnFormat(rawTestDefns);
const excludedTests = new Set(exclusions[argv.runner] || []);
const filteredTestDefns = !excludedTests.size ? allTestDefns :
allTestDefns.filter(test => !excludedTests.has(test.id));
Copy link
Member

Choose a reason for hiding this comment

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

I think you're actually going to have to pass this into getDefinitionsToRun since if invertMatch is true this is actually going to add the excluded tests to the list of tests to run

Copy link
Member

Choose a reason for hiding this comment

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

In #14127 (comment) I suggested adding it to just this branch in getDefinitionsToRun

if (requestedIds.length === 0 && !invertMatch) {
smokes = [...allTestDefns];
console.log('Running ALL smoketests. Equivalent to:');
console.log(usage);

still seems reasonable so that you could still run yarn smoke --runner devtools redirects-scripts manually if the need ever arose.

If we wanted to support exclusions with invertMatch and the explicit case that gets a lot tricker, so maybe just punt on exclusions+invertMatch for when/if we actually need that?

Copy link
Member Author

Choose a reason for hiding this comment

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

What would be a good use case for invertMatch now? Previously it was being used to exclude tests.

Copy link
Member Author

@alexnj alexnj Aug 26, 2022

Choose a reason for hiding this comment

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

@brendankenny getDefinitionsToRun runs off the supplied list, which is already filtered. So the scenario of inversion adding excluded list wouldn't happen. The other case though, which is wanting to run an excluded test manually wouldn't work, and will require removal of exclusion from config.

Copy link
Member

Choose a reason for hiding this comment

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

getDefinitionsToRun runs off the supplied list, which is already filtered

whoops, yes, you're totally right

The other case though, which is wanting to run an excluded test manually wouldn't work, and will require removal of exclusion from config.

I guess I thought we were doing this from #14127 (comment), instead of having an explicit --ignore-exclusions flag. If someone is e.g. trying to get byte-efficiency working in devtools, running yarn smoke --runner devtools byte-efficiency simply won't run anything. It's not the end of the world to remember to go remove it from the exclusions list at that point, and I guess we can also just see how it goes in practice, but it also seems like it wouldn't be too hard to support?

Copy link
Member

@brendankenny brendankenny Aug 29, 2022

Choose a reason for hiding this comment

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

What would be a good use case for invertMatch now? Previously it was being used to exclude tests.

Probably not much. It was originally added for a weaker and much more awkward version of what sharding does now. We can survey if anyone else wants it (and double check if LR is using it/needs it for now), but otherwise removing (in some future PR) SG

Comment on lines 17 to 18
// Disabled because Chrome will follow the redirect first, and Lighthouse will
// only ever see/run the final URL.
Copy link
Member

Choose a reason for hiding this comment

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

ah, this is so much better now having these comments right by each group of tests being excluded

Co-authored-by: Brendan Kenny <bckenny@gmail.com>
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

two last comments but your call on both.

LGTM! Really happy to have all these in one accessible place

Comment on lines +23 to +27
// Disabled because these tests use settings that cannot be fully configured in
// DevTools (e.g. throttling method "provided").
'metrics-tricky-tti', 'metrics-tricky-tti-late-fcp', 'screenshot',
// Disabled because of differences that need further investigation
'byte-efficiency', 'byte-gzip', 'perf-preload',
Copy link
Member

Choose a reason for hiding this comment

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

@connorjclark should we open smoke backlog bugs for these? Both the explicitly needs investigation and if we can switch the metrics off of provided

@@ -193,8 +194,12 @@ async function begin() {
const requestedTestIds = argv._;
const {default: rawTestDefns} = await import(url.pathToFileURL(testDefnPath).href);
const allTestDefns = updateTestDefnFormat(rawTestDefns);
const excludedTests = new Set(exclusions[argv.runner] || []);
const filteredTestDefns = !excludedTests.size ? allTestDefns :
allTestDefns.filter(test => !excludedTests.has(test.id));
Copy link
Member

Choose a reason for hiding this comment

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

getDefinitionsToRun runs off the supplied list, which is already filtered

whoops, yes, you're totally right

The other case though, which is wanting to run an excluded test manually wouldn't work, and will require removal of exclusion from config.

I guess I thought we were doing this from #14127 (comment), instead of having an explicit --ignore-exclusions flag. If someone is e.g. trying to get byte-efficiency working in devtools, running yarn smoke --runner devtools byte-efficiency simply won't run anything. It's not the end of the world to remember to go remove it from the exclusions list at that point, and I guess we can also just see how it goes in practice, but it also seems like it wouldn't be too hard to support?

@@ -0,0 +1,31 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe rename the directory too to not overload config?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not the end of the world to remember to go remove it from the exclusions list at that point

I added a console line that lists excluded tests when a requested test is mismatched. So in this scenario, it would print:

Smoketests not found for: byte-efficiency
Check test exclusions (byte-efficiency)

This should help reminding the dev running smoke why a test can't be found. If this and the config edit in practice turns out inconvenient, we can add the --ignore-exclusions that @connorjclark initially suggested.

@@ -193,8 +194,12 @@ async function begin() {
const requestedTestIds = argv._;
const {default: rawTestDefns} = await import(url.pathToFileURL(testDefnPath).href);
const allTestDefns = updateTestDefnFormat(rawTestDefns);
const excludedTests = new Set(exclusions[argv.runner] || []);
const filteredTestDefns = !excludedTests.size ? allTestDefns :
allTestDefns.filter(test => !excludedTests.has(test.id));
Copy link
Member

@brendankenny brendankenny Aug 29, 2022

Choose a reason for hiding this comment

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

What would be a good use case for invertMatch now? Previously it was being used to exclude tests.

Probably not much. It was originally added for a weaker and much more awkward version of what sharding does now. We can survey if anyone else wants it (and double check if LR is using it/needs it for now), but otherwise removing (in some future PR) SG

@alexnj alexnj merged commit 650d4ff into GoogleChrome:master Aug 29, 2022
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.

yarn smoke should always take into account our current known test failures
4 participants