Skip to content

Commit 318a178

Browse files
committed
chore(tests): update test commands and vitest version across workflows
- Added `--passWithNoTests` flag to internal, package, and webapp unit test commands to allow tests to pass even if no tests are found. - Upgraded `vitest` version from `3.1.4` to `4.1.7` in the report merging step for all workflows. - Updated TypeScript configuration in `sdk-compat-tests` to include `node` types alongside `vitest/globals`.
1 parent c0338c2 commit 318a178

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/unit-tests-internal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Internal Unit Tests
99-
run: pnpm run test:internal --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:internal --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100

101101
- name: Gather all reports
102102
if: ${{ !cancelled() }}
@@ -145,4 +145,4 @@ jobs:
145145
merge-multiple: true
146146

147147
- name: Merge reports
148-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
148+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

.github/workflows/unit-tests-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Package Unit Tests
99-
run: pnpm run test:packages --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:packages --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100

101101
- name: Gather all reports
102102
if: ${{ !cancelled() }}
@@ -145,4 +145,4 @@ jobs:
145145
merge-multiple: true
146146

147147
- name: Merge reports
148-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
148+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

.github/workflows/unit-tests-webapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Webapp Unit Tests
99-
run: pnpm run test:webapp --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:webapp --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100
env:
101101
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
102102
DIRECT_URL: postgresql://postgres:postgres@localhost:5432/postgres
@@ -153,4 +153,4 @@ jobs:
153153
merge-multiple: true
154154

155155
- name: Merge reports
156-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
156+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

internal-packages/sdk-compat-tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"declaration": false,
1010
"outDir": "dist",
1111
"rootDir": "src",
12-
"types": ["vitest/globals"]
12+
"types": ["vitest/globals", "node"]
1313
},
1414
"include": ["src/**/*.ts"],
1515
"exclude": ["node_modules", "dist", "src/fixtures"]

packages/cli-v3/e2e/e2e.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,17 @@ describe.concurrent("buildWorker", async () => {
104104

105105
for (let testCase of testCases) {
106106
test.extend<E2EFixtureTest>({
107+
// Seed `workspaceRelativeDir` before the spread so the key always exists.
108+
// vitest 4 resolves fixture-to-fixture dependencies strictly at
109+
// `test.extend()` time: the `workspaceDir` fixture below destructures
110+
// `workspaceRelativeDir`, so it must be a defined fixture even for test
111+
// cases that don't set it (it's an optional `TestCase` field). The spread
112+
// overrides this default when the case provides its own value.
113+
workspaceRelativeDir: "",
107114
...testCase,
108115
fixtureDir: async ({ id }, use) =>
109116
await use(path.resolve(path.join(process.cwd(), "e2e/fixtures", id))),
110-
workspaceDir: async ({ fixtureDir, workspaceRelativeDir = "" }, use) =>
117+
workspaceDir: async ({ fixtureDir, workspaceRelativeDir }, use) =>
111118
await use(path.resolve(path.join(fixtureDir, workspaceRelativeDir))),
112119
packageManager: async ({ workspaceDir }, use) =>
113120
await use(await parsePackageManager(options.packageManager, workspaceDir)),

0 commit comments

Comments
 (0)