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: shard modules and API integration tests #6775

Merged
merged 34 commits into from Mar 22, 2024
Merged

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Mar 21, 2024

what:

  • runs module and api integration tests in matrix strategy
    • v28 of jest comes with sharding support, which we can utilize when we upgrade
  • splits the tests by number of matrix jobs and run them in parallel
    • This introduced some flakiness in some specs, but couldn't reproduce locally. Those have been skipped for now.
  • uses swc/jest for added performance
    • Locally, a chunk took 90 seconds with babel and 30 seconds with swc.
    • This translated to 2 mins saved per shard in CI, but haven't tested this enough.

Copy link

changeset-bot bot commented Mar 21, 2024

⚠️ No Changeset found

Latest commit: 5c13338

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 22, 2024 11:03am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Mar 22, 2024 11:03am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Mar 22, 2024 11:03am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Mar 22, 2024 11:03am

@riqwan
Copy link
Contributor Author

riqwan commented Mar 22, 2024

@adrien2p thanks that makes sense, I’ll try migrating the flaky ones to see if that fixes it.

@olivermrbl
Copy link
Contributor

If it happens in the module then we need to investigate cause if they are using our runner there is one db per suite

@adrien2p, one of the skipped tests (cart.js) is using the moduleIntegrationTestRunner, so we might need to dig into this one.

@adrien2p
Copy link
Member

Yes ill have a look

Copy link
Member

@sradevski sradevski left a comment

Choose a reason for hiding this comment

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

Amazing stuff, such an improvement 👍

@@ -65,7 +65,7 @@ medusaIntegrationTestRunner({
})

describe("POST /store/carts", () => {
it("should create a cart", async () => {
it.skip("should create a cart", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Let's just follow-up and re-enable these, but it shouldn't be a blocker IMO

Copy link
Member

Choose a reason for hiding this comment

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

yeah it is not for that pr, I am investigating it but if there is an issue it is separate

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, would also just get this in now, and resolve (future) flaky tests in follow-up PRs

@adrien2p
Copy link
Member

@riqwan I am trying to investigate the cart just so you know

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

🏆

@riqwan
Copy link
Contributor Author

riqwan commented Mar 22, 2024

Wasn't expecting an approval yet. 😄 I had some more things to do here, but it might be a good idea to take this out for a spin.

We will still be limited by the unit tests, it takes about 20 mins. I wanted to split that into 3 buckets as well, but I need to brush up on my bash skills and configure turbo to filter them. But that can come as a follow up! 🤞🏻

@riqwan riqwan marked this pull request as ready for review March 22, 2024 09:01
@riqwan riqwan requested review from a team as code owners March 22, 2024 09:01
@riqwan riqwan changed the title experiment: shard modules test feat: shard modules and API integration tests Mar 22, 2024
Copy link
Contributor

@pKorsholm pKorsholm left a comment

Choose a reason for hiding this comment

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

Amazing 😍

@kodiakhq kodiakhq bot merged commit 4c98545 into develop Mar 22, 2024
24 checks passed
@riqwan riqwan deleted the feat/jest-sharding branch March 22, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants