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

tests(fr): snapshot audit id lists in api test #13994

Merged
merged 5 commits into from
Jun 22, 2022
Merged

Conversation

adamraine
Copy link
Member

Makes it easier to investigate regressions in this test.

@adamraine adamraine requested a review from a team as a code owner May 11, 2022 20:47
@adamraine adamraine requested review from brendankenny and removed request for a team May 11, 2022 20:47
@@ -50,8 +50,7 @@ describe('Fraggle Rock API', () => {
expect(accessibility.score).toBeLessThan(1);

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr);
// TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached.
expect(auditResults.length).toMatchInlineSnapshot(`73`);
expect(auditResults.map(audit => audit.id)).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

can some of these be removed? Like is this assertion accomplishing anything anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I personally think it's a good guard against regressions that remove snapshot support for certain audits.


expect(notApplicableAudits.length).toMatchInlineSnapshot(`5`);
expect(notApplicableAudits.map(audit => audit.id)).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

at least some of these notApplicable don't seem to have anything to do with FR-ness, just that they were notApplicable for this run. Seems like this will be covered by other tests now

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the reasoning behind this is that the N/A audits would vary a lot depending on if any network requests were fetched during the timespan.

@brendankenny
Copy link
Member

can some of these be removed? Like is this assertion accomplishing anything anymore?

I guess the counterargument is that this is the closest thing to a smoke test for some of this code right now.

In the spirit of those old FR-COMPAT comments, I would like it if we were still moving to a place where I don't have to double check yarn jest api-test-pptr -u often (only slightly less annoying than Computing artifact: NetworkRecords$J :)

@adamraine
Copy link
Member Author

I guess the counterargument is that this is the closest thing to a smoke test for some of this code right now.

This is definitely true. If we treat this as a smoke test, I think it's good to have a condition that catches mode-compatibility regressions. I feel like these conditions have saved me from making such errors.

@connorjclark
Copy link
Collaborator

@adamraine re-merge with master to be sure test still passes

@adamraine adamraine merged commit 26ff0fe into master Jun 22, 2022
@adamraine adamraine deleted the api-test-snapshot-file branch June 22, 2022 22:11
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.

4 participants