Skip to content

Commit 3f84c75

Browse files
authored
test(scripts): skip preview legacy:e2e tests if client is not found (#6576)
1 parent 9e92f06 commit 3f84c75

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/e2e-legacy/preview.mjs

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ const __dirname = getDirName();
1111
const execOptions = { ...process, cwd: __dirname, encoding: "utf-8" };
1212
const commitsSinceOriginHead = execSync(`git log --oneline origin/main..HEAD --format=%s`, execOptions).split("\n");
1313

14-
const updatedClients = new Set();
14+
const updatedClientsSet = new Set();
1515
for (const commitMessage of commitsSinceOriginHead) {
1616
const prefix = commitMessage.split(":")[0];
1717
const scope = prefix.substring(prefix.indexOf("(") + 1, prefix.indexOf(")"));
1818
if (scope && scope.startsWith("client-")) {
19-
updatedClients.add(`@aws-sdk/${scope}`);
19+
updatedClientsSet.add(`@aws-sdk/${scope}`);
2020
}
2121
}
22+
23+
const updatedClients = [...updatedClientsSet];
2224
console.info(`Updated packages: ${updatedClients}`);
2325

24-
if (updatedClients.size === 0) {
26+
if (updatedClients.length === 0) {
2527
console.info(`Couldn't find clients in commit messages:\n '${commitsSinceOriginHead.join("\n")}'`);
26-
process.exit(1);
28+
process.exit(0);
2729
}
2830

2931
const allTags = getAllTags();
30-
const changedPackageTags = getPackageTags([...updatedClients]);
32+
const changedPackageTags = getPackageTags(updatedClients);
3133
const tagsToTest = changedPackageTags.filter((tag) => allTags.includes(tag));
3234
runTestForTags(tagsToTest);

0 commit comments

Comments
 (0)