Skip to content

Commit

Permalink
SCAN4NET-175 Remove .NET 6 SDK related tests (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianAmbrosini authored Nov 26, 2024
1 parent 413d9f7 commit c8d25c5
Show file tree
Hide file tree
Showing 29 changed files with 17 additions and 118 deletions.
4 changes: 2 additions & 2 deletions Tests/SonarScanner.MSBuild.TFS.Test/Resources/Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The `Sample.coverage` file is an input file for the Conv_ConvertToXml_ToolConvertsSampleFile test. It was generated in the following way:
* New .Net6.0 Console App called "ConsoleApp2"
* New .Net9.0 Console App called "ConsoleApp2"
* `Program.cs` looks like so:

```cs
Expand All @@ -17,7 +17,7 @@ namespace ConsoleApp2
}
```

* A second .Net6.0 MS Test project called "TestProject1" which references `ConsoleApp2.csproj`
* A second .Net9.0 MS Test project called "TestProject1" which references `ConsoleApp2.csproj`
* One test file `UnitTest1.cs`:

```cs
Expand Down
31 changes: 0 additions & 31 deletions its/projects/CSharp.SDK.6/CSharp.SDK.6.sln

This file was deleted.

7 changes: 0 additions & 7 deletions its/projects/CSharp.SDK.6/Main/Common.cs

This file was deleted.

8 changes: 0 additions & 8 deletions its/projects/CSharp.SDK.6/Main/Main.csproj

This file was deleted.

17 changes: 0 additions & 17 deletions its/projects/CSharp.SDK.6/UTs/CommonTest.cs

This file was deleted.

15 changes: 0 additions & 15 deletions its/projects/CSharp.SDK.6/UTs/UTs.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion its/projects/DuplicateAnalyzerReferences/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>DefaultDriveSecondProject</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,17 +606,17 @@ void testXamlCompilation() throws IOException {
}

@Test
void testRazorCompilationNet6WithoutSourceGenerators() throws IOException {
void testRazorCompilationNet9WithoutSourceGenerators() throws IOException {
assumeTrue(TestUtils.getMsBuildPath(ORCHESTRATOR).toString().contains("2022")); // We can't build without MsBuild17
String projectName = "RazorWebApplication.net6.withoutSourceGenerators";
String projectName = "RazorWebApplication.net9.withoutSourceGenerators";
assertProjectFileContains(projectName, "<UseRazorSourceGenerator>false</UseRazorSourceGenerator>");
validateRazorProject(projectName);
}

@Test
void testRazorCompilationNet6WithSourceGenerators() throws IOException {
void testRazorCompilationNet9WithSourceGenerators() throws IOException {
assumeTrue(TestUtils.getMsBuildPath(ORCHESTRATOR).toString().contains("2022")); // We can't build without MsBuild17
String projectName = "RazorWebApplication.net6.withSourceGenerators";
String projectName = "RazorWebApplication.net9.withSourceGenerators";
assertProjectFileContains(projectName, "<UseRazorSourceGenerator>true</UseRazorSourceGenerator>");
validateRazorProject(projectName);
}
Expand Down Expand Up @@ -782,23 +782,6 @@ void testCSharpFramework48() throws IOException {
}
}

@Test
void testCSharpSdk6() throws IOException {
validateCSharpSdk("CSharp.SDK.6");
}

@Test
void testScannerNet6NoAnalysisWarnings() throws IOException {
// dotnet sdk tests should run only on VS 2022
assumeTrue(TestUtils.getMsBuildPath(ORCHESTRATOR).toString().contains("2022"));

Path projectDir = TestUtils.projectDir(basePath, "CSharp.SDK.6");
BuildResult buildResult = runNetCoreBeginBuildAndEnd(projectDir, ScannerClassifier.NET);

assertThat(buildResult.getLogs()).doesNotContain("Failed to parse properties from the environment variable 'SONARQUBE_SCANNER_PARAMS'");
assertUIWarnings(buildResult);
}

@Test
void testCSharpSdk8() throws IOException {
validateCSharpSdk("CSharp.SDK.8");
Expand Down

0 comments on commit c8d25c5

Please sign in to comment.