Skip to content

Commit

Permalink
ci adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Feb 14, 2025
1 parent c1cf1df commit a7055d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 3 additions & 8 deletions integration-tests/js-compute/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,11 @@ async function setupKVStore() {
async function setupSecretStore() {
let stores = await (async function () {
try {
res = JSON.parse(
return JSON.parse(
await zx`fastly secret-store list --quiet --json --token $FASTLY_API_TOKEN`,
);
if (res == null) {
return [];
} else {
return res;
}
} catch {
return [];
} catch (e) {
throw e;
}
})();
const STORE_ID = existingStoreId(stores, SECRET_STORE_NAME);
Expand Down
11 changes: 5 additions & 6 deletions integration-tests/js-compute/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const httpCache = args.includes('--http-cache');
const aot = args.includes('--aot');
const debugBuild = args.includes('--debug-build');
const debugLog = args.includes('--debug-log');
const skipSetup = args.includes('--skip-setup');
const skipTeardown = args.includes('--skip-setup');
const filter = args.filter((arg) => !arg.startsWith('--'));
const bail = args.includes('--bail');
const ci = args.includes('--ci');
Expand Down Expand Up @@ -185,7 +187,7 @@ const [{ default: tests }] = await Promise.all([
);
})(),
(async () => {
if (!local) {
if (!local && !skipSetup) {
const setupPath = join(__dirname, 'setup.js');
if (existsSync(setupPath)) {
await zx`node ${setupPath} ${serviceId} ${ci ? serviceName : ''}`;
Expand Down Expand Up @@ -428,13 +430,10 @@ if (failed.length) {
}

if (!local && failed.length) {
core.notice(`Tests failed, the service is named "${serviceName}"`);
if (domain) {
core.notice(`You can debug the service on ${domain}`);
}
core.notice(`Tests failed.`);
}

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

0 comments on commit a7055d6

Please sign in to comment.