tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

Failures of architecture tests are not detected #120

Closed uhafner closed 3 years ago

uhafner commented 3 years ago

The Junit parser marks failures as passed, if the file name cannot be detected. It seems that the format of the exception message in the JUnit file for ArchUnit tests is slightly different.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="Aufgabe3Test" time="0.58" tests="1" errors="0" skipped="0" failures="1">
  <testcase name="ALL_FINAL" classname="Aufgabe3Test" time="0.579">
    <failure type="java.lang.AssertionError"><![CDATA[java.lang.AssertionError: 
Architecture Violation [Priority: MEDIUM] - Rule 'classes that have simple name 'Integers' should have only final fields' was violated (1 times):
Field <Integers.value> is not final in (Integers.java:0)
]]></failure>
  </testcase>
</testsuite>

See https://github.com/jenkinsci/analysis-model/pull/557 for a full example.

tomasbjerre commented 3 years ago

Should be fixed now in 1.142. Open issue again if not working.