test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

New generated reports appear under an old run

Open AyoubIssaad opened this issue 2 years ago • 10 comments

Describe the bug

When I first added this action, and run the workflow manually (run_number 300 - screenshot1) everything worked fine and the report was generated on the same run summary page.

Screenshot1: image

But when I run the same workflow again multiple times WITHOUT COMMITING NEW CHANGES to the repo (run_number 301), the action runs successfuly but the generated reports doesn't appear on the corresponding run summary page.

Screenshot2: image

After checking, I found out that all newly generated reports are being added to the first run page (number 300) as you can see in the following screenshot.

Screenshot3: image

But again, if I push new commits to the repo with very minimal change (adding a blank line), and run the workflow, the issue is resolved for that specific run and the generated report appears where it's supposed to: image

To Reproduce

Steps to reproduce the behavior:

  1. Run the workflows manually and wait until the report is generated.
  2. Without commiting any new changes to the repo, run the workflow again manually
  3. After the job has finished, the report shouldn't appear on the latest run (step 2) but on the previous one from step 1.

Expected behavior

Each generated report should appear on the corresponding run summary page

Additional context

  • Using version 1.8.0
  • All runs are being triggered manually (workflow_dispatch)

AyoubIssaad avatar Feb 27 '24 10:02 AyoubIssaad

I think this is related to the check run creation function, seems like the checks.create takes as an argument the commit sha, and there is no way to specify the run_id (not sure though)

image

In an ideal world, there is no need to retest if there was no new changes to the code, but in the real world, I think a lot of us rerun tests esecially when there are fialed tests and a lot of times the tests succeed after that, it would be better if one can check the report on the same run summary

AyoubIssaad avatar Feb 27 '24 15:02 AyoubIssaad

Related to #367 ?

timabell-gnf1 avatar Mar 01 '24 16:03 timabell-gnf1

Related to #367 ?

Not sure tbh, on the other issue, the report seems to be generated under the "CodeQL section" as reported by some, and I don't know what's that, in my case the reports are generated under an old run.

AyoubIssaad avatar Mar 05 '24 13:03 AyoubIssaad

I have experienced a similar issue.

When a trigger starts multiple workflows, the report checks appear under the workflow that runs first rather than the workflow to which the checks belong.

CleanShot 2024-03-14 at 10 49 16

henrydobson avatar Mar 14 '24 10:03 henrydobson

I have experienced this issue including when I demoed this tool at NDC Sydney. Looking forward to a fix when you have a moment.

robrich avatar Mar 17 '24 04:03 robrich

I am also having this exact issue

ryan-cubic avatar Mar 19 '24 19:03 ryan-cubic

Would be nice to get this fixed, the report ends up in an unrelated workflow run.

rhuitl avatar Mar 25 '24 14:03 rhuitl

https://github.com/EnricoMi/publish-unit-test-result-action/issues/12 has an identical issue and suggests it's caused by https://github.com/orgs/community/discussions/24616.

robrich avatar Apr 02 '24 18:04 robrich

+1 - Just added the action today and it is exactly what I was looking for, thank you! Same behavior, the job/Test Report is added to workflow based on commit number instead of the workflow run number.

Our team's preference is for the job/Test Report to be added to the current run number, regardless of commit.

CRohm42 avatar Apr 24 '24 18:04 CRohm42

I can confirm we see test results appear randomly in other build steps or jobs.

jozefizso avatar May 08 '24 10:05 jozefizso