Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] resolve issues with .NET Core dependency globbing #3151

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ Target "RunTests" (fun _ ->
let projects =
match getBuildParamOrDefault "incremental" "" with
| "true" -> log "The following test projects would be run under Incremental Test config..."
getIncrementalUnitTests() |> Seq.map (fun x -> printfn "\t%s" x; x)
getIncrementalUnitTests Net |> Seq.map (fun x -> printfn "\t%s" x; x)
| "experimental" -> log "The following test projects would be run under Incremental Test config..."
getIncrementalUnitTests() |> Seq.iter log
getUnitTestProjects()
(getIncrementalUnitTests Net) |> Seq.iter log
getUnitTestProjects Net
| _ -> log "All test projects will be run..."
getUnitTestProjects()
getUnitTestProjects Net

let runSingleProject project =
let result = ExecProcess(fun info ->
Expand All @@ -140,12 +140,12 @@ Target "RunTestsNetCore" (fun _ ->
let projects =
match getBuildParamOrDefault "incremental" "" with
| "true" -> log "The following test projects would be run under Incremental Test config..."
getIncrementalUnitTests() |> Seq.map (fun x -> printfn "\t%s" x; x)
getIncrementalUnitTests NetCore |> Seq.map (fun x -> printfn "\t%s" x; x)
| "experimental" -> log "The following test projects would be run under Incremental Test config..."
getIncrementalUnitTests() |> Seq.iter log
getUnitTestProjects()
getIncrementalUnitTests NetCore |> Seq.iter log
getUnitTestProjects NetCore
| _ -> log "All test projects will be run..."
getUnitTestProjects()
getUnitTestProjects NetCore

let runSingleProject project =
let result = ExecProcess(fun info ->
Expand All @@ -171,9 +171,9 @@ Target "MultiNodeTests" (fun _ ->
let multiNodeTestAssemblies =
match getBuildParamOrDefault "incremental" "" with
| "true" -> log "The following test projects would be run under Incremental Test config..."
getIncrementalMNTRTests() |> Seq.map (fun x -> printfn "\t%s" x; x)
getIncrementalMNTRTests |> Seq.map (fun x -> printfn "\t%s" x; x)
| "experimental" -> log "The following MNTR specs would be run under Incremental Test config..."
getIncrementalMNTRTests() |> Seq.iter log
getIncrementalMNTRTests |> Seq.iter log
getAllMntrTestAssemblies()
| _ -> log "All test projects will be run"
getAllMntrTestAssemblies()
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Param(

$FakeVersion = "4.63.0"
$NBenchVersion = "1.0.1"
$DotNetChannel = "preview";
$DotNetChannel = "LTS";
$DotNetVersion = "2.0.0";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1";
$NugetVersion = "4.3.0";
Expand Down
48 changes: 33 additions & 15 deletions buildIncremental.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ module IncrementalTests =
| Linux
| All

type Runtime =
| NetCore
| Net

let SkippedTest name runtime =
match (name, runtime) with
| (EndsWith "Sqlite.Tests.csproj", NetCore) -> false
| (EndsWith "Cluster.Sharding.Tests.MultiNode.csproj", NetCore) -> false
| _ -> true


let (|IsRunnable|_|) name platform (csproj:string) =
let isSupported =
match platform with
Expand All @@ -30,12 +41,13 @@ module IncrementalTests =
| IsRunnable "Akka.API.Tests.csproj" Linux proj -> false
| _ -> true

let getUnitTestProjects() =
let getUnitTestProjects runtime =
let allTestProjects = !! "./**/core/**/*.Tests.csproj"
++ "./**/contrib/**/*.Tests.csproj"
-- "./**/serializers/**/*Wire*.csproj"
allTestProjects
|> Seq.filter IsRunnable
|> Seq.filter (fun p -> SkippedTest p runtime) // filter out specs that should not be run based on .NET Core / .NET differences

let isBuildScript (file:string) =
match file with
Expand Down Expand Up @@ -131,16 +143,18 @@ module IncrementalTests =
// MultiNodeTestRunner incremental test selection
//--------------------------------------------------------------------------------

let getMntrProjects() =
let getMntrProjects runtime =
!! "./src/**/*Tests.MultiNode.csproj"
|> Seq.map (fun x -> x.ToString())
|> Seq.filter (fun p -> SkippedTest p runtime) // filter out specs that should not be run based on .NET Core / .NET differences

let getAllMntrTestAssemblies() = // if we're not running incremental tests
getMntrProjects()
getMntrProjects Net
|> Seq.map (fun x -> getAssemblyForProject x)
|> Seq.filter (fun p -> SkippedTest p Net) // filter out specs that should not be run based on .NET Core / .NET differences

let getAllMntrTestNetCoreAssemblies() = // if we're not running incremental tests
getMntrProjects()
getMntrProjects NetCore
|> Seq.map (fun x -> getNetCoreAssemblyForProject x)

//--------------------------------------------------------------------------------
Expand Down Expand Up @@ -215,18 +229,21 @@ module IncrementalTests =
//logfn "%s references %s but is not a test project..." proj.parentProject.projectName project
yield! findTestProjectsThatHaveDependencyOn proj.parentProject.projectName testMode }

let getIncrementalTestProjects2 testMode =
let getIncrementalTestProjects2 testMode runtime =
logfn "Searching for incremental tests to run in %s test mode..." (testMode.ToString())
let updatedFiles = getUpdatedFiles()
log "The following files have been updated since forking from dev branch..."
updatedFiles |> Seq.iter (fun x -> logfn "\t%s" x)
log "The following test projects will be run..."
if (updatedFiles |> Seq.exists (fun p -> isBuildScript p)) then
log "Full test suite"
match testMode with
| Unit -> getUnitTestProjects()
| MNTR -> getMntrProjects()
| Perf -> getPerfTestProjects()
let specs =
match testMode with
| Unit -> getUnitTestProjects runtime
| MNTR -> getMntrProjects runtime
| Perf -> getPerfTestProjects()
specs
|> Seq.filter (fun p -> SkippedTest p runtime) // filter out specs that should not be run based on .NET Core / .NET differences
else
updatedFiles
|> generateContainingProjFileCollection
Expand All @@ -236,18 +253,19 @@ module IncrementalTests =
|> Seq.map (fun p -> p.parentProject.projectPath)
|> Seq.distinct
|> Seq.filter IsRunnable
|> Seq.filter (fun p -> SkippedTest p runtime) // filter out specs that should not be run based on .NET Core / .NET differences

let getIncrementalUnitTests() =
getIncrementalTestProjects2 Unit
let getIncrementalUnitTests runtime =
getIncrementalTestProjects2 Unit runtime

let getIncrementalMNTRTests() =
getIncrementalTestProjects2 MNTR
let getIncrementalMNTRTests =
getIncrementalTestProjects2 MNTR Net
|> Seq.map (fun p -> getAssemblyForProject p)

let getIncrementalNetCoreMNTRTests() =
getIncrementalTestProjects2 MNTR
getIncrementalTestProjects2 MNTR NetCore
|> Seq.map (fun p -> getNetCoreAssemblyForProject p)

let getIncrementalPerfTests() =
getIncrementalTestProjects2 Perf
getIncrementalTestProjects2 Perf Net
|> Seq.map (fun p -> getAssemblyForProject p)
22 changes: 3 additions & 19 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,14 @@
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/akka.net</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</PackageLicenseUrl>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn);CS1591;NU1605</NoWarn>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.3.0</XunitVersion>
<XunitVersion>2.3.0-beta5-*</XunitVersion>
<TestSdkVersion>15.3.0</TestSdkVersion>
<AkkaPackageTags>akka;actors;actor model;Akka;concurrency</AkkaPackageTags>
</PropertyGroup>
<PropertyGroup>
<PackageReleaseNotes>Maintenance Release for Akka.NET 1.3**
Updates and bugfixes**:
- Bugfix: Hyperion NuGet package restore creating duplicate assemblies for the same version inside Akka
- Various documentation fixes and updates
- Bugfix: issue where data sent via UDP when `ByteString` payload had buffers with length more than 1, `UdpSender` only wrote the first part of the buffers and dropped the rest.
- Bugfix: Akka.IO.Tcp failed to write some outgoing messages.
- Improved support for OSX &amp; Rider
- Bugfix: Akka.Persistence support for `SerializerWithStringManifest` required by Akka.Cluster.Sharding and Akka.Cluster.Tools
- Akka.Persistence.Sqlite and Akka.Persistence.SqlServer were unable to support `SerializerWithStringManifest`, so using Akka.Cluster.Sharding with Sql plugins would not work.
- Bugfix: Akka.Streams generic type parameters of the flow returned from current implementation of Bidiflow's JoinMat method were incorrect.
- Bugfix: `PersistenceMessageSerializer` was failing with the wrong exceptoin when a non-supported type was provided.
Akka.Persistence backwards compability warning**:
- Akka.Persistence.Sql introduces an additional field to the schema used by Sql-based plugins to allow for the use of `SerializerWithStringManifest` called `serializer_id`. It requires any previous Sql schema to be updated to have this field. Details are included in the Akka.Persistence.Sqlite plugin README.md file. Users of the Akka.Persistence.Sqlite plugin must alter their existing databases to add the field `serializer_id int (4)`:
```
ALTER TABLE {your_event_journal_table_name} ADD COLUMN `serializer_id` INTEGER ( 4 )
ALTER TABLE {your_snapshot_table_name} ADD COLUMN `serializer_id` INTEGER ( 4 )
```</PackageReleaseNotes>
<PackageReleaseNotes>Placeholder</PackageReleaseNotes>
</PropertyGroup>
</Project>