Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 22, 2025
1 parent 261a14e commit 54e6fc8
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions integration-tests/js-compute/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ for (const chunk of chunks(Object.entries(tests), 100)) {
title,
test,
skipped: true,
skipReason: null, // dont mention filtered tests
};
}
// feature based test filtering
Expand All @@ -232,6 +233,7 @@ for (const chunk of chunks(Object.entries(tests), 100)) {
title,
test,
skipped: true,
skipReason: `feature "http-cache" ${httpCache ? '' : 'not '}"enabled`,
};
}
async function getBodyChunks(response) {
Expand Down Expand Up @@ -308,13 +310,14 @@ for (const chunk of chunks(Object.entries(tests), 100)) {
title,
test,
skipped: true,
skipReason: 'no environments',
};
}
} else {
if (test.environments.includes('compute')) {
return retry(
test.flake ? 10 : bail ? 1 : 4,
expBackoff(test.flake ? '60s' : '30s', test.flake ? '10s' : '1s'),
test.flake ? 15 : bail ? 1 : 4,
expBackoff(test.flake ? '60s' : '30s', test.flake ? '30s' : '1s'),
async () => {
let path = test.downstream_request.pathname;
let url = `${domain}${path}`;
Expand Down Expand Up @@ -346,6 +349,7 @@ for (const chunk of chunks(Object.entries(tests), 100)) {
title,
test,
skipped: true,
skipReason: 'no environments',
};
}
}
Expand All @@ -370,36 +374,13 @@ for (const result of results) {
if (result.status === 'fulfilled') {
passed += 1;
if (result.value.skipped) {
if (
filter.length > 0 &&
filter.every((f) => !result.value.title.includes(f))
) {
// console.log(white, info, `Skipped by test filter: ${result.value.title}`, reset);
} else if (local && !result.value.test.environments.includes('viceroy')) {
if (result.value.skipReason)
console.log(
white,
info,
`Skipped as test marked to only run on Fastly Compute: ${result.value.title}`,
`Skipped ${result.value.title} due to ${result.value.skipReason}`,
reset,
);
} else if (
!local &&
!result.value.test.environments.includes('compute')
) {
console.log(
white,
info,
`Skipped as test marked to only run on local server: ${result.value.title}`,
reset,
);
} else {
console.log(
white,
info,
`Skipped due to no environments set: ${result.value.title}`,
reset,
);
}
} else {
console.log(green, tick, result.value.title, reset);
}
Expand Down

0 comments on commit 54e6fc8

Please sign in to comment.