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

feat: add scripts for testing in docker container #352

Merged
merged 10 commits into from
Jan 17, 2025

Conversation

Pavel-Tyan
Copy link
Contributor

@Pavel-Tyan Pavel-Tyan commented Dec 22, 2024

Add scripts for running screenshots tests in docker container for the same tests results on different OS.

Screenshot testing results depend on the OS. For this reason, tests are run in a Docker container with Ubuntu.

How it works:

Docker builds copy of app and runs screenshot tests in container. There are mounting for components and playwright-report folders. Due to this, the results of tests (screenshots, test report) in the container also appear on the host.

@yc-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

Without "HOME: /root" firefox crashes during testing in GitHub Actions
testing in pr-visual-tests.yml
Npm command for testing can be passed as argument for testing scripts.

Mount playwright-report folder to see test results from container
Add .dockerignore to ignore node_modules folders.
RUN npm ci
COPY . .
RUN cd demo && \
npm i && \
Copy link
Contributor

Choose a reason for hiding this comment

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

npm ci ?

Copy link
Contributor Author

@Pavel-Tyan Pavel-Tyan Jan 17, 2025

Choose a reason for hiding this comment

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

"npm ci" is used in ci.yml: https://github.com/diplodoc-platform/components/blob/master/.github/workflows/ci.yml#L24

With "npm i" testing in docker also works.

Change 'npm i' to 'npm ci' for demo folder
@martyanovandrey martyanovandrey merged commit 1a0671f into diplodoc-platform:master Jan 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants