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

JUnit output formatter - unmatched skipped violations #573

Merged
merged 3 commits into from
Jun 14, 2021
Merged

JUnit output formatter - unmatched skipped violations #573

merged 3 commits into from
Jun 14, 2021

Conversation

patrickkusebauch
Copy link
Collaborator

Closes #568

Adding this (sample) output at the beginning of the file.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite id="0" package="" name="Unmatched skipped violations" hostname="localhost" tests="0" failures="0" skipped="0" errors="4" time="0">
    <failure message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\Dashboard\LayoutControl&quot; for &quot;TrainingCompass\Saas\Branding\Personal\DashboardPresenter&quot; was not matched." type="WARNING"/>
    <failure message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\Dashboard\LayoutControlFactory&quot; for &quot;TrainingCompass\Saas\Branding\Personal\DashboardPresenter&quot; was not matched." type="WARNING"/>
    <failure message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\DashboardLayoutConfig\LayoutConfigControl&quot; for &quot;TrainingCompass\Saas\Branding\Personal\ProfilePresenter&quot; was not matched." type="WARNING"/>
    <failure message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\DashboardLayoutConfig\LayoutConfigControlFactory&quot; for &quot;TrainingCompass\Saas\Branding\Personal\ProfilePresenter&quot; was not matched." type="WARNING"/>
  </testsuite>

@dbrumann
Copy link
Collaborator

Looks good. Can you please add or adapt one of the existing test cases for the formatter as well?

@patrickkusebauch
Copy link
Collaborator Author

patrickkusebauch commented Jun 11, 2021

@dbrumann will do. Just waiting for @Khartir to confirm this is the format he was looking for since he opened the issue and I don't use JUnit myself. Once he says the output solves the issue, I will add tests.

@Khartir
Copy link

Khartir commented Jun 14, 2021

I don't know the specification that well myself, which is why I didn't submit a PR for this, but I think if the testsuite declares this as errors, it should contain error-nodes, not failure-nodes:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite id="0" package="" name="Unmatched skipped violations" hostname="localhost" tests="0" failures="0" skipped="0" errors="4" time="0">
    <error message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\Dashboard\LayoutControl&quot; for &quot;TrainingCompass\Saas\Branding\Personal\DashboardPresenter&quot; was not matched." type="WARNING"/>
    <error message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\Dashboard\LayoutControlFactory&quot; for &quot;TrainingCompass\Saas\Branding\Personal\DashboardPresenter&quot; was not matched." type="WARNING"/>
    <error message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\DashboardLayoutConfig\LayoutConfigControl&quot; for &quot;TrainingCompass\Saas\Branding\Personal\ProfilePresenter&quot; was not matched." type="WARNING"/>
    <error message="Skipped violation &quot;TrainingCompass\Saas\Dashboards\Controls\DashboardLayoutConfig\LayoutConfigControlFactory&quot; for &quot;TrainingCompass\Saas\Branding\Personal\ProfilePresenter&quot; was not matched." type="WARNING"/>
  </testsuite>

Apart from that, this is exactly what I had in mind, thank you.

@patrickkusebauch
Copy link
Collaborator Author

I checked the official docs and you are right. You have it. Along with a test. 😄

@dbrumann dbrumann merged commit 9db6c11 into qossmic:main Jun 14, 2021
@patrickkusebauch patrickkusebauch deleted the report_skipped_in_junit branch June 14, 2021 19:15
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.

Add unmatched skipped violations to junit report
3 participants