Skip to content

Commit 4f87998

Browse files
committed
Split hereby test:all
1 parent 5bcf558 commit 4f87998

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,21 @@ jobs:
9292

9393
- name: Tests
9494
id: test
95-
run: npx hereby test:all ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
95+
run: npx hereby test ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
96+
env:
97+
RACE_FLAG: ${{ (matrix.race && '--race') || '' }}
98+
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
99+
CONCURRENTTESTPROGRAM_FLAG: ${{ (matrix.concurrent-test-program && '--concurrentTestPrograms') || '' }}
100+
101+
- name: API Tests
102+
run: npx hereby test:api ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
103+
env:
104+
RACE_FLAG: ${{ (matrix.race && '--race') || '' }}
105+
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
106+
CONCURRENTTESTPROGRAM_FLAG: ${{ (matrix.concurrent-test-program && '--concurrentTestPrograms') || '' }}
107+
108+
- name: Benchmarks
109+
run: npx hereby test:benchmarks ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
96110
env:
97111
RACE_FLAG: ${{ (matrix.race && '--race') || '' }}
98112
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}

Herebyfile.mjs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ async function runTestTools() {
267267
await $test({ cwd: path.join(__dirname, "_tools") })`${gotestsum()} ./...`;
268268
}
269269

270-
async function runTestJS() {
270+
async function runTestAPI() {
271271
await $`npm run -w @typescript/api test`;
272272
}
273273

@@ -276,29 +276,17 @@ export const testTools = task({
276276
run: runTestTools,
277277
});
278278

279-
export const buildJSTest = task({
280-
name: "build:js:test",
279+
export const buildAPITests = task({
280+
name: "build:api:test",
281281
run: async () => {
282282
await $`npm run -w @typescript/api build:test`;
283283
},
284284
});
285285

286-
export const testJS = task({
287-
name: "test:js",
288-
dependencies: [tsgo, buildJSTest],
289-
run: runTestJS,
290-
});
291-
292-
export const testAll = task({
293-
name: "test:all",
294-
dependencies: [tsgo, buildJSTest],
295-
run: async () => {
296-
// Prevent interleaving by running these directly instead of in parallel.
297-
await runTests();
298-
await runTestBenchmarks();
299-
await runTestTools();
300-
await runTestJS();
301-
},
286+
export const testAPI = task({
287+
name: "test:api",
288+
dependencies: [tsgo, buildAPITests],
289+
run: runTestAPI,
302290
});
303291

304292
const customLinterPath = "./_tools/custom-gcl";

_packages/api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"scripts": {
3939
"build": "tsc -b",
4040
"build:test": "tsc -b test",
41+
"build:bench": "tsc -b bench",
4142
"bench": "node --experimental-strip-types --no-warnings --conditions @typescript/source bench/api.bench.ts",
4243
"test": "node --test --experimental-strip-types --no-warnings --conditions @typescript/source ./test/**/*.test.ts"
4344
},

0 commit comments

Comments
 (0)