Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
tests: add heading key tests #10746
tests: add heading key tests #10746
Changes from 1 commit
1c9a0a1
ce63cf0
7cd794c
8d78b10
39f4dc8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
:/
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.
face was to the param type we're stuck with forever, not this function, btw :)
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 don't really like this. I'd prefer to do something like
process.env.LIGHTHOUSE_UNDER_TEST
like I've done in other projects if others are open to it?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'm not wild about setting a precedent and seeing that spread, though :) And it's kind of a bummer to only catch it in CI and not through local testing (I guess
yarn unit:core
could set the flag butyarn jest my-audit
wouldn't).I think it's probably good without the CI check, actually. It might be different if we were constructing table columns dynamically, but AFAIK all headers are hardcoded in their audits (and our general design approach and i18n means we'll likely continue doing that), so if a LH dev runs their audit and gets any kind of table output from it (unit, smoke, or sample_v2) it should hit this and get corrected before it could ever throw for an end user.
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.
Are you suggesting removing the
&& !process.env.CI
bit or the entire if?I'm a little hesitant for removing the entire
if
if we currently have cases where rows are conditionally one type or another and a key might be validly missing in some situations. I don't think that's the case, but with 100+ audits I'm not sure and the failure mode is tanking the entire audit's results.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.
Yeah, I didn't think about the fact that a row value can be set to undefined to have an empty cell, and it's perfectly possible for a table to end up with rows that all happen to have an empty cell there. That would happen with
performance-budgets
, for instance, if either the number of requests or size went over budget but not both, but it would pass this test because they're explicitly set toundefined
.Since in theory this assertion will force audit authors to set explicit
undefined
to avoid false negatives anyways (if it's possible to have a table like that you should probably have a test for it, at which point you have to set an explicitundefined
so this check passes in CI) it would be better to just be a requirement, rather than a requirement for any code paths that happen to run in tests.If the blocker is going through the existing audits with tables, that's not insurmountable. We could divide them up pretty easily (I see 40
makeTableDetails
and 5makeOpportunityDetails
calls)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 is the only other fix it found once #10743 landed
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.
yikes