Skip to content

Commit

Permalink
fix: turbo cache tests (#492)
Browse files Browse the repository at this point in the history
* fix: turbo mode for unit and integration tests
  • Loading branch information
agualis authored Jan 23, 2025
1 parent 7c7246c commit 3adfcc2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 32 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
run: pnpm typecheck
- name: Run unit tests
run: pnpm test:unit
# Uncomment to debug turborepo summary when running with --summarize option
# Context: https://turbo.build/repo/docs/crafting-your-repository/caching#using-run-summaries
# - uses: actions/upload-artifact@v4
# with:
# name: unit-turbo-summary
# path: |
# ./.turbo/runs/
# retention-days: 30

Integration-Test:
runs-on: macos-14
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"test:e2e": "turbo test:e2e --ui=stream --log-order=stream --",
"test:e2e:ui": "turbo test:e2e:ui --ui=stream --log-order=stream --",
"test:integration": "turbo test:integration --ui=stream --log-order=stream --",
"test:integration:watch": "turbo test:integration:watch --ui=stream --log-order=stream --",
"test:unit": "turbo test:unit --ui=stream --log-order=stream --",
"test:unit:watch": "turbo test:unit:watch --ui=stream --log-order=stream --",
"typecheck": "turbo typecheck",
"prepare": "husky"
},
Expand All @@ -34,7 +36,7 @@
"stylelint": "^16.13.2",
"stylelint-config-standard": "^36.0.1",
"stylelint-prettier": "^5.0.2",
"turbo": "^2.1.2",
"turbo": "2.3.3",
"typescript": "5.7.2"
},
"packageManager": "[email protected]",
Expand Down
6 changes: 4 additions & 2 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"stylelint": "stylelint '**/*.css'",
"stylelint:fix": "stylelint '**/*.css' --fix",
"test": "pnpm test:unit & pnpm run test:integration",
"test:integration": "vitest -c ./vitest.config.integration.ts",
"test:unit": "vitest",
"test:integration": "vitest run -c ./vitest.config.integration.ts",
"test:integration:watch": "vitest -c ./vitest.config.integration.ts",
"test:unit": "vitest run",
"test:unit:watch": "vitest",
"test:unit:coverage": "vitest --coverage",
"test:unit:silent:coverage": "SILENT_TESTS=true vitest --coverage",
"typecheck": "tsc --project tsconfig.json --noEmit --incremental"
Expand Down
58 changes: 29 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"VERCEL_GIT_COMMIT_REF",
"SENTRY_AUTH_TOKEN"
],
"globalPassThroughEnv": [],
"tasks": {
"dev": {
"cache": false,
Expand Down Expand Up @@ -62,10 +63,21 @@
"test:unit": {
"dependsOn": ["^graphql:gen", "^test:unit"]
},
"test:unit:watch": {
"cache": false,
"persistent": true,
"dependsOn": ["^graphql:gen", "^test:unit"]
},
"test:integration": {
"dependsOn": ["^graphql:gen", "^test:integration"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
},
"test:integration:watch": {
"cache": false,
"persistent": true,
"dependsOn": ["^graphql:gen", "^test:integration"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
},
"test:e2e": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
Expand Down

0 comments on commit 3adfcc2

Please sign in to comment.