diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

build: show specifics of test failures in github checks

Open keturn opened this issue 1 year ago • 8 comments

This uses https://github.com/marketplace/actions/junit-report-action so that the specifics of failed tests will be more visible in the GitHub UI, instead of just "process completed with exit code 1."

  • [ ] a report action should be showing up in https://github.com/huggingface/diffusers/actions
  • [ ] do the reports from pr_tests and push_tests need to be uploaded under different names?

keturn avatar Sep 14 '22 19:09 keturn

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Hmm. It successfully uploaded the junit.xml written by pytest. But I don't see any sign that it ran the test_report action.

I don't really know how GitHub Actions works. Do I need to organize the yaml differently? Or do the project's owners need to authorize the use of those third-party Actions?

keturn avatar Sep 14 '22 19:09 keturn

@anton-l could you take a look here?

patrickvonplaten avatar Sep 16 '22 17:09 patrickvonplaten

Hi @keturn, sorry for the late response! We have custom detailed test reports in the GH actions artifacts now: https://github.com/huggingface/diffusers/actions/runs/3100888450 Would those solve your issue?

anton-l avatar Sep 27 '22 13:09 anton-l

The test report artifacts are a means to an end. The goal is to have the reports formatted in a convenient way on the build or the PR.

either as inline annotations, as in this example from junit-report-action:

annotated.png

or some kind of tabular or drill-down format as we'd see with buildbot or jenkins.

Is there any such thing currently? I didn't see any on the run you linked, but I'm not sure if that's because I was looking in the wrong place or maybe there were just no failures on that run to report.

keturn avatar Sep 27 '22 17:09 keturn

Currently we only see easily what test failed: https://github.com/huggingface/diffusers/actions/runs/3100888450/jobs/5021661934#step:7:926 but indeed we don't have any specifics. I'd very much welcome a PR that makes this user experience nicer! I currently don't have the time to dig deeper into what exists though.

patrickvonplaten avatar Sep 29 '22 17:09 patrickvonplaten

This likely depends on what settings you have for which actions may run: https://github.com/huggingface/diffusers/settings/actions

It depends on

  • https://github.com/mikepenz/action-junit-report
  • https://github.com/dawidd6/action-download-artifact neither of which seem to fall under the category of "Marketplace verified creator," so you'll need to either allow All Actions or add those to the approved list.

In addition, it needs to be running with a token with write permission to make the annotations, which is why it has a separate action instead of being included as additional steps in the pr_tests action. https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token

(and could also explain why it doesn't run when I push to this PR, because presumably I can't just make PRs that run arbitrary code with repository write access.)

keturn avatar Oct 03 '22 22:10 keturn

@anton-l I let you handle this one :-)

patrickvonplaten avatar Oct 04 '22 13:10 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Oct 28 '22 15:10 github-actions[bot]

I think this is still actionable, stale-bot.

keturn avatar Oct 28 '22 15:10 keturn

@keturn looks like pytest annotations aren't as inline as java ones, just a list of errors. Example from another repo, as github disables the annotation API for PRs from forks: https://github.com/agdsn/pycroft/actions/runs/3138025002/jobs/5096982313 PR annotation issue: https://github.com/mikepenz/action-junit-report/issues/23

Another alternative could be this plugin, but I haven't looked into what it does under the hood yet: https://github.com/utgwkk/pytest-github-actions-annotate-failures

anton-l avatar Oct 29 '22 17:10 anton-l

an HTML-formatted list of test names and their failure messages (with a clear link to it and not buried in a thousand lines of build output) is pretty much what I was going for.

though the format as shown in that pycroft example is a terrible way to present that information, as annotations all on line 1 of something that's not actually a file. Each failure is in its own box 200px tall to convey a single line of information. :weary:

keturn avatar Oct 29 '22 18:10 keturn

Exactly! That pytest plugin that I've linked actually formats the errors inline, but I wonder if it can annotate PR tests too. Seems that github doesn't like API calls from workflows triggered by a fork for security reasons, and the JUnit reporter is limited by that.

anton-l avatar Oct 29 '22 19:10 anton-l