Skip to content

Commit

Permalink
ci(workflow): print passed test lists for daily (#5997)
Browse files Browse the repository at this point in the history
### Description

Print out passed test suite end of the action run, so we can easily grab
& compare for the postprocessing.

Closes WEB-1627
  • Loading branch information
kwonoj committed Sep 21, 2023
1 parent 91e9961 commit 00aa2db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/next-integration-stat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16819,6 +16819,7 @@
: yield getTestResultDiffBase(octokit, shouldDiffWithMain);
const postCommentAsync = createCommentPostAsync(octokit, prNumber);
const failedTestLists = [];
const passedTestsLists = [];
// Collect failed test results for each job. We don't use this actively yet.
const perJobFailedLists = {};
// Consturct a comment body to post test report with summary & full details.
Expand Down Expand Up @@ -16879,6 +16880,8 @@
}
perJobFailedLists[value.job].push(failedTest);
}
} else {
passedTestsLists.push(test.name);
}
}
if (hasFailedTest) commentValues.push(`\n`);
Expand Down Expand Up @@ -16953,6 +16956,10 @@
2
)
);
fs.writeFileSync(
"./passed-test-path-list.json",
JSON.stringify(passedTestsLists, null, 2)
);
if (!prNumber) {
return;
}
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/next-integration-stat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ async function run() {
const postCommentAsync = createCommentPostAsync(octokit, prNumber);

const failedTestLists = [];
const passedTestsLists = [];
// Collect failed test results for each job. We don't use this actively yet.
const perJobFailedLists = {};

Expand Down Expand Up @@ -980,6 +981,8 @@ async function run() {
}
perJobFailedLists[value.job].push(failedTest);
}
} else {
passedTestsLists.push(test.name);
}
}
if (hasFailedTest) commentValues.push(`\n`);
Expand Down Expand Up @@ -1061,6 +1064,11 @@ async function run() {
)
);

fs.writeFileSync(
"./passed-test-path-list.json",
JSON.stringify(passedTestsLists, null, 2)
);

if (!prNumber) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nextjs-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ jobs:
path: |
nextjs-test-results.json
failed-test-path-list.json
passed-test-path-list.json
slack-payload.json
upload_test_trace:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upload-nextjs-integration-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
ls -al ./test-results/main
echo "Print failed test path list:"
cat ./test-results/main/failed-test-path-list.json
echo "Print passed test path list:"
cat ./test-results/main/passed-test-path-list.json
echo "NEXTJS_VERSION=$(cat ./test-results/main/nextjs-test-results.json | jq .nextjsVersion | tr -d '"' | cut -d ' ' -f2)" >> $GITHUB_ENV
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "RESULT_SUBPATH=$(if ${{ inputs.is_main_branch }}; then echo 'main'; else echo ${{ env.NEXTJS_VERSION }}; fi)" >> $GITHUB_ENV
Expand Down

0 comments on commit 00aa2db

Please sign in to comment.