Skip to content

Commit

Permalink
standardize Hyperion runtimes through common.props (#253)
Browse files Browse the repository at this point in the history
* standardize Hyperion runtimes through common.props

* fixed .NET Framework tests

* fixed IFDEFs

* disable AppDomains in XUnit on Linux

* fixed paths

* fixed path resolution to `xunit.runner.json`

* remove API tests on Linux

* fixed net461 ref
  • Loading branch information
Aaronontheweb authored Aug 16, 2021
1 parent 3c3cc04 commit a7fc161
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 25 deletions.
7 changes: 4 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let output = __SOURCE_DIRECTORY__ @@ "bin"
let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults"
let outputBinaries = output @@ "binaries"
let outputBinariesNet461 = outputBinaries @@ "net461"
let outputBinariesNet461 = outputBinaries @@ "net471"
let outputBinariesNetStandard = outputBinaries @@ "netstandard2.0"
let outputBinariesNet = outputBinaries @@ "net5.0"
let outputNuGet = output @@ "nuget"
Expand All @@ -52,7 +52,7 @@ let versionSuffix =
| str -> str

// Configuration values for tests
let testNetFrameworkVersion = "net461"
let testNetFrameworkVersion = "net471"
let testNetCoreVersion = "netcoreapp3.1"
let testNetVersion = "net5.0"

Expand Down Expand Up @@ -115,7 +115,8 @@ Target "RunTests" (fun _ ->
let projects =
match (isWindows) with
| true -> !! "./src/**/*.Tests.csproj"
| _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here
| _ -> !! "./src/**/*.Tests.csproj"
-- "./src/**/*.API.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here

let runSingleProject project =
let arguments =
Expand Down
3 changes: 2 additions & 1 deletion src/Hyperion.API.Tests/Hyperion.API.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\xunitSettings.props" />

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion);$(NetCoreTestVersion)</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\xunitSettings.props" />

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion);$(NetCoreTestVersion)</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Hyperion.Benchmarks/Hyperion.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<IsPackable>false</IsPackable> <!-- prevents it from being published as NuGet package -->
</PropertyGroup>

Expand Down
19 changes: 11 additions & 8 deletions src/Hyperion.Tests/Hyperion.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\xunitSettings.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<LangVersion>latest</LangVersion>
<StartupObject>Hyperion.Tests.Generator.Program</StartupObject>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetCoreTestVersion)' or '$(TargetFramework)' == '$(NetTestVersion)' ">
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkTestVersion)' ">
<DefineConstants>$(DefineConstants);NETFX</DefineConstants>
</PropertyGroup>


<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkTestVersion)'">
<Reference Include="System.Drawing">
<Private>true</Private>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
Expand All @@ -30,9 +38,4 @@
<ProjectReference Include="..\Hyperion\Hyperion.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Drawing">
<Private>true</Private>
</Reference>
</ItemGroup>
</Project>
23 changes: 13 additions & 10 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
<PropertyGroup>
<Copyright>Copyright © 2016-2021 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>0.9.17</VersionPrefix>
<PackageReleaseNotes>[Bump Microsoft.NET.Test.Sdk from 16.6.1 to 16.7.1](https://github.com/akkadotnet/Hyperion/pull/182)
[Fix unit test problem](https://github.com/akkadotnet/Hyperion/pull/191)
[Bump FSharp.Core from 4.7.2 to 5.0.0](https://github.com/akkadotnet/Hyperion/pull/189)
[Fix issue #40 regarding partial streams](https://github.com/akkadotnet/Hyperion/pull/185)
[Fix Hyperion not using known serializers when defined](https://github.com/akkadotnet/Hyperion/pull/184)
[Bump Microsoft.NET.Test.Sdk from 16.7.1 to 16.8.3](https://github.com/akkadotnet/Hyperion/pull/196)
[Bump System.Collections.Immutable from 1.7.1 to 5.0.0](https://github.com/akkadotnet/Hyperion/pull/195)
[Bump FSharp.Core from 5.0.0 to 5.0.1](https://github.com/akkadotnet/Hyperion/pull/202)
[Update the cross framework spec to include complex POCO object, Type serialization, and support for netcoreapp3.1 and net5.0](https://github.com/akkadotnet/Hyperion/pull/204)</PackageReleaseNotes>
<VersionPrefix>0.11.0</VersionPrefix>
<PackageReleaseNotes>[Fix array of user defined structs serialization failure](https://github.com/akkadotnet/Hyperion/pull/235)
[Remove dynamic keyword usage from array serializer](https://github.com/akkadotnet/Hyperion/pull/139)
[Change field ordering to ordinal](https://github.com/akkadotnet/Hyperion/pull/236)
Possible breaking changes**
The change to the object serializer field ordering might cause a deserialization failure of persisted objects
that are serialized using the Hyperion serializer.
Please report any serialization problem that occurs after an upgrade to this version at the
[issue tracker](https://github.com/akkadotnet/Hyperion/issues)</PackageReleaseNotes>
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/Hyperion</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/Hyperion/blob/master/LICENSE</PackageLicenseUrl>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetTestVersion>net5.0</NetTestVersion>
<NetFrameworkTestVersion>net471</NetFrameworkTestVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
<AkkaVersion>1.4.23</AkkaVersion>
<FluentAssertionsVersion>6.0.0</FluentAssertionsVersion>
<XunitVersion>2.4.1</XunitVersion>
Expand Down
6 changes: 6 additions & 0 deletions src/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://xunit.github.io/schema/current/xunit.runner.schema.json",
"longRunningTestSeconds": 60,
"parallelizeAssembly": false,
"parallelizeTestCollections": false
}
8 changes: 8 additions & 0 deletions src/xunitSettings.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<!-- use the xunit JSON settings file -->
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)xunit.runner.json" Link="xunit.runner.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

0 comments on commit a7fc161

Please sign in to comment.