Skip to content

Commit a7055d6

Browse files
author
Guy Bedford
committed
ci adjustments
1 parent c1cf1df commit a7055d6

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

integration-tests/js-compute/setup.js

Lines changed: 3 additions & 8 deletions
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

Lines changed: 5 additions & 6 deletions
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-setup');
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)