-
Notifications
You must be signed in to change notification settings - Fork 209
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
kie-issues#1114: Containerize Playwright end-to-end tests to resolve screenshot comparison issues caused by OS differences #2866
kie-issues#1114: Containerize Playwright end-to-end tests to resolve screenshot comparison issues caused by OS differences #2866
Conversation
Thank you @ljmotta . Please, let us know this is ready for a verification. I will try on non-MAC environment. |
@jomarko This PR can be tested for macOS and Linux. I still need to make some adjustments for native Windows (non WSL). |
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.
Awesome PR @ljmotta! This will make our e2e tests more stable and concise!
I've made some comments below about the package.json scripts; let me know what you think.
@tiagobento I've renamed
Currently, KIE Sandbox tests aren't working on macOS containers. I'm not sure why. I've tried debugging it, but I haven't found any obvious cause. The DMN and BPMN Editors are stuck in an infinite loading state and aren't fetching their respective envelopes. The shared worker is stuck in the |
Did you try serving |
@tiagobento @thiagoelg gave me the idea of removing the EDIT:
|
Thank you @ljmotta. From what I understand I believe the option benefiting the larger surface area would be option 2. Please confirm if the following statement is correct: If we go with option 2:
If this is accurate, then you have my blessing to go with it 😛 |
Yeah, that's correct. And just to be more clear. With option 2, the macOS arm64 users will not be able to run any |
4a73e71
to
d393657
Compare
c412e61
to
0640d15
Compare
0a55a93
to
5539cbf
Compare
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.
Awesome work @ljmotta! LGTM
I just double checked all screenshots. It's looking good. @tiagobento could you review the PR one more time? |
@@ -61,6 +62,35 @@ const customConfig = defineConfig({ | |||
timeout: 240000, | |||
}, | |||
], | |||
// Override | |||
projects: process.env.KIE_TOOLS_ONLINE_EDITOR__SKIP_PLAYWRIGHT_FOR_ARM64 |
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.
Not using build-env
here and directly accessing an env var. This is not aligned with the repository's convention...
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 env var is only used for a workaround. I didn't add it to the build-env
as it runs a bash
script:
"test-e2e:container:up:darwin": KIE_TOOLS_ONLINE_EDITOR__SKIP_PLAYWRIGHT_FOR_ARM64=$( [[ $(uname -p) == \"arm\" ]] ...
I'm not sure how we could add this to the env.js
file...
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.
Well, I could export the variable in the script, to use it in the playwright.config.ts
... 😅
playwright: | ||
platform: linux/amd64 | ||
container_name: kie-tools-playwright-containerization-scesim-editor | ||
image: dev.local/${USER}/kie-tools-playwright-container-image:${PROJECT_VERSION} |
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 name is not parameterized, and the ${USER} component there seems unnecessary. WDYT about
dev.local/apache-kie-tools/playwright-e2e-tests-image
?
@@ -61,6 +62,35 @@ const customConfig = defineConfig({ | |||
timeout: 240000, | |||
}, | |||
], | |||
// Override | |||
projects: process.env.KIE_TOOLS_ONLINE_EDITOR__SKIP_PLAYWRIGHT_FOR_ARM64 |
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.
Not using build-env to access an environment variable...
playwright: | ||
platform: linux/amd64 | ||
container_name: kie-tools-playwright-containerization-online-editor | ||
image: dev.local/${USER}/kie-tools-playwright-container-image:${PROJECT_VERSION} |
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.
Images should have its tag version aligned with streamName
, not with version
.
Also the ${USER} component seems unnecessary..
WDYT about dev.local/apache-kie-tools/playwright-e2e-tests-image
?
Closes apache/incubator-kie-issues#1114
Closes #2839
Description
This PR introduces containerized end-to-end (E2E) Playwright tests to ensure consistent and reliable test execution across environments. By default, after this PR, running the E2E tests locally and in the CI will use containers instead of running natively in the OS.
Tests were executed in the following environments:
This PR updates multiple screenshots, as the changes introduced allowed lowering the snapshot threshold from 10% to 0.1%!
Known Issues
Trying it out
@kie-tools/playwright-base
image with the following command:Updating screenshots
To update screenshots, use the
pnpm test-e2e:container:shell
script to open a shell inside the container:To improve performance, you can filter which tests will run by adding the
-g
flag:pnpm test-e2e:run -u -g "test name"