Skip to content

Commit

Permalink
Migrate net variant to net8.0 and EF8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Aug 14, 2024
1 parent bd5880e commit 38df936
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
#- name: Enable snapshots
# run: dotnet nuget add source https://apiint.nugettest.org/v3/index.json -n int.nugettest.org
- name: Pack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'

- name: Launch Sqlserver
run: |
Expand Down
2 changes: 1 addition & 1 deletion net/QACover/QACoverReport.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<InformationalVersion>1.6.4-SNAPSHOT</InformationalVersion>
<Version>1.6.4-SNAPSHOT</Version>
<PackageId>QACover</PackageId>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions net/QACoverEf2spy/QACoverEf2spy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

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

<PropertyGroup>
Expand All @@ -26,9 +26,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.33" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />

<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.33" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion net/QACoverTest/QACoverTest.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace />
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions net/QACoverTestEf/QACoverTestEf.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace />
</PropertyGroup>

Expand All @@ -9,12 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.33">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.33" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />

Expand Down
24 changes: 12 additions & 12 deletions net/QACoverTestEf/Test4giis.Qacover.Ef/TestEvaluationEf.N.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public virtual void TestEvalEfNoParameters()
ClassicAssert.AreEqual(99, pojo[0].Num);
ClassicAssert.AreEqual("xyz", pojo[0].Txt);
//compara eliminando las comillas dobles que inserta EntityFramework en tablas y columnas
string efSql= "SELECT [t].[Id], [t].[Num], [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] = 'xyz') AND ([t].[Num] = 99) ORDER BY [t].[Id]";
string efSql= "SELECT [t].[Id], [t].[Num], [t].[Txt] FROM [TestEfTable] AS [t] WHERE [t].[Txt] = 'xyz' AND [t].[Num] = 99 ORDER BY [t].[Id]";
AssertEvalResults(efSql,
string.Empty, string.Empty,
"COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE (([t].[Txt] = 'xyz')) AND (([t].[Num] = 99))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT(([t].[Txt] = 'xyz')) AND (([t].[Num] = 99))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] IS NULL) AND (([t].[Num] = 99))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 100) AND (([t].[Txt] = 'xyz'))\n"
+ "COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 99) AND (([t].[Txt] = 'xyz'))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 98) AND (([t].[Txt] = 'xyz'))",
"COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] = 'xyz') AND ([t].[Num] = 99)\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT([t].[Txt] = 'xyz') AND ([t].[Num] = 99)\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] IS NULL) AND ([t].[Num] = 99)\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 100) AND ([t].[Txt] = 'xyz')\n"
+ "COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 99) AND ([t].[Txt] = 'xyz')\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Num] = 98) AND ([t].[Txt] = 'xyz')",
"{}", true, false);
}
[Test()]
Expand All @@ -71,12 +71,12 @@ public virtual void TestEvalEfParameters()
options.SetRuleOptions("noboundaries");
AppSimpleEf app = new AppSimpleEf();
List<TestEfEntity> pojo = app.QueryEfParams(99, "xyz");
string efSql = "SELECT [t].[Id], [t].[Num], [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] = @__param1_0) AND ([t].[Num] > @__param2_1) ORDER BY [t].[Id]";
string efSql = "SELECT [t].[Id], [t].[Num], [t].[Txt] FROM [TestEfTable] AS [t] WHERE [t].[Txt] = @__param1_0 AND [t].[Num] > @__param2_1 ORDER BY [t].[Id]";
AssertEvalResults(efSql, string.Empty, string.Empty,
"UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE (([t].[Txt] = 'xyz')) AND (([t].[Num] > 99))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT(([t].[Txt] = 'xyz')) AND (([t].[Num] > 99))\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] IS NULL) AND (([t].[Num] > 99))\n"
+ "COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT(([t].[Num] > 99)) AND (([t].[Txt] = 'xyz'))",
"UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] = 'xyz') AND ([t].[Num] > 99)\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT([t].[Txt] = 'xyz') AND ([t].[Num] > 99)\n"
+ "UNCOVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE ([t].[Txt] IS NULL) AND ([t].[Num] > 99)\n"
+ "COVERED SELECT [t].[Id] , [t].[Num] , [t].[Txt] FROM [TestEfTable] AS [t] WHERE NOT([t].[Num] > 99) AND ([t].[Txt] = 'xyz')",
"{@__param1_0='xyz', @__param2_1=99}", true, false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion net/QACoverTestEf/Test4giis.Qacoverapp.Ef/EfModel.N.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private string GetConnectionString()
string user = new JdbcProperties().GetProp(DatabaseProperties, "qacover.netcore.qacoverdb.sqlserver.user");
string EnvironmentProperties = FileUtil.GetPath(SetupPath, "environment.properties");
string password = new JdbcProperties().GetEnvVar(EnvironmentProperties, "TEST_" + "sqlserver".ToUpper() + "_PWD");
return url + ";UID=" + user + ";PWD=" + password;
return url + ";UID=" + user + ";PWD=" + password + ";TrustServerCertificate=true";
}

protected override void OnConfiguring(DbContextOptionsBuilder options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public Configuration reset() {
stackExclusions.add("javax.");
stackExclusions.add("jdk.internal."); // for jdk11 (not needed in jdk8)
stackExclusions.add("System."); // for .net
stackExclusions.add("InvokeStub_EventListener"); // since .net8.0
for (String item : getMultiValueProperty("qacover.stack.exclusions"))
stackExclusions.add(item);

Expand Down

0 comments on commit 38df936

Please sign in to comment.