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

[Reporting] Enable CI test coverage for generated PDFs #191559

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Aug 27, 2024

Summary

Closes #117814
Revival of #113910

Blocked by https://github.com/elastic/kibana-operations/issues/193

This PR introduces https://github.com/dichovsky/pdf-visual-compare to the dev dependencies, and adds a single test to verify a PDF from the Dashboard app. If successful, we will add more tests that include multi-page PDF, and cover Canvas app and more.

STATUS: Since the module introduced in this PR has an indirect dependency on node-canvas, this is blocked on a request with @elastic/kibana-operations to make node-canvas prebuilds available to Kibana developers. Without that, node-canvas would require prebuilds to compile locally which creates a negative experience for developers.

@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Aug 27, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@tsullivan tsullivan requested a review from a team August 27, 2024 22:47
@tsullivan tsullivan force-pushed the screenshotting/pdf-test-coverage branch from d4b37e5 to 4cf61d5 Compare August 27, 2024 22:48
@tsullivan tsullivan force-pushed the screenshotting/pdf-test-coverage branch from 58fc6ad to aaaebe6 Compare August 28, 2024 00:08
@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 28, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #45 / dashboard Reporting Dashboard Reporting Screenshots Sample data from Kibana 7.6 PDF file matches the baseline image
  • [job] [logs] FTR Configs #45 / dashboard Reporting Dashboard Reporting Screenshots Sample data from Kibana 7.6 PDF file matches the baseline image
  • [job] [logs] Jest Tests #15 / TextBasedLanguagesEditor should render the correct buttons for the expanded code editor mode
  • [job] [logs] Jest Tests #15 / TextBasedLanguagesEditor should render the correct buttons for the expanded code editor mode

Metrics [docs]

✅ unchanged

History

  • 💔 Build #230314 failed 58fc6ade3097774009038ff512b2231deab9aa3d

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

await comparePdf(sessionReportPath, baselinePath, {
compareThreshold: 0.035,
})
).to.be(true);
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'm not satisfied that a test failure yields the message Expected "false" to be "true", unfortunately it isn't the nature of pdf-visual-compare to yield an actual percentage of difference. That is something we do get with the compare PNG method. This PR should be reworked to use something more like an older solution that was previously explored.

@tsullivan tsullivan marked this pull request as draft September 19, 2024 14:37
@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Reporting] CI test coverage for generating PDFs (both print-optimized and preserve layout)
4 participants