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: render roundtrip proto lhr, check for undefined #14817

Merged
merged 5 commits into from
Feb 23, 2023

Conversation

connorjclark
Copy link
Collaborator

Includes the roundtrip proto LHR in the simple "fail if there is a runtime error" renderer test.

In addition to checks for undefined in the rendered output, this would have prevented the regression reported in #14808.

@connorjclark connorjclark requested a review from a team as a code owner February 21, 2023 21:15
@connorjclark connorjclark requested review from adamraine and removed request for a team February 21, 2023 21:15
/mobile/i.test(lhr.environment.hostUserAgent) :
true,
disabled: false,
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@brendankenny is this what you had in mind?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I was suggesting it should be obviously not available (vs hitting an obviously unhandled path that the undefinedxundefined string was suggesting), but I didn't have a good idea of what exactly that would consist of. This works for me!

@@ -203,6 +203,8 @@ function getTestFiles() {
grep = new RegExp(titles.map(escapeRegex).join('|'));

filteredTests = filteredTests.filter(file => failedTests.some(failed => failed.file === file));
} else if (argv.t) {
grep = argv.t;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

drive by - the -t flag wasn't being used.

@connorjclark connorjclark changed the title tests: render roundtrip proto lhr tests: render roundtrip proto lhr, check for undefined Feb 21, 2023
@@ -58,6 +58,9 @@ jobs:

- run: yarn test-proto # Run before unit-core because the roundtrip json is needed for proto tests.

- run: yarn build-viewer && yarn mocha --testMatch viewer/test/viewer-test-pptr.js -t 'proto roundtrip report'
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we just run viewer tests as part of the unit CI job and remove from basics?

Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

FWIW we aren't very consistent about if these pptr tests should be unit tests or not. I would be fine to just include the viewer pptr tests as "unit" tests so they run in the unit job automatically.

That being said, we should eventually like to separate these pptr tests as as a proper e2e test suite. This could include a separate e2e job rather than naming e2e tests slightly differently (-test-pptr.js) and putting them in basics.

@@ -77,6 +77,10 @@ jobs:
flags: unit
file: ./unit-coverage.lcov

# Runs here because it needs the roundtrip proto.
- name: yarn test-viewer
run: yarn build-viewer && xvfb-run --auto-servernum bash $GITHUB_WORKSPACE/.github/scripts/test-retry.sh yarn test-viewer
Copy link
Member

Choose a reason for hiding this comment

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

nit: could we do the yarn build-viewer step higher up with other setup stuff. Like after yarn build-report

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this makes it more clear it isn't needed for the rest of the steps, and that approach could make it likely we forget to remove it in a later refactor.

@connorjclark
Copy link
Collaborator Author

I agree @adamraine, but referring back to the original inclusion of these tests: this was a cost-effective approach of adding them. At the moment, I don't think it's worth to spend more time here.

@connorjclark connorjclark merged commit 516d32c into main Feb 23, 2023
@connorjclark connorjclark deleted the proto-render-test branch February 23, 2023 23:55
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