diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 864260862d..0e4ab09c2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,10 @@ name: Build # Run this workflow every time a new commit pushed to your repository -on: push +on: + push: + schedule: + - cron: '0 1 * * *' env: DOTNET_NOLOGO: 1 @@ -72,7 +75,6 @@ jobs: files: ./db-ui.lcov ./db-core.lcov flag-name: unit tests - tests_file_system: name: Run File System Tests runs-on: windows-latest diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/RemoteDatabaseAttacherTests.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/RemoteDatabaseAttacherTests.cs index 3b48e2085f..884fcbd9d6 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/RemoteDatabaseAttacherTests.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/RemoteDatabaseAttacherTests.cs @@ -213,13 +213,13 @@ public void TestRemoteDatabaseAttacherWithDateFilter(DatabaseType dbType, Scenar if (duration == AttacherHistoricalDurations.Custom) { - attacher.CustomFetchDurationStartDate = DateTime.Now.AddDays(-7); - attacher.CustomFetchDurationEndDate = DateTime.Now; + attacher.CustomFetchDurationStartDate = DateTime.UtcNow.AddDays(-7); + attacher.CustomFetchDurationEndDate = DateTime.UtcNow; } if (duration == AttacherHistoricalDurations.DeltaReading) { - attacher.DeltaReadingStartDate = DateTime.Now.AddDays(-7); + attacher.DeltaReadingStartDate = DateTime.UtcNow.AddDays(-7); attacher.DeltaReadingLookBackDays = 0; attacher.DeltaReadingLookForwardDays = 5; } @@ -236,7 +236,7 @@ public void TestRemoteDatabaseAttacherWithDateFilter(DatabaseType dbType, Scenar if (duration == AttacherHistoricalDurations.SinceLastUse) { - job.LoadMetadata.LastLoadTime = DateTime.Now.AddDays(-1);// last used yesterday + job.LoadMetadata.LastLoadTime = DateTime.UtcNow.AddDays(-1);// last used yesterday job.LoadMetadata.SaveToDatabase(); } if (scenario == Scenario.MissingPreLoadDiscardedColumn) diff --git a/Rdmp.Core.Tests/DataLoad/Modules/Attachers/RemoteTableAttacherTests.cs b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/RemoteTableAttacherTests.cs index 464982691f..041e5773b0 100644 --- a/Rdmp.Core.Tests/DataLoad/Modules/Attachers/RemoteTableAttacherTests.cs +++ b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/RemoteTableAttacherTests.cs @@ -269,19 +269,19 @@ private static string Within(AttacherHistoricalDurations duration) switch (duration) { case AttacherHistoricalDurations.Past24Hours: - return DateTime.Now.AddHours(-1).ToString(); + return DateTime.UtcNow.AddHours(-1).ToString(); case AttacherHistoricalDurations.Past7Days: - return DateTime.Now.AddHours(-1).ToString(); + return DateTime.UtcNow.AddHours(-1).ToString(); case AttacherHistoricalDurations.PastMonth: - return DateTime.Now.AddHours(-1).ToString(); + return DateTime.UtcNow.AddHours(-1).ToString(); case AttacherHistoricalDurations.PastYear: - return DateTime.Now.AddHours(-1).ToString(); + return DateTime.UtcNow.AddHours(-1).ToString(); case AttacherHistoricalDurations.SinceLastUse: - return DateTime.Now.AddHours(-1).ToString(); + return DateTime.UtcNow.AddHours(-1).ToString(); case AttacherHistoricalDurations.Custom: - return DateTime.Now.AddDays(-1).ToString(); + return DateTime.UtcNow.AddDays(-1).ToString(); case AttacherHistoricalDurations.DeltaReading: - return DateTime.Now.AddDays(-4).ToString(); + return DateTime.UtcNow.AddDays(-4).ToString(); default: return "fail"; } @@ -292,19 +292,19 @@ private static string Outwith(AttacherHistoricalDurations duration) switch (duration) { case AttacherHistoricalDurations.Past24Hours: - return DateTime.Now.AddDays(-2).ToString(); + return DateTime.UtcNow.AddDays(-2).ToString(); case AttacherHistoricalDurations.Past7Days: - return DateTime.Now.AddDays(-8).ToString(); + return DateTime.UtcNow.AddDays(-8).ToString(); case AttacherHistoricalDurations.PastMonth: - return DateTime.Now.AddMonths(-2).ToString(); + return DateTime.UtcNow.AddMonths(-2).ToString(); case AttacherHistoricalDurations.PastYear: - return DateTime.Now.AddYears(-2).ToString(); + return DateTime.UtcNow.AddYears(-2).ToString(); case AttacherHistoricalDurations.SinceLastUse: - return DateTime.Now.AddDays(-2).ToString(); + return DateTime.UtcNow.AddDays(-2).ToString(); case AttacherHistoricalDurations.Custom: - return DateTime.Now.AddDays(-14).ToString(); + return DateTime.UtcNow.AddDays(-14).ToString(); case AttacherHistoricalDurations.DeltaReading: - return DateTime.Now.AddDays(-10).ToString(); + return DateTime.UtcNow.AddDays(-10).ToString(); default: return "fail"; } @@ -351,17 +351,17 @@ private void RunAttachStageWithFilterJob(RemoteTableAttacher attacher, Discovere job.StartLogging(); if (duration == AttacherHistoricalDurations.SinceLastUse) { - job.LoadMetadata.LastLoadTime = DateTime.Now.AddDays(-1);// last used yesterday + job.LoadMetadata.LastLoadTime = DateTime.UtcNow.AddDays(-1);// last used yesterday job.LoadMetadata.SaveToDatabase(); } if (duration == AttacherHistoricalDurations.Custom) { - attacher.CustomFetchDurationStartDate = DateTime.Now.AddDays(-7); - attacher.CustomFetchDurationEndDate = DateTime.Now; + attacher.CustomFetchDurationStartDate = DateTime.UtcNow.AddDays(-7); + attacher.CustomFetchDurationEndDate = DateTime.UtcNow; } if (duration == AttacherHistoricalDurations.DeltaReading) { - attacher.DeltaReadingStartDate = DateTime.Now.AddDays(-7); + attacher.DeltaReadingStartDate = DateTime.UtcNow.AddDays(-7); attacher.DeltaReadingLookBackDays = 0; attacher.DeltaReadingLookForwardDays = 5; }