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

SQ Plugin: Bump orchestrator to 5.0.0.2065 #9551

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion its/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator-junit5</artifactId>
<version>4.9.0.1920</version>
<version>5.0.0.2065</version>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
Expand Down
33 changes: 18 additions & 15 deletions its/src/test/java/com/sonar/it/shared/ScannerCliTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ScannerCliTest {
private static final String HTML_IN_MAIN_AND_CSHARP_IN_TEST_SUBFOLDERS = "ScannerCli";

// Note: setting the `sonar.projectBaseDir` only enables Incremental PR Analysis when used with the Scanner for .NET.
private static final String INCREMENTAL_PR_ANALYSIS_WARNING = "WARN: Incremental PR analysis: Could not determine common base path, cache will not be computed. Consider setting 'sonar.projectBaseDir' property.";
private static final String INCREMENTAL_PR_ANALYSIS_WARNING = "WARN Incremental PR analysis: Could not determine common base path, cache will not be computed. Consider setting 'sonar.projectBaseDir' property.";

@Test
void givenRazorPagesMainCode_whenScannerForCliIsUsed_logsCSharpWarning() {
Expand All @@ -46,12 +46,13 @@ void givenRazorPagesMainCode_whenScannerForCliIsUsed_logsCSharpWarning() {
BuildResult result = ORCHESTRATOR.executeBuild(scanner);

assertThat(result.getLogsLines(l -> l.contains("WARN")))
.containsExactlyInAnyOrder(
"WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html",
"WARN: Your project contains VB.NET files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html",
INCREMENTAL_PR_ANALYSIS_WARNING,
INCREMENTAL_PR_ANALYSIS_WARNING
);
.hasSize(4)
.doesNotHaveDuplicates()
zsolt-kolbay-sonarsource marked this conversation as resolved.
Show resolved Hide resolved
.anyMatch(x -> x.endsWith("WARN Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"))
.anyMatch(y -> y.endsWith("WARN Your project contains VB.NET files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"))
.anyMatch(w -> w.endsWith(INCREMENTAL_PR_ANALYSIS_WARNING))
.anyMatch(z -> z.endsWith(INCREMENTAL_PR_ANALYSIS_WARNING));
zsolt-kolbay-sonarsource marked this conversation as resolved.
Show resolved Hide resolved

// The HTML plugin works
assertThat(TestUtils.getMeasureAsInt(ORCHESTRATOR, RAZOR_PAGES_PROJECT, "violations")).isEqualTo(2);
TestUtils.verifyNoGuiWarnings(ORCHESTRATOR, result);
Expand All @@ -65,10 +66,11 @@ void givenMainHtmlCodeAndTestCSharpCode_whenScannerForCliIsUsed_logsCSharpWarnin
BuildResult result = ORCHESTRATOR.executeBuild(scanner);

assertThat(result.getLogsLines(l -> l.contains("WARN")))
.containsExactlyInAnyOrder(
"WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html",
INCREMENTAL_PR_ANALYSIS_WARNING
);
.hasSize(2)
.doesNotHaveDuplicates()
zsolt-kolbay-sonarsource marked this conversation as resolved.
Show resolved Hide resolved
.anyMatch(x -> x.endsWith("WARN Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"))
.anyMatch(y -> y.endsWith(INCREMENTAL_PR_ANALYSIS_WARNING));

// The HTML plugin works
assertThat(TestUtils.getMeasureAsInt(ORCHESTRATOR, HTML_IN_MAIN_AND_CSHARP_IN_TEST_SUBFOLDERS, "violations")).isEqualTo(2);
TestUtils.verifyNoGuiWarnings(ORCHESTRATOR, result);
Expand All @@ -82,10 +84,11 @@ void givenTestHtmlAndCSharpCode_whenScannerForCliIsUsed_logsCSharpWarning() {
BuildResult result = ORCHESTRATOR.executeBuild(scanner);

assertThat(result.getLogsLines(l -> l.contains("WARN")))
.containsExactlyInAnyOrder(
"WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html",
INCREMENTAL_PR_ANALYSIS_WARNING
);
.hasSize(2)
.doesNotHaveDuplicates()
.anyMatch(y -> y.endsWith("WARN Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"))
.anyMatch(z -> z.endsWith(INCREMENTAL_PR_ANALYSIS_WARNING));

TestUtils.verifyNoGuiWarnings(ORCHESTRATOR, result);
}

Expand Down
Loading