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

Try/e2e jest #52786

Closed
wants to merge 11 commits into from
Closed

Try/e2e jest #52786

wants to merge 11 commits into from

Conversation

scinos
Copy link
Contributor

@scinos scinos commented May 12, 2021

Changes proposed in this Pull Request

Migrate Calypso e2e tests to Jest.

This is not meant to be merged as is, but an exploration of what we would need to do a full migration and what would be the pros and cons.

Migration:

The migration itself is quite trivial. There are a few changes we have to make to our tests, but mostly can be done by search&replace:

  • There is no this.timeout():
    • For tests, we can have an equivalent jest.setTimeout() in the setup files.
    • For hooks, we can pass the timeout as the second parameter.
  • before/after hooks should be renamed to beforeAll/afterAll
  • Hooks can't have a name

And that's pretty much it. The rest is split files with multiple @parallel suites, set up Jest and configure the build to use Jest instead of Magellan.

Pros:

  • Seems to be a bit faster. I got a build in 3m:10s, while trunk is about 3m:30s. This doesn't even use Jest caching, so it may end up running in less than 3 minutes.

  • jest-teamcity reporter adds the test filename as part of the test name in TeamCity. This can help identify which tests is failing:
    image

  • Log are much easier to read, even when running multiple tests in parallel. It is easy to see what was the test suite, what step failed, the error and the stack trace:
    image

Cons:

  • jest-teamcity reporter adds the test filename as part of the test name... which means that renaming a file will erase the history of the test in TeamCity, as it will appear as a new test.

@scinos scinos changed the base branch from trunk to ci/e2e/cleanup-config May 12, 2021 13:35
@github-actions
Copy link

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@scinos scinos force-pushed the ci/e2e/cleanup-config branch from af99dfa to 7c0f10f Compare May 13, 2021 03:53
Base automatically changed from ci/e2e/cleanup-config to trunk May 13, 2021 04:08
@scinos
Copy link
Contributor Author

scinos commented Jun 15, 2021

Implemented in #53702

@scinos scinos closed this Jun 15, 2021
@sirreal sirreal deleted the try/e2e-jest branch January 14, 2025 17:52
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.

2 participants