Skip to content

Commit

Permalink
fix: split integration mutation into 2 jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Sujith <[email protected]>
  • Loading branch information
sujithvn committed Jun 15, 2023
1 parent d19cc2d commit 6c787e8
Show file tree
Hide file tree
Showing 197 changed files with 42 additions and 6 deletions.
40 changes: 37 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
pnpm run test:integration:query
resource_class: xlarge

test-integration-mutation:
test-integration-mutation1:
<<: *defaults
docker:
- image: cimg/node:18.10.0
Expand Down Expand Up @@ -154,7 +154,38 @@ jobs:
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
pnpm run test:integration:mutation
pnpm run test:integration:mutation1
resource_class: xlarge

test-integration-mutation2:
<<: *defaults
docker:
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
steps:
- checkout
- restore_cache:
keys:
- reaction-v7-node-modules-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
- reaction-v7-node-modules-{{ .Branch }}
- <<: *install_pnpm
- <<: *pnpm_install
- run:
name: Run Integration Mutation Tests
environment:
MONGO_URL: mongodb://localhost:27017/test
MONGO_USE_UNIFIED_TOPOLOGY: false
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
pnpm run test:integration:mutation2
resource_class: xlarge

release:
Expand Down Expand Up @@ -248,7 +279,10 @@ workflows:
- test-integration-query:
requires:
- install-dependencies
- test-integration-mutation:
- test-integration-mutation1:
requires:
- install-dependencies
- test-integration-mutation2:
requires:
- install-dependencies
- release:
Expand Down
5 changes: 3 additions & 2 deletions apps/reaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@
"test:integration:watch": "node node_modules/jest/bin/jest --runInBand --watch --testPathIgnorePatterns '<rootDir>/src/'",
"test:integration:file": "jest --runInBand",
"test:integration:file:watch": "jest --runInBand --watch",
"test:integration:query": "node --max-old-space-size=12288 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/mutations/'",
"test:integration:mutation": "node --max_old_space_size=12288 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/queries/'",
"test:integration:query": "node --max-old-space-size=12288 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/mutations1/' '<rootDir>/tests/integration/api/mutations2/'",
"test:integration:mutation1": "node --max_old_space_size=12288 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/queries/' '<rootDir>/tests/integration/api/mutations2/'",
"test:integration:mutation2": "node --max_old_space_size=12288 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/queries/' '<rootDir>/tests/integration/api/mutations1/'",
"lint": "eslint .",
"lint:gql": "graphql-schema-linter ./src/**/*.graphql",
"version": "echo $npm_package_version",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build:packages": "pnpm -r run build",
"test": "pnpm -r run test",
"test:integration:query": "pnpm --filter 'reaction' test:integration:query",
"test:integration:mutation": "pnpm --filter 'reaction' test:integration:mutation",
"test:integration:mutation1": "pnpm --filter 'reaction' test:integration:mutation1",
"test:integration:mutation2": "pnpm --filter 'reaction' test:integration:mutation2",
"lint": "eslint -c .eslintrc.cjs .",
"lint:docker": "npx --quiet --package @reactioncommerce/[email protected] lint-dockerfiles --workspace=apps/reaction",
"lint:gql": "pnpm -r run lint:gql",
Expand Down

0 comments on commit 6c787e8

Please sign in to comment.