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

Discrepancy between CI tests and local environment tests #452

Open
Demianeen opened this issue Apr 17, 2023 · 2 comments
Open

Discrepancy between CI tests and local environment tests #452

Demianeen opened this issue Apr 17, 2023 · 2 comments

Comments

@Demianeen
Copy link

Demianeen commented Apr 17, 2023

Describe the bug
I have encountered the bug that the tests in the CI environment for Loki are running differently compared to the tests that I run locally on my development environment. Specifically, I am observing discrepancies in the test results, with tests passing locally but failing in the CI environment.

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo
  2. Run npm run storybook and launch the Docker
  3. Run npm run test:ui and observe that the tests pass locally
  4. View the repo history and notice that all recent commits have failed to pass the tests

Expected behavior
I expect the tests to exhibit consistent behaviour across different environments, including both local development environments and the CI environment. Test results should be reproducible and consistent, regardless of the environment in which they are executed.

Environment:

  • Local: Macbook M1, Docker v4.17.0
  • CI: GitHub actions

package.json

"scripts": {
    "test:ui": "npx loki test",
    "test:ui:ok": "npx loki approve",
    "test:ui:ci": "npx loki --requireReference --reactUri file:./storybook-static",
    "storybook": "start-storybook -p 6006 -c ./config/storybook",
    "build:storybook": "build-storybook -c ./config/storybook",
  },,
"devDependencies": {
"loki": "^0.31.1",
},
"loki": {
    "configurations": {
      "chrome.laptop": {
        "target": "chrome.docker",
        "width": 1366,
        "height": 768,
        "deviceScaleFactor": 1,
        "mobile": false
      },
      "chrome.iphone7": {
        "target": "chrome.docker",
        "preset": "iPhone 7"
      }
    }
  }
@Demianeen
Copy link
Author

@KFilipchuk, do you have the same behaviour with my repo or with yours?

@KFilipchuk
Copy link

@KFilipchuk, do you have the same behaviour with my repo or with yours?

No longer actual, my mistake was with i18n in storybook. So stories were rendered in wrong languages and tests failed (only in CI) with components, that use translations

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

No branches or pull requests

2 participants