From 54ae9eb9e4a2675550a9ef25cfba51707169dadb Mon Sep 17 00:00:00 2001 From: Cristian Ambrosini Date: Thu, 22 Aug 2024 09:15:47 +0200 Subject: [PATCH] Fix ITs after 8.0.1 Scanner release --- .../test/java/com/sonar/it/csharp/AnalysisWarningsTest.java | 6 +++--- its/src/test/java/com/sonar/it/csharp/TestProjectTest.java | 4 ++-- .../java/com/sonar/it/shared/VbMainCodeCsTestCodeTest.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/its/src/test/java/com/sonar/it/csharp/AnalysisWarningsTest.java b/its/src/test/java/com/sonar/it/csharp/AnalysisWarningsTest.java index 892fcc61d71..0cd5129206e 100644 --- a/its/src/test/java/com/sonar/it/csharp/AnalysisWarningsTest.java +++ b/its/src/test/java/com/sonar/it/csharp/AnalysisWarningsTest.java @@ -55,7 +55,7 @@ void analysisWarningsImport() throws IOException { assertThat(task.getWarningsList()).containsExactly( "First message", "Second message", - "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } @Test @@ -65,7 +65,7 @@ void analysisWarnings_MSBuild14() throws IOException { assertThat(task.getStatus()).isEqualTo(Ce.TaskStatus.SUCCESS); assertThat(task.getWarningsList()).containsExactly( "The analysis using MsBuild 14 is no longer supported and the analysis with MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.", - "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } @Test @@ -75,6 +75,6 @@ void analysisWarnings_MSBuild15() throws IOException { assertThat(task.getStatus()).isEqualTo(Ce.TaskStatus.SUCCESS); assertThat(task.getWarningsList()).containsExactly( "The analysis using MsBuild 15 is deprecated. Please update your pipeline to MsBuild 16 or higher.", - "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } } diff --git a/its/src/test/java/com/sonar/it/csharp/TestProjectTest.java b/its/src/test/java/com/sonar/it/csharp/TestProjectTest.java index 55a53b79f8b..1b234439f72 100644 --- a/its/src/test/java/com/sonar/it/csharp/TestProjectTest.java +++ b/its/src/test/java/com/sonar/it/csharp/TestProjectTest.java @@ -68,7 +68,7 @@ void logsContainInfoAndWarning() { "Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. " + "Read more about how the SonarScanner for .NET detects test projects: https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects", "Found 1 MSBuild C# project: 1 TEST project."); - TestUtils.verifyGuiTestOnlyProjectAnalysisWarning(ORCHESTRATOR, buildResult, "C#", "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + TestUtils.verifyGuiTestOnlyProjectAnalysisWarning(ORCHESTRATOR, buildResult, "C#", "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } @Test @@ -110,6 +110,6 @@ void with_html_and_csharp_code_explicitly_marked_as_test_should_not_populate_met "Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. " + "Read more about how the SonarScanner for .NET detects test projects: https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects"); assertThat(buildResult.getLogsLines(l -> l.contains("INFO"))).contains("INFO: Found 1 MSBuild C# project: 1 TEST project."); - TestUtils.verifyGuiTestOnlyProjectAnalysisWarning(ORCHESTRATOR, buildResult, "C#", "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + TestUtils.verifyGuiTestOnlyProjectAnalysisWarning(ORCHESTRATOR, buildResult, "C#", "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } } diff --git a/its/src/test/java/com/sonar/it/shared/VbMainCodeCsTestCodeTest.java b/its/src/test/java/com/sonar/it/shared/VbMainCodeCsTestCodeTest.java index f2fbd19ce37..4876652b8f6 100644 --- a/its/src/test/java/com/sonar/it/shared/VbMainCodeCsTestCodeTest.java +++ b/its/src/test/java/com/sonar/it/shared/VbMainCodeCsTestCodeTest.java @@ -70,7 +70,7 @@ public void logsContainInfo() { "INFO: Found 1 MSBuild VB.NET project: 1 MAIN project.", "INFO: Found 1 MSBuild C# project: 1 TEST project."); assertThat(TestUtils.getAnalysisWarningsTask(ORCHESTRATOR, buildResult).getWarningsList()).containsExactly( - "Multi-Language analysis is enabled. If this was not intended, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); + "Multi-Language analysis is enabled. If this was not intended and you have issues such as hitting your LOC limit or analyzing unwanted files, please set \"/d:sonar.scanner.scanAll=false\" in the begin step."); } @Test