Skip to content

Commit 4bb3d04

Browse files
committed
test(components): use local fixture tarballs instead of GitHub URLs for template packages
This drastically reduces the time it takes for 'npm pack' to run during integration testing on Windows CI runners, which was occasionally taking > 5 minutes and causing the test suite to timeout.
1 parent ed705fb commit 4bb3d04

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

integrationTests/components/early-hints.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
* conversion, empty hints handling, and response length limits.
77
*/
88
import { suite, test, before, after } from 'node:test';
9-
import { strictEqual, ok, match, deepStrictEqual } from 'node:assert/strict';
9+
import { strictEqual, ok, deepStrictEqual, match } from 'node:assert/strict';
10+
import { join, dirname } from 'node:path';
11+
import { fileURLToPath } from 'node:url';
12+
13+
const __dirname = dirname(fileURLToPath(import.meta.url));
1014

1115
import { startHarper, teardownHarper, sendOperation, type ContextWithHarper } from '@harperfast/integration-testing';
1216

@@ -19,7 +23,7 @@ suite('Component: early-hints', (ctx: ContextWithHarper) => {
1923
const deployBody = await sendOperation(ctx.harper, {
2024
operation: 'deploy_component',
2125
project: 'early-hints',
22-
package: 'https://github.com/ldt1996/template-early-hints',
26+
package: join(__dirname, '../fixtures/template-early-hints-2.0.0.tgz'),
2327
restart: true,
2428
});
2529
deepStrictEqual(deployBody, { message: 'Successfully deployed: early-hints, restarting Harper' });

integrationTests/components/redirector.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*/
88
import { suite, test, before, after } from 'node:test';
99
import { strictEqual, ok, deepStrictEqual } from 'node:assert/strict';
10+
import { join, dirname } from 'node:path';
11+
import { fileURLToPath } from 'node:url';
12+
13+
const __dirname = dirname(fileURLToPath(import.meta.url));
1014

1115
import { startHarper, teardownHarper, sendOperation, type ContextWithHarper } from '@harperfast/integration-testing';
1216

@@ -34,7 +38,7 @@ suite('Component: redirector', (ctx: ContextWithHarper) => {
3438
const deployBody = await sendOperation(ctx.harper, {
3539
operation: 'deploy_component',
3640
project: 'redirector',
37-
package: 'https://github.com/HarperFast/template-redirector',
41+
package: join(__dirname, '../fixtures/template-redirector-3.0.1.tgz'),
3842
restart: true,
3943
});
4044
deepStrictEqual(deployBody, { message: 'Successfully deployed: redirector, restarting Harper' });
9.63 KB
Binary file not shown.
28.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)