Skip to content
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

Add tests on annotation production and fix "undefined" in annotations #16

Merged
merged 7 commits into from
Jul 26, 2020

Conversation

TurpIF
Copy link
Contributor

@TurpIF TurpIF commented Jul 22, 2020

This PR brings unit tests on:

  • deserialization of JUnit XML report to JSON
  • production of annotations
  • edge cases with missing parameters are handled

This add simulated failures in the embedded JUnit report to automatically generate example of the plugin in its own GitHub Action run (see https://github.com/TurpIF/junit-report-annotations-action/runs/899761676?check_suite_focus=true for instance).

By adding the test, few bugs were fixed:

For #14, the line and file are still when not using java-like structure (with tests under src).

TurpIF added 7 commits July 21, 2020 23:26
JUnit XML DTD indicate that some arguments are optionals. To avoid
having NaN numbers, missing values are transformed to 0.
The test name and failure message were undefined. This is fixed. Also
the JUnit XML DTD indicate that failure message is not required, so
missing value is supported.

Setting numFailures parameter to -1 will transform all failures into
annotations without limit.
Before, without title, the file path were used as annotation title. But,
this information is already visible at the top of the annotation.

To maximize the amount of information, this define the test case name as
title. Also, the failure message (generally the stack trace) is provided
as raw_details of the annotation. Note that this raw_details is folded
by GitHub, so it won't reduce the readability of annotations.
@TurpIF
Copy link
Contributor Author

TurpIF commented Jul 22, 2020

That's weird, I have no idea why the tests are failing. They are good on my fork: https://github.com/TurpIF/junit-report-annotations-action/actions/runs/178849846
Maybe the new logging format does not support fork ?
Do you have any clue ?

@jpbernius
Copy link

Hey @ashley-taylor, love the plugin. The fix for #12 in this PR is also useful for us at ls1intum/Artemis. Would you mind releasing a new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants