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

Add Docs Tests #2502

Merged
merged 2 commits into from
Feb 24, 2024
Merged

Add Docs Tests #2502

merged 2 commits into from
Feb 24, 2024

Conversation

ada-x64
Copy link
Contributor

@ada-x64 ada-x64 commented Jan 17, 2024

Currently on https://perspective.finos.org, there are broken examples on the home page. This occurs on X/Y scatter plots due to a failing migration.
Building and testing on main does not replicate the bug, as the website is running on v2.7.1 and a fix has been added since that release.
This PR simply adds tests for the examples (one for each example, totaling 75) to ensure this doesn't happen again.

@ada-x64
Copy link
Contributor Author

ada-x64 commented Jan 29, 2024

We've added HTML reporting to this PR. This allows us to download an artifact containing the results of the test.
File sizes might be an issue with this. See the 1.27GB playwright-report artifact generated in #2515. This was with 75 errors and 3 retries, bloating the results to 225 trace files, 250 webms, and 180 pngs.

@ada-x64 ada-x64 force-pushed the chores/docs-tests branch 2 times, most recently from a253939 to fb317d0 Compare January 30, 2024 20:11
@ada-x64
Copy link
Contributor Author

ada-x64 commented Feb 13, 2024

Another update:
SVG snapshot comparisons exist, but were broken on master. There were several tests which were producing empty snapshots, and some which were broken because of bunk selectors. I've updated the SVG comparison code to account for this. In addition, the SVG comparison function now checks all element children, so it should be suitable for general use. To reduce the number of changes in the PR, I'll reserve that change to future work.

fix broken svg comparisons
@texodus texodus added the internal Internal refactoring and code quality improvement label Feb 24, 2024
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good!

@@ -157,7 +161,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
quiet: true,
reporter: process.env.CI ? "github" : "dot",
reporter: process.env.CI ? [["github"], ["html"]] : [["dot"]],
Copy link
Member

Choose a reason for hiding this comment

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

?

@@ -49,6 +49,11 @@ async function run_with_theme(page, is_dark = false) {
await page.goto("http://localhost:8080/");
await page.setContent(template(is_dark));
await page.setViewport(DEFAULT_VIEWPORT);
await page.evaluate(async () => {
while (!window.__TEST_PERSPECTIVE_READY__) {
Copy link
Member

Choose a reason for hiding this comment

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

If __TEST_PERSPECTIVE_READY__ were a Promise, we could just await it here.

await page.evaluate(async (config) => {
const viewer = document.querySelector("perspective-viewer");
await viewer.reset();
await viewer.restore(config);
}, new_config);

await page.waitForSelector("perspective-viewer:not([updating])");
Copy link
Member

Choose a reason for hiding this comment

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

What is the story behind this + lines 52-56 in this file?

with:
name: playwright-report
path: tools/perspective-test/playwright-report/
retention-days: 30
Copy link
Member

Choose a reason for hiding this comment

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

I will keep an eye on the impact of these artifacts on our GitHub footprint!

@texodus texodus merged commit 8e4c9a1 into finos:master Feb 24, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal refactoring and code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants