New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide link to failing test and line in annotations #35
Comments
I see the following issues here:
|
The annotations API has exactly that limitation as it only shows the annotation in the Changes tab so only modified failing tests show the annotation. The propose links (see PR description) have the advantage that they reference the commit, not the changes, so they are able to show the content no matter if tests are part of the changes. |
Looks like Github can show annotations done to unchanged files (Beta): |
Yeah, I've seen that too! It looks amazing. What do I need to do to get the annotations for JUnit? I don't remember seeing it for tests yet. Edit: might be #452 |
In general, two things are needed:
|
JUnit XML is not famous for those attributes 😞, but I see you support some: https://github.com/EnricoMi/publish-unit-test-result-action/blob/master/python/publish/junit.py#L268-L269, where did you get those names from, because the official schema doesn't have it for Maven? Neither the Ant one. Anyway, it's good to know that if I can "enrich" the XML, it'll "just work". |
Hey, came across this issue with pytest runs in subdirectories don't have the correct annotation.. thinking of some sed magic to add the prefix so the annotations are set correctly, unless there is an alternative? |
See #495 for a fix. |
Question #32 made me think of linking to the failing test and line form the annotations. Given the commit sha, test file and line, the action could generate a link like this and add to the respective annotation:
https://github.com/EnricoMi/publish-unit-test-result-action/blob/de7f7f0c5f7694846ce69e3384f2e5a03253c141/test/test_publish.py#L35
Such a link gets nicely rendered by GitHub:
publish-unit-test-result-action/test/test_publish.py
Line 35 in de7f7f0
Providing a few lines before and after gives a nice context:
publish-unit-test-result-action/test/test_publish.py
Lines 33 to 37 in de7f7f0
Let's hope that also holds for annotations. It probably won't because annotations do not support markdown.
Resolving the test file path from the test result file will be challenging. This might work best with some configuration like how many directories to remove from the path or which path to prepend.
The text was updated successfully, but these errors were encountered: