diff --git a/Akka.Quartz.Actor.sln b/Akka.Quartz.Actor.sln index 3761e5c..a24eb7e 100644 --- a/Akka.Quartz.Actor.sln +++ b/Akka.Quartz.Actor.sln @@ -9,6 +9,28 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Quartz.Actor.Tests", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Quartz.Actor.IntegrationTests", "src\Akka.Quartz.Actor.IntegrationTests\Akka.Quartz.Actor.IntegrationTests.csproj", "{6F4BDCE1-AFEA-444B-BA13-B560E24C94C6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FB34DCD0-D371-472E-8E7D-0B29FE0B6D88}" + ProjectSection(SolutionItems) = preProject + build.cmd = build.cmd + build.fsx = build.fsx + build.ps1 = build.ps1 + README.md = README.md + RELEASE_NOTES.md = RELEASE_NOTES.md + src\Directory.Build.props = src\Directory.Build.props + src\Directory.Generated.props = src\Directory.Generated.props + src\Directory.Packages.props = src\Directory.Packages.props + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-system", "build-system", "{9B4742AA-8EED-486D-9607-BACFD98D3FB9}" + ProjectSection(SolutionItems) = preProject + build-system\azure-pipeline.template.yaml = build-system\azure-pipeline.template.yaml + build-system\linux-pr-validation.yaml = build-system\linux-pr-validation.yaml + build-system\nightly-builds.yaml = build-system\nightly-builds.yaml + build-system\README.md = build-system\README.md + build-system\windows-pr-validation.yaml = build-system\windows-pr-validation.yaml + build-system\windows-release.yaml = build-system\windows-release.yaml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,4 +53,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {9B4742AA-8EED-486D-9607-BACFD98D3FB9} = {FB34DCD0-D371-472E-8E7D-0B29FE0B6D88} + EndGlobalSection EndGlobal diff --git a/build-system/azure-pipeline.template.yaml b/build-system/azure-pipeline.template.yaml index 251a532..1d56c14 100644 --- a/build-system/azure-pipeline.template.yaml +++ b/build-system/azure-pipeline.template.yaml @@ -20,6 +20,10 @@ jobs: displayName: "Use .NET SDK 3.1" inputs: version: 3.1.x + - task: UseDotNet@2 + displayName: "Use .NET 6.0 SDK" + inputs: + version: 6.x # Linux or macOS - task: Bash@3 displayName: Linux / OSX Build diff --git a/build-system/linux-pr-validation.yaml b/build-system/linux-pr-validation.yaml index 1b3a1a2..9b469b9 100644 --- a/build-system/linux-pr-validation.yaml +++ b/build-system/linux-pr-validation.yaml @@ -19,4 +19,4 @@ jobs: name: Ubuntu vmImage: 'ubuntu-latest' scriptFileName: ./build.sh - scriptArgs: all \ No newline at end of file + scriptArgs: RunTestsNet \ No newline at end of file diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml index 7853e44..2939b72 100644 --- a/build-system/windows-release.yaml +++ b/build-system/windows-release.yaml @@ -30,7 +30,7 @@ steps: displayName: 'FAKE Build' inputs: filename: build.cmd - arguments: 'All nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)' + arguments: 'All nugetpublishurl=https://api.nuget.org/v3/index.json nugetkey=$(nugetKey)' - task: GitHubRelease@0 displayName: 'GitHub release (create)' diff --git a/build.fsx b/build.fsx index 3045fec..a80cfe2 100644 --- a/build.fsx +++ b/build.fsx @@ -35,6 +35,10 @@ let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults" let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults" let outputNuGet = output @@ "nuget" +// Configuration values for tests +let testNetFrameworkVersion = "net472" +let testNetVersion = "net6.0" + Target "Clean" (fun _ -> ActivateFinalTarget "KillCreatedProcesses" @@ -43,11 +47,14 @@ Target "Clean" (fun _ -> CleanDir outputPerfTests CleanDir outputNuGet CleanDir "docs/_site" + + CleanDirs !! "./**/bin" + CleanDirs !! "./**/obj" ) Target "AssemblyInfo" (fun _ -> - XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion - XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n") + XmlPokeInnerText "./src/Directory.Generated.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion + XmlPokeInnerText "./src/Directory.Generated.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n") ) Target "Build" (fun _ -> @@ -84,13 +91,15 @@ Target "RunTests" (fun _ -> let projects = match (isWindows) with | true -> !! "./src/**/*.Tests.csproj" + ++ "./src/**/*.*Tests.csproj" | _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + ++ "./src/**/*.*Tests.csproj" let runSingleProject project = let arguments = match (hasTeamCity) with - | true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none -teamcity" (outputTests)) - | false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none" (outputTests)) + | true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none -teamcity" testNetFrameworkVersion outputTests) + | false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none" testNetFrameworkVersion outputTests) let result = ExecProcess(fun info -> info.FileName <- "dotnet" @@ -99,6 +108,33 @@ Target "RunTests" (fun _ -> ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + CreateDir outputTests + projects |> Seq.iter (log) + projects |> Seq.iter (runSingleProject) +) + +Target "RunTestsNet" (fun _ -> + let projects = + match (isWindows) with + | true -> !! "./src/**/*.Tests.csproj" + ++ "./src/**/*.*Tests.csproj" + | _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + ++ "./src/**/*.*Tests.csproj" + + let runSingleProject project = + let arguments = + match (hasTeamCity) with + | true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none -teamcity" testNetVersion outputTests) + | false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory %s -- -parallel none" testNetVersion outputTests) + + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- (Directory.GetParent project).FullName + info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) + + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + + CreateDir outputTests projects |> Seq.iter (log) projects |> Seq.iter (runSingleProject) ) @@ -129,30 +165,32 @@ Target "CreateNuget" (fun _ -> ) Target "PublishNuget" (fun _ -> - let projects = !! "./bin/nuget/*.nupkg" -- "./bin/nuget/*.symbols.nupkg" - let apiKey = getBuildParamOrDefault "nugetkey" "" - let source = getBuildParamOrDefault "nugetpublishurl" "" - let symbolSource = getBuildParamOrDefault "symbolspublishurl" "" - let shouldPublishSymbolsPackages = not (symbolSource = "") - - if (not (source = "") && not (apiKey = "") && shouldPublishSymbolsPackages) then - let runSingleProject project = - DotNetCli.RunCommand - (fun p -> - { p with - TimeOut = TimeSpan.FromMinutes 10. }) - (sprintf "nuget push %s --api-key %s --source %s --symbol-source %s" project apiKey source symbolSource) - - projects |> Seq.iter (runSingleProject) - else if (not (source = "") && not (apiKey = "") && not shouldPublishSymbolsPackages) then - let runSingleProject project = - DotNetCli.RunCommand - (fun p -> - { p with - TimeOut = TimeSpan.FromMinutes 10. }) - (sprintf "nuget push %s --api-key %s --source %s" project apiKey source) - - projects |> Seq.iter (runSingleProject) + let shouldPushNugetPackages = hasBuildParam "nugetkey" + if not shouldPushNugetPackages then () + else + let apiKey = getBuildParam "nugetkey" + let sourceUrl = getBuildParamOrDefault "nugetpublishurl" "https://api.nuget.org/v3/index.json" + + let rec publishPackage retryLeft packageFile = + tracefn "Pushing %s Attempts left: %d" (FullName packageFile) retryLeft + let tracing = ProcessHelper.enableProcessTracing + try + try + ProcessHelper.enableProcessTracing <- false + DotNetCli.RunCommand + (fun p -> + { p with + TimeOut = TimeSpan.FromMinutes 10. }) + (sprintf "nuget push %s --api-key %s --source %s --no-service-endpoint" packageFile apiKey sourceUrl) + with exn -> + if (retryLeft > 0) then (publishPackage (retryLeft-1) packageFile) + finally + ProcessHelper.enableProcessTracing <- tracing + + printfn "Pushing nuget packages" + let normalPackages = !! (outputNuGet @@ "*.nupkg") |> Seq.sortBy(fun x -> x.ToLower()) + for package in normalPackages do + publishPackage 3 package ) //-------------------------------------------------------------------------------- @@ -194,12 +232,15 @@ Target "Help" <| fun _ -> Target "BuildRelease" DoNothing Target "All" DoNothing Target "Nuget" DoNothing +Target "RunTestsFull" DoNothing +Target "RunTestsNetFull" DoNothing // build dependencies "Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease" // tests dependencies "Build" ==> "RunTests" +"Build" ==> "RunTestsNet" // nuget dependencies "Clean" ==> "Build" ==> "CreateNuget" @@ -211,6 +252,7 @@ Target "Nuget" DoNothing // all "BuildRelease" ==> "All" "RunTests" ==> "All" +"RunTestsNet" ==> "All" "Nuget" ==> "All" RunTargetOrDefault "Help" \ No newline at end of file diff --git a/docs/images/icon.png b/docs/images/icon.png new file mode 100644 index 0000000..c0f0ca9 Binary files /dev/null and b/docs/images/icon.png differ diff --git a/src/Akka.Quartz.Actor.IntegrationTests/Akka.Quartz.Actor.IntegrationTests.csproj b/src/Akka.Quartz.Actor.IntegrationTests/Akka.Quartz.Actor.IntegrationTests.csproj index e67a5a3..3b17c69 100644 --- a/src/Akka.Quartz.Actor.IntegrationTests/Akka.Quartz.Actor.IntegrationTests.csproj +++ b/src/Akka.Quartz.Actor.IntegrationTests/Akka.Quartz.Actor.IntegrationTests.csproj @@ -1,28 +1,15 @@ - - net472 + $(NetFrameworkTestVersion);$(NetTestVersion) - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -30,13 +17,7 @@ - - - - - {80e909a0-2379-408d-9711-70d1bf3147a2} - Akka.Quartz.Actor - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Akka.Quartz.Actor.IntegrationTests/QuartzPersistentActorIntegration.cs b/src/Akka.Quartz.Actor.IntegrationTests/QuartzPersistentActorIntegration.cs index 7925220..45340f5 100644 --- a/src/Akka.Quartz.Actor.IntegrationTests/QuartzPersistentActorIntegration.cs +++ b/src/Akka.Quartz.Actor.IntegrationTests/QuartzPersistentActorIntegration.cs @@ -6,18 +6,25 @@ using Akka.Quartz.Actor.Events; using Quartz; using Xunit; -using System.Data.SQLite; using System.IO; using Microsoft.Data.Sqlite; using System.Collections.Specialized; using Quartz.Impl.AdoJobStore.Common; using System.Data; using Quartz.Impl; +using Xunit.Abstractions; namespace Akka.Quartz.Actor.IntegrationTests { public class QuartzPersistentActorIntegration : TestKit.Xunit2.TestKit, IClassFixture { + private SqliteFixture _fixture; + public QuartzPersistentActorIntegration(ITestOutputHelper output, SqliteFixture fixture) + : base(nameof(QuartzPersistentActorIntegration), output) + { + _fixture = fixture; + } + [Fact] public async Task QuartzPersistentActor_DB_Should_Create_Job() { @@ -61,7 +68,7 @@ public async Task QuartzPersistentActor_DB_Should_Create_Job() Sys.Stop(quartzActor); } - private class SqliteFixture : IDisposable + public class SqliteFixture : IDisposable { private const string DatabaseFileName = "quartz-jobs.db"; @@ -72,12 +79,11 @@ public SqliteFixture() File.Delete(DatabaseFileName); } - SQLiteConnection.CreateFile(DatabaseFileName); - string script = File.ReadAllText("tables_sqlite.sql"); + var script = File.ReadAllText("tables_sqlite.sql"); - using (SQLiteConnection dbConnection = new SQLiteConnection($"Data Source={DatabaseFileName};Version=3;")) + using (var dbConnection = new SqliteConnection($"Data Source={DatabaseFileName};")) { - using (SQLiteCommand command = new SQLiteCommand(script, dbConnection)) + using (var command = new SqliteCommand(script, dbConnection)) { dbConnection.Open(); command.ExecuteNonQuery(); diff --git a/src/Akka.Quartz.Actor.Tests/Akka.Quartz.Actor.Tests.csproj b/src/Akka.Quartz.Actor.Tests/Akka.Quartz.Actor.Tests.csproj index fea6184..96274fa 100644 --- a/src/Akka.Quartz.Actor.Tests/Akka.Quartz.Actor.Tests.csproj +++ b/src/Akka.Quartz.Actor.Tests/Akka.Quartz.Actor.Tests.csproj @@ -1,16 +1,12 @@ - - - net471;netcoreapp3.1 + $(NetFrameworkTestVersion);$(NetTestVersion) - - - - - - + + + + diff --git a/src/Akka.Quartz.Actor.Tests/app.config b/src/Akka.Quartz.Actor.Tests/app.config deleted file mode 100644 index 9a44dcc..0000000 --- a/src/Akka.Quartz.Actor.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/Akka.Quartz.Actor/Akka.Quartz.Actor.csproj b/src/Akka.Quartz.Actor/Akka.Quartz.Actor.csproj index 401e4b9..0e57aa1 100644 --- a/src/Akka.Quartz.Actor/Akka.Quartz.Actor.csproj +++ b/src/Akka.Quartz.Actor/Akka.Quartz.Actor.csproj @@ -1,11 +1,16 @@  - - netstandard2.0 + $(NetStandardLibVersion) false + icon.png + README.md - - + + + + + + \ No newline at end of file diff --git a/src/Akka.Quartz.Actor/Akka.Quartz.Actor.nuspec b/src/Akka.Quartz.Actor/Akka.Quartz.Actor.nuspec deleted file mode 100644 index df6238a..0000000 --- a/src/Akka.Quartz.Actor/Akka.Quartz.Actor.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - @project@ - @project@@title@ - @build.number@ - @authors@ - @authors@ - Quartz integration plugin for Akka.NET. - https://github.com/akkadotnet/Akka.Quartz.Actor/blob/master/LICENSE - https://github.com/akkadotnet/Akka.Quartz.Actor - http://getakka.net/images/AkkaNetLogo.Normal.png - false - @releaseNotes@ - @copyright@ - @tags@ - @dependencies@ - @references@ - - \ No newline at end of file diff --git a/src/Akka.Quartz.Actor/app.config b/src/Akka.Quartz.Actor/app.config deleted file mode 100644 index 3faa4b2..0000000 --- a/src/Akka.Quartz.Actor/app.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..587974f --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,31 @@ + + + + Copyright © 2015-2021 .NET Foundation + Akka + $(NoWarn);CS1591 + + + + net472 + netstandard2.0 + net6.0 + + + + + + + + + true + + true + + true + snupkg + akka;streams;quartz + https://github.com/akkadotnet/Akka.Quartz.Actor + Apache-2.0 + + \ No newline at end of file diff --git a/src/Directory.Generated.props b/src/Directory.Generated.props new file mode 100644 index 0000000..45d5f08 --- /dev/null +++ b/src/Directory.Generated.props @@ -0,0 +1,8 @@ + + + 1.5.12 + [Update Akka.NET to v1.5.12](https://github.com/akkadotnet/akka.net/releases/tag/1.5.12) +[Fix persisted job serialization to always serialize using object serializer](https://github.com/akkadotnet/Akka.Quartz.Actor/pull/312) +Upgraded all other dependencies + + \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 0000000..8d81d5f --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,29 @@ + + + true + 1.5.12 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/common.props b/src/common.props deleted file mode 100644 index a2e2f8c..0000000 --- a/src/common.props +++ /dev/null @@ -1,22 +0,0 @@ - - - Copyright © 2015-2021 .NET Foundation - Akka - 1.5.1 - Updated Akka to 1.5.1 -upgraded to Quartz.NET 3.6.2 - http://getakka.net/images/akkalogo.png - https://github.com/akkadotnet/Akka.Quartz.Actor - https://github.com/akkadotnet/Akka.Quartz.Actor/blob/master/LICENSE - akka streams quartz - - - - - 1.5.12 - 3.7.0 - 2.5.0 - 2.5.0 - 17.7.2 - - \ No newline at end of file