Skip to content

Commit 5c2e7e0

Browse files
ci adjustments (#1120)
Co-authored-by: Victor Carvajal <[email protected]>
1 parent 57a3bda commit 5c2e7e0

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ jobs:
384384
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
385385

386386
- name: Run Module Mode Tests
387-
run: SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js --ci --skip-setup --module-mode${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.profile == 'weval' && ' --aot' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
387+
run: SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js --ci --module-mode${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.profile == 'weval' && ' --aot' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
388388
env:
389389
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
390390

@@ -451,6 +451,6 @@ jobs:
451451
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
452452

453453
- name: Run Module Mode Tests
454-
run: SUFFIX_STRING=debug node integration-tests/js-compute/test.js --ci --skip-setup --module-mode --debug-build${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
454+
run: SUFFIX_STRING=debug node integration-tests/js-compute/test.js --ci --module-mode --debug-build${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
455455
env:
456456
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

integration-tests/js-compute/fixtures/module-mode/src/kv-store.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,9 @@ const debug = sdkVersion.endsWith('-debug');
13921392
routes.set('/kv-store-options/gen', async () => {
13931393
let store = new KVStore(KV_STORE_NAME);
13941394
let key = `entry-options`;
1395-
await store.put(key, 'body op', { gen: 2 });
1395+
await store.put(key, 'body op', {
1396+
gen: 2,
1397+
});
13961398
let entry = await store.get(key);
13971399
let result = entry.body;
13981400
strictEqual(

integration-tests/js-compute/fixtures/module-mode/tests.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@
402402
"GET /kv-store-entry/json/valid": { "flake": true },
403403
"GET /kv-store-entry/json/invalid": { "flake": true },
404404
"GET /kv-store-entry/arrayBuffer/valid": { "flake": true },
405-
"GET /kv-store-options/gen": { "flake": true },
405+
"GET /kv-store-options/gen": {
406+
"skip": true,
407+
"flake": true
408+
},
406409
"GET /kv-store-options/gen-invalid": { "flake": true },
407410
"GET /kv-store-entry/body": { "flake": true },
408411
"GET /kv-store-entry/bodyUsed": { "flake": true },

integration-tests/js-compute/setup.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,11 @@ async function setupKVStore() {
113113
async function setupSecretStore() {
114114
let stores = await (async function () {
115115
try {
116-
res = JSON.parse(
116+
return JSON.parse(
117117
await zx`fastly secret-store list --quiet --json --token $FASTLY_API_TOKEN`,
118118
);
119-
if (res == null) {
120-
return [];
121-
} else {
122-
return res;
123-
}
124-
} catch {
125-
return [];
119+
} catch (e) {
120+
throw e;
126121
}
127122
})();
128123
const STORE_ID = existingStoreId(stores, SECRET_STORE_NAME);

integration-tests/js-compute/test.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const httpCache = args.includes('--http-cache');
4545
const aot = args.includes('--aot');
4646
const debugBuild = args.includes('--debug-build');
4747
const debugLog = args.includes('--debug-log');
48+
const skipSetup = args.includes('--skip-setup');
49+
const skipTeardown = args.includes('--skip-teardown');
4850
const filter = args.filter((arg) => !arg.startsWith('--'));
4951
const bail = args.includes('--bail');
5052
const ci = args.includes('--ci');
@@ -185,7 +187,7 @@ const [{ default: tests }] = await Promise.all([
185187
);
186188
})(),
187189
(async () => {
188-
if (!local) {
190+
if (!local && !skipSetup) {
189191
const setupPath = join(__dirname, 'setup.js');
190192
if (existsSync(setupPath)) {
191193
await zx`node ${setupPath} ${serviceId} ${ci ? serviceName : ''}`;
@@ -428,13 +430,10 @@ if (failed.length) {
428430
}
429431

430432
if (!local && failed.length) {
431-
core.notice(`Tests failed, the service is named "${serviceName}"`);
432-
if (domain) {
433-
core.notice(`You can debug the service on ${domain}`);
434-
}
433+
core.notice(`Tests failed.`);
435434
}
436435

437-
if (!local && !failed.length) {
436+
if ((!local && !skipTeardown) || failed.length > 0) {
438437
const teardownPath = join(fixturePath, 'teardown.js');
439438
if (existsSync(teardownPath)) {
440439
core.startGroup('Tear down the extra set-up for the service');

0 commit comments

Comments
 (0)