-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Conversation
There was a problem hiding this 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!
@@ -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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
lighthouse/cli/test/smokehouse/frontends/smokehouse-bin.js
Lines 52 to 55 in ec4b36b
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
cli/test/smokehouse/config/config.js
Outdated
// Disabled because Chrome will follow the redirect first, and Lighthouse will | ||
// only ever see/run the final URL. |
There was a problem hiding this comment.
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>
There was a problem hiding this 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
// 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', |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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 @@ | |||
/** |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
Fixes #14127.