Skip to content

Commit

Permalink
SQ Plugin: Add xUnit report path to the UI (#9586)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-kolbay-sonarsource authored Aug 5, 2024
1 parent b387ce3 commit 1444731
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public List<Object> extensions() {
.subCategory(SUBCATEGORY)
.onlyOnQualifiers(Qualifiers.PROJECT)
.multiValues(true)
.build());
.build(),
PropertyDefinition.builder(unitTestConfiguration.xunitTestResultsFilePropertyKey())
.name("xUnit Test Reports Paths")
.description("Example: \"TestResult.xml\", \"TestResult1.xml,TestResult2.xml\" or \"C:/TestResult.xml\"")
.category(category)
.subCategory(SUBCATEGORY)
.onlyOnQualifiers(Qualifiers.PROJECT)
.multiValues(true)
.build());
}

public class DotNetUnitTestResultsAggregator extends UnitTestResultsAggregator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void vbnet() {
UnitTestResultsProvider.DotNetUnitTestResultsAggregator.class,
UnitTestResultsImportSensor.class);
assertThat(propertyKeys(extensions)).containsOnly(
"sonar.vbnet.vstest.reportsPaths", "sonar.vbnet.nunit.reportsPaths");
"sonar.vbnet.vstest.reportsPaths", "sonar.vbnet.nunit.reportsPaths", "sonar.vbnet.xunit.reportsPaths");
}

@Test
Expand All @@ -57,7 +57,7 @@ public void csharp() {
UnitTestResultsProvider.DotNetUnitTestResultsAggregator.class,
UnitTestResultsImportSensor.class);
assertThat(propertyKeys(extensions)).containsOnly(
"sonar.cs.vstest.reportsPaths", "sonar.cs.nunit.reportsPaths");
"sonar.cs.vstest.reportsPaths", "sonar.cs.nunit.reportsPaths", "sonar.cs.xunit.reportsPaths");
}

}

0 comments on commit 1444731

Please sign in to comment.