Check Run Appears Under Wrong Workflow Run When Test Runner is Run Twice on the Same Commit
trudeaua21 opened this issue · 0 comments
Bug description
If you run the test runner multiple times on the same commit, the Check Run with the test results seems to only populate under the first workflow run for that commit.
Please observe the below images which describe the problem in more detail.
There are 3 workflow runs - 73, 74, and 75, all of which were run on the same commit, d3665f3. 73 and 75 were run on the branch `main`, whereas 74 was run on the branch `test-unity-test-runner-check-run`.Neither workflow run 74 nor 75 have the "Test Results" Check Run.
3 "Test Results" Check Runs for Workflow Runs 73, 74, and 75 have all populated within the jobs for Workflow Run 73.
How to reproduce
- Make a workflow file using the test runner which provides the
githubToken
input to ensure that the test results check run will show up. - Using a
workflow_dispatch
trigger (other triggers are fine, this will make it easier though), run a workflow file which runs the test runner (resulting in a workflow run that we'll callworkflow run #1
). - Observe that the
Test Results
check run shows up properly forworkflow run #1
- Manually run the workflow file on that same branch again (not a re-trigger of
workflow run #1
, but a new run of the workflow file, resulting inworkflow run #2
). - Observe that the
Test Results
check run has not shown up properly forworkflow run #2
, and that there are now 2 separateTest Results
check runs underworkflow run #1
.
4a. Alternatively, after step 3, you could also trigger the bug by making a branch off of the branch you ran the workflow file on in step 2, then running the workflow file on the new branch (only if the new branch is still on the same commit as the base branch).
Expected behavior
Whenever the test runner is run (even if the test runner is being run on the same commit but in a different workflow run), the Check Run with the test results should appear in the workflow run where the tests were run (rather than in the first workflow run for a given commit).
Additional details
This may or may not be fixable - a cursory Google search of the problem led me to this issue, which may or may not be talking about the same problem. I'm a bit too unfamiliar with the inner workings of the Check Run mechanism to determine whether or not it their findings apply here, so I figured I'd open an issue just in case anyone else runs into this problem.