From 3adfcc29b831f6ce302a2831f46745c2ce1ad5dd Mon Sep 17 00:00:00 2001 From: Alberto Gualis Date: Thu, 23 Jan 2025 15:02:56 +0100 Subject: [PATCH] fix: turbo cache tests (#492) * fix: turbo mode for unit and integration tests --- .github/workflows/checks.yml | 8 +++++ package.json | 4 ++- packages/lib/package.json | 6 ++-- pnpm-lock.yaml | 58 ++++++++++++++++++------------------ turbo.json | 12 ++++++++ 5 files changed, 56 insertions(+), 32 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 49c250a65..7168ecd7a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -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 diff --git a/package.json b/package.json index 71be93cee..ab74cfa3b 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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": "pnpm@9.0.6", diff --git a/packages/lib/package.json b/packages/lib/package.json index edcdbfd53..f4579e228 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -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" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 061768638..d970fd1c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^5.0.2 version: 5.0.2(prettier@3.2.5)(stylelint@16.13.2(typescript@5.7.2)) turbo: - specifier: ^2.1.2 - version: 2.1.2 + specifier: 2.3.3 + version: 2.3.3 typescript: specifier: 5.7.2 version: 5.7.2 @@ -9626,38 +9626,38 @@ packages: tunnel-rat@0.1.2: resolution: {integrity: sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==} - turbo-darwin-64@2.1.2: - resolution: {integrity: sha512-3TEBxHWh99h2yIzkuIigMEOXt/ItYQp0aPiJjPd1xN4oDcsKK5AxiFKPH9pdtfIBzYsY59kQhZiFj0ELnSP7Bw==} + turbo-darwin-64@2.3.3: + resolution: {integrity: sha512-bxX82xe6du/3rPmm4aCC5RdEilIN99VUld4HkFQuw+mvFg6darNBuQxyWSHZTtc25XgYjQrjsV05888w1grpaA==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.1.2: - resolution: {integrity: sha512-he0miWNq2WxJzsH82jS2Z4MXpnkzn9SH8a79iPXiJkq25QREImucscM4RPasXm8wARp91pyysJMq6aasD45CeA==} + turbo-darwin-arm64@2.3.3: + resolution: {integrity: sha512-DYbQwa3NsAuWkCUYVzfOUBbSUBVQzH5HWUFy2Kgi3fGjIWVZOFk86ss+xsWu//rlEAfYwEmopigsPYSmW4X15A==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.1.2: - resolution: {integrity: sha512-fKUBcc0rK8Vdqv5a/E3CSpMBLG1bzwv+Q0Q83F8fG2ZfNCNKGbcEYABdonNZkkx141Rj03cZQFCgxu3MVEGU+A==} + turbo-linux-64@2.3.3: + resolution: {integrity: sha512-eHj9OIB0dFaP6BxB88jSuaCLsOQSYWBgmhy2ErCu6D2GG6xW3b6e2UWHl/1Ho9FsTg4uVgo4DB9wGsKa5erjUA==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.1.2: - resolution: {integrity: sha512-sV8Bpmm0WiuxgbhxymcC7wSsuxfBBieI98GegSwbr/bs1ANAgzCg93urIrdKdQ3/b31zZxQwcaP4FBF1wx1Qdg==} + turbo-linux-arm64@2.3.3: + resolution: {integrity: sha512-NmDE/NjZoDj1UWBhMtOPmqFLEBKhzGS61KObfrDEbXvU3lekwHeoPvAMfcovzswzch+kN2DrtbNIlz+/rp8OCg==} cpu: [arm64] os: [linux] - turbo-windows-64@2.1.2: - resolution: {integrity: sha512-wcmIJZI9ORT9ykHGliFE6kWRQrlH930QGSjSgWC8uFChFFuOyUlvC7ttcxuSvU9VqC7NF4C+GVAcFJQ8lTjN7g==} + turbo-windows-64@2.3.3: + resolution: {integrity: sha512-O2+BS4QqjK3dOERscXqv7N2GXNcqHr9hXumkMxDj/oGx9oCatIwnnwx34UmzodloSnJpgSqjl8iRWiY65SmYoQ==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.1.2: - resolution: {integrity: sha512-zdnXjrhk7YO6CP+Q5wPueEvOCLH4lDa6C4rrwiakcWcPgcQGbVozJlo4uaQ6awo8HLWQEvOwu84RkWTdLAc/Hw==} + turbo-windows-arm64@2.3.3: + resolution: {integrity: sha512-dW4ZK1r6XLPNYLIKjC4o87HxYidtRRcBeo/hZ9Wng2XM/MqqYkAyzJXJGgRMsc0MMEN9z4+ZIfnSNBrA0b08ag==} cpu: [arm64] os: [win32] - turbo@2.1.2: - resolution: {integrity: sha512-Jb0rbU4iHEVQ18An/YfakdIv9rKnd3zUfSE117EngrfWXFHo3RndVH96US3GsT8VHpwTncPePDBT2t06PaFLrw==} + turbo@2.3.3: + resolution: {integrity: sha512-DUHWQAcC8BTiUZDRzAYGvpSpGLiaOQPfYXlCieQbwUvmml/LRGIe3raKdrOPOoiX0DYlzxs2nH6BoWJoZrj8hA==} hasBin: true type-check@0.4.0: @@ -21797,32 +21797,32 @@ snapshots: - immer - react - turbo-darwin-64@2.1.2: + turbo-darwin-64@2.3.3: optional: true - turbo-darwin-arm64@2.1.2: + turbo-darwin-arm64@2.3.3: optional: true - turbo-linux-64@2.1.2: + turbo-linux-64@2.3.3: optional: true - turbo-linux-arm64@2.1.2: + turbo-linux-arm64@2.3.3: optional: true - turbo-windows-64@2.1.2: + turbo-windows-64@2.3.3: optional: true - turbo-windows-arm64@2.1.2: + turbo-windows-arm64@2.3.3: optional: true - turbo@2.1.2: + turbo@2.3.3: optionalDependencies: - turbo-darwin-64: 2.1.2 - turbo-darwin-arm64: 2.1.2 - turbo-linux-64: 2.1.2 - turbo-linux-arm64: 2.1.2 - turbo-windows-64: 2.1.2 - turbo-windows-arm64: 2.1.2 + turbo-darwin-64: 2.3.3 + turbo-darwin-arm64: 2.3.3 + turbo-linux-64: 2.3.3 + turbo-linux-arm64: 2.3.3 + turbo-windows-64: 2.3.3 + turbo-windows-arm64: 2.3.3 type-check@0.4.0: dependencies: diff --git a/turbo.json b/turbo.json index 581e15965..c54d5417d 100644 --- a/turbo.json +++ b/turbo.json @@ -21,6 +21,7 @@ "VERCEL_GIT_COMMIT_REF", "SENTRY_AUTH_TOKEN" ], + "globalPassThroughEnv": [], "tasks": { "dev": { "cache": false, @@ -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*"]