Skip to content

Commit

Permalink
Fix tests on latest preview SDK (IronLanguages#274)
Browse files Browse the repository at this point in the history
* Fix tests on latest preview SDK

* Run tests with .NET Framework 4.6.2 instead

* Exclude frameworks we're not targeting from packaging
  • Loading branch information
slozier authored Sep 6, 2023
1 parent e2a679d commit a7cf586
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ dotnet_diagnostic.CA1845.severity = none # CA1845: Use span-based 'string
dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer 'AsSpan' over 'Substring'
dotnet_diagnostic.CA1847.severity = none # CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1852.severity = suggestion # CA1852: Seal internal types
dotnet_diagnostic.CA1854.severity = suggestion # CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
dotnet_diagnostic.CA1859.severity = suggestion # CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1861.severity = suggestion # CA1861: Avoid constant arrays as arguments
dotnet_diagnostic.CA2101.severity = suggestion # CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2201.severity = none # CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2208.severity = suggestion # CA2208: Instantiate argument exceptions correctly
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
with:
name: packages
path: Package/Release/Packages
- name: Test (net452)
run: ./make.ps1 -frameworks net452 test-all
- name: Test (net462)
run: ./make.ps1 -frameworks net462 test-all
shell: pwsh
- name: Test (netcoreapp2.1)
run: ./make.ps1 -frameworks netcoreapp2.1 test-all
Expand Down
2 changes: 1 addition & 1 deletion Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
Outputs="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip">
<ItemGroup>
<ZipFiles Include="$(StageDir)\**\*.dll;$(StageDir)\**\*.xml;$(StageDir)\README.md;$(StageDir)\LICENSE"
Exclude="$(StageDir)\netcoreapp2.1\**\*;$(StageDir)\net7.0*\**\*" />
Exclude="$(StageDir)\netcoreapp2.1\*;$(StageDir)\net462\*;$(StageDir)\net7.0\*;$(StageDir)\net8.0\*" />
</ItemGroup>
<Message Text="$(ZipFiles)" />
<Zip Files="@(ZipFiles)" ZipFileName="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip" WorkingDirectory="$(StageDir)"/>
Expand Down
6 changes: 3 additions & 3 deletions Package/nuget/DynamicLanguageRuntime.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
</dependencies>
</metadata>
<files>
<file src="**\*.dll" target="lib" exclude="netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\*.pdb" target="lib" exclude="netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\*.xml" target="lib" exclude="netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\*.dll" target="lib" exclude="netcoreapp2.1\*;net462\*;net7.0\*;net8.0\*" />
<file src="**\*.pdb" target="lib" exclude="netcoreapp2.1\*;net462\*;net7.0\*;net8.0\*" />
<file src="**\*.xml" target="lib" exclude="netcoreapp2.1\*;net462\*;net7.0\*;net8.0\*" />
<file src="README.md;LICENSE" />
</files>
</package>
14 changes: 8 additions & 6 deletions Tests/Metadata/Metadata.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<!-- EOL netcoreapp2.1 is used to test netstandard2.0 assemblies -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<OutputType>Exe</OutputType>
Expand All @@ -16,12 +16,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnitLite" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.2.1" />
</ItemGroup>

</Project>
14 changes: 8 additions & 6 deletions Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<!-- EOL netcoreapp2.1 is used to test netstandard2.0 assemblies -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnitLite" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 8 additions & 6 deletions Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<!-- EOL netcoreapp2.1 is used to test netstandard2.0 assemblies -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnitLite" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Param(
[Parameter(Position=1)]
[String] $target = "release",
[String] $configuration = "Release",
[String[]] $frameworks=@('net452','netcoreapp2.1','netcoreapp3.1','net6.0'),
[String[]] $frameworks=@('net462','netcoreapp2.1','netcoreapp3.1','net6.0'),
[String] $platform = "x64",
[switch] $runIgnored
)
Expand Down

0 comments on commit a7cf586

Please sign in to comment.