mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-15 01:52:54 +01:00
Fix rerunFlakyTests
This commit is contained in:
@@ -16,10 +16,7 @@ async function getFailedJobsForRun(github, context, workflowRunId, runAttempt) {
|
||||
});
|
||||
|
||||
return jobs
|
||||
.filter((job) => job.conclusion === "failure")
|
||||
.filter((job) =>
|
||||
CONSIDERED_JOBS.some((title) => job.name.startsWith(title))
|
||||
);
|
||||
.filter((job) => job.conclusion === "failure");
|
||||
}
|
||||
|
||||
export async function rerunFlakyTests({ github, context }) {
|
||||
@@ -35,12 +32,14 @@ export async function rerunFlakyTests({ github, context }) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (failingJobs.length === 0) {
|
||||
throw new Error(
|
||||
"rerunFlakyTests should not have run on a run with no failing jobs"
|
||||
);
|
||||
const filteredFailingJobs = failingJobs.filter((job) => CONSIDERED_JOBS.some((title) => job.name.startsWith(title)));
|
||||
if (filteredFailingJobs.length === 0) {
|
||||
console.log("Failing jobs are NOT designated flaky. Not rerunning.");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Rerunning job: ${filteredFailingJobs[0].name}`);
|
||||
|
||||
github.rest.actions.reRunWorkflowFailedJobs({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
||||
Reference in New Issue
Block a user