Skip to content

Commit 2a591f1

Browse files
committed
Added flag to identify if test passed
1 parent 157ac51 commit 2a591f1

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

test/integration/issue_comment_trigger.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import {testClient} from "../client/client";
55

66
describe("Trigger Junie in Issue Comment", () => {
77
let repoName: string;
8+
let testPassed = false;
89

910
beforeAll(async () => {
1011
repoName = await testClient.createTestRepo();
1112
await testClient.setupWorkflow(repoName);
1213
});
1314

1415
afterAll(async () => {
15-
if (repoName) {
16+
if (repoName && testPassed) {
1617
await testClient.deleteTestRepo(repoName);
18+
} else if (repoName) {
19+
console.log(`⚠️ Keeping failed test repo: ${e2eConfig.org}/${repoName}`);
1720
}
1821
});
1922

@@ -44,5 +47,7 @@ describe("Trigger Junie in Issue Comment", () => {
4447
});
4548

4649
await testClient.waitForJunieComment(issueNumber, SUCCESS_FEEDBACK_COMMENT);
50+
51+
testPassed = true;
4752
}, 900000);
4853
});

test/integration/issue_trigger.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import { testClient } from "../client/client";
55

66
describe("Trigger Junie in Issue", () => {
77
let repoName: string;
8+
let testPassed = false;
89

910
beforeAll(async () => {
1011
repoName = await testClient.createTestRepo();
1112
await testClient.setupWorkflow(repoName);
1213
});
1314

1415
afterAll(async () => {
15-
if (repoName) {
16+
if (repoName && testPassed) {
1617
await testClient.deleteTestRepo(repoName);
18+
} else if (repoName) {
19+
console.log(`⚠️ Keeping failed test repo: ${e2eConfig.org}/${repoName}`);
1720
}
1821
});
1922

@@ -38,5 +41,6 @@ describe("Trigger Junie in Issue", () => {
3841
await testClient.waitForPR(testClient.conditionIncludes(titleKeywords), {[functionFile]: `def ${functionName}:`, [requirementsFile]: ``});
3942

4043
await testClient.waitForJunieComment(issueNumber, SUCCESS_FEEDBACK_COMMENT);
44+
testPassed = true;
4145
}, 900000);
4246
});

test/integration/pr_comment_trigger.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import {testClient} from "../client/client";
55

66
describe("Trigger Junie in PR comment", () => {
77
let repoName: string;
8+
let testPassed = false;
89

910
beforeAll(async () => {
1011
repoName = await testClient.createTestRepo();
1112
await testClient.setupWorkflow(repoName);
1213
});
1314

1415
afterAll(async () => {
15-
if (repoName) {
16+
if (repoName && testPassed) {
1617
await testClient.deleteTestRepo(repoName);
18+
} else if (repoName) {
19+
console.log(`⚠️ Keeping failed test repo: ${e2eConfig.org}/${repoName}`);
1720
}
1821
});
1922

@@ -52,5 +55,6 @@ describe("Trigger Junie in PR comment", () => {
5255
await testClient.waitForPRUpdate(prNumber, {[filename]: "zero", ["README.md"]: ""}, fileCount);
5356

5457
await testClient.waitForJunieComment(prNumber, SUCCESS_FEEDBACK_COMMENT);
58+
testPassed = true;
5559
}, 900000);
5660
});

0 commit comments

Comments
 (0)