feat(medusa-payment-paypal,medusa-payment-stripe): speed up unit tests in CI (#6806)
* chore: shard unit tests * chore: move paypal and stripe to swc * chore: update actions * chore: refactor http paypal client * chore: added changeset * chore: remove medusa changes
This commit is contained in:
1 parent
9073d7aba3
commit
bacfa3e17b
14 files changed
+141
-144
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"medusa-payment-paypal": patch
|
||||||
|
"medusa-payment-stripe": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat(medusa-payment-paypal,medusa-payment-stripe): speed up unit tests in CI
|
||||||
@@ -17,3 +17,6 @@ runs:
|
|||||||
# We want to only bootstrap and install if no cache is found.
|
# We want to only bootstrap and install if no cache is found.
|
||||||
- run: yarn install --immutable
|
- run: yarn install --immutable
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- run: yarn build
|
||||||
|
shell: bash
|
||||||
@@ -29,10 +29,6 @@ runs:
|
|||||||
with:
|
with:
|
||||||
extension: ${{ inputs.cache-extension }}
|
extension: ${{ inputs.cache-extension }}
|
||||||
|
|
||||||
- name: Build Packages
|
|
||||||
shell: "bash"
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Install dev cli
|
- name: Install dev cli
|
||||||
shell: "bash"
|
shell: "bash"
|
||||||
run: sudo npm i -g medusa-dev-cli
|
run: sudo npm i -g medusa-dev-cli
|
||||||
|
|||||||
+77
-112
@@ -13,54 +13,8 @@ jobs:
|
|||||||
module-chunks: ${{ steps.set-module-chunks.outputs.chunks }}
|
module-chunks: ${{ steps.set-module-chunks.outputs.chunks }}
|
||||||
api-matrix: ${{ steps.set-api-matrix.outputs.matrix }}
|
api-matrix: ${{ steps.set-api-matrix.outputs.matrix }}
|
||||||
api-chunks: ${{ steps.set-api-chunks.outputs.chunks }}
|
api-chunks: ${{ steps.set-api-chunks.outputs.chunks }}
|
||||||
steps:
|
unit-tests-matrix: ${{ steps.set-unit-tests-matrix.outputs.matrix }}
|
||||||
- name: Checkout
|
unit-tests-chunks: ${{ steps.set-unit-tests-chunks.outputs.chunks }}
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16.10.0"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Assert changed
|
|
||||||
run: ./scripts/assert-changed-files-actions.sh "packages"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./.github/actions/cache-deps
|
|
||||||
with:
|
|
||||||
extension: pipeline
|
|
||||||
|
|
||||||
- id: set-module-chunks
|
|
||||||
name: Set Module Chunks
|
|
||||||
working-directory: integration-tests/modules
|
|
||||||
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- id: set-module-matrix
|
|
||||||
name: Set Module Matrix
|
|
||||||
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
CHUNKS: ${{ steps.set-module-chunks.outputs.chunks }}
|
|
||||||
|
|
||||||
- id: set-api-chunks
|
|
||||||
name: Set API Chunks
|
|
||||||
working-directory: integration-tests/api
|
|
||||||
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 3 | ceil)]')" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- id: set-api-matrix
|
|
||||||
name: Set API Matrix
|
|
||||||
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
CHUNKS: ${{ steps.set-api-chunks.outputs.chunks }}
|
|
||||||
|
|
||||||
unit-tests:
|
|
||||||
needs: setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
- name: Cancel Previous Runs
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
uses: styfle/cancel-workflow-action@0.11.0
|
||||||
@@ -86,11 +40,68 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
extension: pipeline
|
extension: pipeline
|
||||||
|
|
||||||
- name: Build Packages
|
- id: set-module-chunks
|
||||||
run: yarn build
|
name: Set Module Chunks
|
||||||
|
working-directory: integration-tests/modules
|
||||||
|
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- id: set-module-matrix
|
||||||
|
name: Set Module Matrix
|
||||||
|
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
CHUNKS: ${{ steps.set-module-chunks.outputs.chunks }}
|
||||||
|
|
||||||
|
- id: set-api-chunks
|
||||||
|
name: Set API Chunks
|
||||||
|
working-directory: integration-tests/api
|
||||||
|
run: echo "chunks=$(yarn run jest --listTests --json | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- id: set-api-matrix
|
||||||
|
name: Set API Matrix
|
||||||
|
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
CHUNKS: ${{ steps.set-api-chunks.outputs.chunks }}
|
||||||
|
|
||||||
|
- id: set-unit-tests-chunks
|
||||||
|
name: Set Unit Tests Chunks
|
||||||
|
run: echo "chunks=$(yarn workspaces list --json | jq -j '[inputs | .name]' | jq -r | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- id: set-unit-tests-matrix
|
||||||
|
name: Set Unit Tests Matrix
|
||||||
|
run: echo "matrix=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
CHUNKS: ${{ steps.set-unit-tests-chunks.outputs.chunks }}
|
||||||
|
|
||||||
|
unit-tests-matrix:
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Shard (${{ matrix.chunk }}) Unit Tests
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
chunk: ${{ fromJSON(needs.setup.outputs.unit-tests-matrix) }}
|
||||||
|
env:
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Assert changed
|
||||||
|
run: ./scripts/assert-changed-files-actions.sh "packages"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: ./.github/actions/cache-deps
|
||||||
|
with:
|
||||||
|
extension: pipeline
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: yarn test
|
run: yarn test:chunk
|
||||||
|
env:
|
||||||
|
CHUNK: ${{ matrix.chunk }}
|
||||||
|
CHUNKS: ${{ needs.setup.outputs.unit-tests-chunks }}
|
||||||
|
|
||||||
integration-tests-packages:
|
integration-tests-packages:
|
||||||
needs: setup
|
needs: setup
|
||||||
@@ -123,30 +134,16 @@ jobs:
|
|||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/cache-deps
|
uses: ./.github/actions/cache-deps
|
||||||
with:
|
with:
|
||||||
extension: pipeline
|
extension: pipeline
|
||||||
|
|
||||||
- name: Build Packages
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: yarn test:integration:packages
|
run: yarn test:integration:packages
|
||||||
env:
|
env:
|
||||||
@@ -189,30 +186,16 @@ jobs:
|
|||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16.10.0"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/cache-deps
|
uses: ./.github/actions/cache-deps
|
||||||
with:
|
with:
|
||||||
extension: pipeline
|
extension: pipeline
|
||||||
|
|
||||||
- name: Build Packages
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Run API integration tests
|
- name: Run API integration tests
|
||||||
run: yarn test:integration:api
|
run: yarn test:integration:api
|
||||||
env:
|
env:
|
||||||
@@ -237,6 +220,21 @@ jobs:
|
|||||||
- run: exit 0
|
- run: exit 0
|
||||||
if: ${{ contains(needs.integration-tests-api-matrix.result, 'success') }}
|
if: ${{ contains(needs.integration-tests-api-matrix.result, 'success') }}
|
||||||
|
|
||||||
|
unit-tests:
|
||||||
|
if: ${{ always() }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: unit-tests-matrix
|
||||||
|
steps:
|
||||||
|
- run: exit 1
|
||||||
|
if: >-
|
||||||
|
${{
|
||||||
|
contains(needs.unit-tests-matrix.result, 'failure')
|
||||||
|
|| contains(needs.unit-tests-matrix.result, 'cancelled')
|
||||||
|
|| contains(needs.unit-tests-matrix.result, 'skipped')
|
||||||
|
}}
|
||||||
|
- run: exit 0
|
||||||
|
if: ${{ contains(needs.unit-tests-matrix.result, 'success') }}
|
||||||
|
|
||||||
integration-tests-plugins:
|
integration-tests-plugins:
|
||||||
needs: setup
|
needs: setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -259,11 +257,6 @@ jobs:
|
|||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -280,9 +273,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
extension: pipeline
|
extension: pipeline
|
||||||
|
|
||||||
- name: Build Packages
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Run plugin integration tests
|
- name: Run plugin integration tests
|
||||||
run: yarn test:integration:plugins
|
run: yarn test:integration:plugins
|
||||||
env:
|
env:
|
||||||
@@ -316,30 +306,16 @@ jobs:
|
|||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16.10.0"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/cache-deps
|
uses: ./.github/actions/cache-deps
|
||||||
with:
|
with:
|
||||||
extension: pipeline
|
extension: pipeline
|
||||||
|
|
||||||
- name: Build Packages
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Run Modules integration tests
|
- name: Run Modules integration tests
|
||||||
run: yarn test:integration:modules
|
run: yarn test:integration:modules
|
||||||
env:
|
env:
|
||||||
@@ -386,22 +362,11 @@ jobs:
|
|||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.11.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16.10.0"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/cache-deps
|
uses: ./.github/actions/cache-deps
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -71,6 +71,7 @@
|
|||||||
"prettier": "prettier",
|
"prettier": "prettier",
|
||||||
"jest": "jest",
|
"jest": "jest",
|
||||||
"test": "turbo run test --concurrency=50% --no-daemon",
|
"test": "turbo run test --concurrency=50% --no-daemon",
|
||||||
|
"test:chunk": "./scripts/run-workspace-unit-tests-in-chunks.sh",
|
||||||
"test:integration:packages": "turbo run test:integration --concurrency=50% --no-daemon --filter='./packages/*'",
|
"test:integration:packages": "turbo run test:integration --concurrency=50% --no-daemon --filter='./packages/*'",
|
||||||
"test:integration:api": "turbo run test:integration:chunk --concurrency=50% --no-daemon --filter=integration-tests-api",
|
"test:integration:api": "turbo run test:integration:chunk --concurrency=50% --no-daemon --filter=integration-tests-api",
|
||||||
"test:integration:plugins": "turbo run test:integration --concurrency=50% --no-daemon --filter=integration-tests-plugins",
|
"test:integration:plugins": "turbo run test:integration --concurrency=50% --no-daemon --filter=integration-tests-plugins",
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es5",
|
||||||
|
"parser": {
|
||||||
|
"syntax": "typescript"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
globals: {
|
|
||||||
"ts-jest": {
|
|
||||||
tsconfig: "tsconfig.spec.json",
|
|
||||||
isolatedModules: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.[jt]s?$": "ts-jest",
|
"^.+\\.[jt]s?$": "@swc/jest",
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: [
|
transformIgnorePatterns: ["/node_modules/(?!(axios)/).*", "dist"],
|
||||||
"/node_modules/(?!(axios)/).*"
|
|
||||||
],
|
|
||||||
testEnvironment: `node`,
|
testEnvironment: `node`,
|
||||||
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
|
moduleFileExtensions: [`js`, `ts`],
|
||||||
}
|
}
|
||||||
@@ -18,13 +18,15 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
||||||
"test": "jest --passWithNoTests src",
|
"test": "jest --runInBand --bail --forceExit",
|
||||||
"build": "rimraf dist && tsc",
|
"build": "rimraf dist && tsc",
|
||||||
"watch": "tsc --watch"
|
"watch": "tsc --watch"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@medusajs/medusa": "^1.12.2",
|
"@medusajs/medusa": "^1.12.2",
|
||||||
"@medusajs/types": "^1.8.10",
|
"@medusajs/types": "^1.8.10",
|
||||||
|
"@swc/core": "^1.4.8",
|
||||||
|
"@swc/jest": "^0.2.36",
|
||||||
"@types/stripe": "^8.0.417",
|
"@types/stripe": "^8.0.417",
|
||||||
"cross-env": "^5.2.1",
|
"cross-env": "^5.2.1",
|
||||||
"jest": "^25.5.4",
|
"jest": "^25.5.4",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import { Logger } from "@medusajs/medusa"
|
||||||
import axios, { AxiosInstance, AxiosRequestConfig, Method } from "axios"
|
import axios, { AxiosInstance, AxiosRequestConfig, Method } from "axios"
|
||||||
import {
|
import {
|
||||||
PaypalApiPath,
|
PaypalApiPath,
|
||||||
PaypalEnvironmentPaths,
|
PaypalEnvironmentPaths,
|
||||||
PaypalSdkOptions,
|
PaypalSdkOptions,
|
||||||
} from "./types"
|
} from "./types"
|
||||||
import { Logger } from "@medusajs/medusa"
|
|
||||||
|
|
||||||
const MAX_ATTEMPTS = 2
|
const MAX_ATTEMPTS = 2
|
||||||
|
|
||||||
@@ -31,15 +31,7 @@ export class PaypalHttpClient {
|
|||||||
this.httpClient_ = new Proxy(axiosInstance, {
|
this.httpClient_ = new Proxy(axiosInstance, {
|
||||||
// Handle automatic retry mechanism
|
// Handle automatic retry mechanism
|
||||||
get: (target, prop) => {
|
get: (target, prop) => {
|
||||||
// @ts-ignore
|
return this.retryIfNecessary(target[prop].bind(target))
|
||||||
// eslint-disable-next-line prefer-rest-params
|
|
||||||
const original = Reflect.get(...arguments)
|
|
||||||
|
|
||||||
if ("request" === (prop as string)) {
|
|
||||||
return this.retryIfNecessary(original)
|
|
||||||
}
|
|
||||||
|
|
||||||
return original
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.[jt]s?$": "ts-jest",
|
"^.+\\.[jt]s?$": "@swc/jest",
|
||||||
},
|
},
|
||||||
testEnvironment: `node`,
|
testEnvironment: `node`,
|
||||||
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
|
moduleFileExtensions: [`js`, `ts`, `json`],
|
||||||
|
modulePathIgnorePatterns: ["dist", "node_modules"],
|
||||||
}
|
}
|
||||||
@@ -18,13 +18,15 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
||||||
"test": "jest --passWithNoTests src",
|
"test": "jest --runInBand --bail --forceExit",
|
||||||
"build": "rimraf dist && tsc -p ./tsconfig.server.json && medusa-admin bundle",
|
"build": "rimraf dist && tsc -p ./tsconfig.server.json && medusa-admin bundle",
|
||||||
"watch": "tsc --watch"
|
"watch": "tsc --watch"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@medusajs/admin": "^7.1.10",
|
"@medusajs/admin": "^7.1.10",
|
||||||
"@medusajs/medusa": "^1.20.3",
|
"@medusajs/medusa": "^1.20.3",
|
||||||
|
"@swc/core": "^1.4.8",
|
||||||
|
"@swc/jest": "^0.2.36",
|
||||||
"@tanstack/react-table": "^8.7.9",
|
"@tanstack/react-table": "^8.7.9",
|
||||||
"@types/stripe": "^8.0.417",
|
"@types/stripe": "^8.0.417",
|
||||||
"awilix": "^8.0.1",
|
"awilix": "^8.0.1",
|
||||||
|
|||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Get array of workspaces
|
||||||
|
# convert NDJSON stream to an array of arrays, divided by chunk size
|
||||||
|
# The reason we do a conditional here is that github actions thinks that there is
|
||||||
|
# a secret present with the output of this and therefore refuses to share data between jobs
|
||||||
|
if [ -z "${CHUNKS}" ]; then
|
||||||
|
export CHUNKS=$(yarn workspaces list --json | jq -j '[inputs | .name]' | jq -r | jq -cM '[_nwise(length / 2 | ceil)]')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get the workspaces of the current CHUNK environment
|
||||||
|
workspaces=$(echo $CHUNKS | jq -r ".[$CHUNK]")
|
||||||
|
|
||||||
|
echo "workspaces - $workspaces"
|
||||||
|
# Initialize an empty string for the filters
|
||||||
|
filters=""
|
||||||
|
|
||||||
|
# Loop through each workspace in the array
|
||||||
|
for workspace in $(echo "$workspaces" | jq -r '.[]'); do
|
||||||
|
# Add the workspace name to the filters array as an argument
|
||||||
|
filters+=" --filter=${workspace}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run the test in the selected chunk
|
||||||
|
yarn run test $filters
|
||||||
@@ -6,15 +6,12 @@
|
|||||||
"outputs": ["!node_modules/**", "!src/**", "*/**"]
|
"outputs": ["!node_modules/**", "!src/**", "*/**"]
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"dependsOn": ["build"],
|
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"test:integration": {
|
"test:integration": {
|
||||||
"dependsOn": ["build"],
|
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"test:integration:chunk": {
|
"test:integration:chunk": {
|
||||||
"dependsOn": ["build"],
|
|
||||||
"outputs": []
|
"outputs": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -38016,6 +38016,8 @@ __metadata:
|
|||||||
"@medusajs/medusa": ^1.12.2
|
"@medusajs/medusa": ^1.12.2
|
||||||
"@medusajs/types": ^1.8.10
|
"@medusajs/types": ^1.8.10
|
||||||
"@paypal/checkout-server-sdk": ^1.0.3
|
"@paypal/checkout-server-sdk": ^1.0.3
|
||||||
|
"@swc/core": ^1.4.8
|
||||||
|
"@swc/jest": ^0.2.36
|
||||||
"@types/stripe": ^8.0.417
|
"@types/stripe": ^8.0.417
|
||||||
axios: ^1.3.4
|
axios: ^1.3.4
|
||||||
body-parser: ^1.19.0
|
body-parser: ^1.19.0
|
||||||
@@ -38037,6 +38039,8 @@ __metadata:
|
|||||||
"@medusajs/admin": ^7.1.10
|
"@medusajs/admin": ^7.1.10
|
||||||
"@medusajs/medusa": ^1.20.3
|
"@medusajs/medusa": ^1.20.3
|
||||||
"@medusajs/utils": ^1.11.7
|
"@medusajs/utils": ^1.11.7
|
||||||
|
"@swc/core": ^1.4.8
|
||||||
|
"@swc/jest": ^0.2.36
|
||||||
"@tanstack/react-table": ^8.7.9
|
"@tanstack/react-table": ^8.7.9
|
||||||
"@types/stripe": ^8.0.417
|
"@types/stripe": ^8.0.417
|
||||||
awilix: ^8.0.1
|
awilix: ^8.0.1
|
||||||
|
|||||||
Reference in new issue
Block a user