feat: shard modules and API integration tests (#6775)

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.
This commit is contained in:
Riqwan Thamir
2024-03-22 11:15:01 +00:00
committed by GitHub
parent 8929b2d60b
commit 4c98545ab3
13 changed files with 269 additions and 35 deletions
@@ -1323,12 +1323,15 @@ describe("/admin/price-lists", () => {
it("should delete all the prices that are part of the price list for the specified product", async () => {
const api = useApi()
response = await api.get("/admin/price-lists/test-list", adminReqConfig)
let response = await api.get(
"/admin/price-lists/test-list",
adminReqConfig
)
expect(response.status).toBe(200)
expect(response.data.price_list.prices.length).toBe(3)
let response = await api.delete(
response = await api.delete(
`/admin/price-lists/test-list/products/${product1.id}/prices`,
adminReqConfig
)
@@ -1353,13 +1356,16 @@ describe("/admin/price-lists", () => {
it("should delete all the prices that are part of the price list for the specified variant", async () => {
const api = useApi()
response = await api.get("/admin/price-lists/test-list", adminReqConfig)
let response = await api.get(
"/admin/price-lists/test-list",
adminReqConfig
)
expect(response.status).toBe(200)
expect(response.data.price_list.prices.length).toBe(3)
const variant = product2.variants[0]
let response = await api.delete(
response = await api.delete(
`/admin/price-lists/test-list/variants/${variant.id}/prices`,
adminReqConfig
)