From 6f75f4dcdc0e3719e02a44eadcb32f609dde6bd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:58:40 +0000 Subject: [PATCH 1/8] Bump SixLabors.ImageSharp from 3.1.5 to 3.1.6 Bumps [SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp) from 3.1.5 to 3.1.6. - [Release notes](https://github.com/SixLabors/ImageSharp/releases) - [Commits](https://github.com/SixLabors/ImageSharp/compare/v3.1.5...v3.1.6) --- updated-dependencies: - dependency-name: SixLabors.ImageSharp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a935acbb08..de25eb240f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 1659f8ce12199fc36a52c3446089c15240a76b7b Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 10:30:28 -0600 Subject: [PATCH 2/8] Update UnitTests.cs Mute WhenIHaveAll, reduce visibility --- Tests.Common/UnitTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests.Common/UnitTests.cs b/Tests.Common/UnitTests.cs index d0f45c5724..d9259774cb 100644 --- a/Tests.Common/UnitTests.cs +++ b/Tests.Common/UnitTests.cs @@ -775,7 +775,7 @@ private static bool AreAboutTheSameTime(DateTime memValue, DateTime dbValue) => /// Returns instances of all Types supported by /// /// - public IEnumerable WhenIHaveAll() + protected IEnumerable WhenIHaveAll() { var methodWhenIHaveA = GetWhenIHaveAMethod(); var repo = new object[] { Repository }; @@ -786,7 +786,6 @@ public IEnumerable WhenIHaveAll() foreach (var t in types) { - Console.Error.WriteLine("WhenIHaveAll: {0}", t.Name); //ensure that the method supports the Type yield return (DatabaseEntity)methodWhenIHaveA.MakeGenericMethod(t).Invoke(this, repo); } From 92669673bcb21b7954b0864838428a4f566e363f Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 10:31:13 -0600 Subject: [PATCH 3/8] Update QueryCachingCrossServerTests.cs Fixup for NUnit text output API change --- Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs b/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs index 7ad3646bc9..955e6c357d 100644 --- a/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs +++ b/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs @@ -818,12 +818,12 @@ private static void AssertNoErrors(CohortCompiler compiler) { Assert.That(compiler.Tasks, Is.Not.Empty); - TestContext.WriteLine("| Task | Type | State | Error | RowCount | CacheUse |"); + TestContext.Out.WriteLine("| Task | Type | State | Error | RowCount | CacheUse |"); var i = 0; foreach (var kvp in compiler.Tasks.Keys) - TestContext.WriteLine( + TestContext.Out.WriteLine( $"{i++} - {kvp.ToString()} | {kvp.GetType()} | {kvp.State} | {kvp.CrashMessage} | {kvp.FinalRowCount} | {kvp.GetCachedQueryUseCount()}"); Assert.That(compiler.Tasks.All(static t => t.Key.State == CompilationState.Finished), From ad0f9b068c51b1be5e9aed5f6f5689aa11d68946 Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 10:44:10 -0600 Subject: [PATCH 4/8] Clean up S3 unit tests --- HIC.DataManagementPlatform.sln.DotSettings | 1 + .../AWSS3BucketReleaseDestinationTests.cs | 742 +++++++++--------- 2 files changed, 367 insertions(+), 376 deletions(-) diff --git a/HIC.DataManagementPlatform.sln.DotSettings b/HIC.DataManagementPlatform.sln.DotSettings index 2eba2c8d40..414a637367 100644 --- a/HIC.DataManagementPlatform.sln.DotSettings +++ b/HIC.DataManagementPlatform.sln.DotSettings @@ -2,6 +2,7 @@ True True ANO + AWS CTS DISTINCT DQE diff --git a/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs b/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs index 76ce4a64cf..f92f3b778f 100644 --- a/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs @@ -1,7 +1,6 @@ using NUnit.Framework; using Minio; using Rdmp.Core.ReusableLibraryCode.AWS; -using System.Threading.Tasks; using Tests.Common.Scenarios; using Rdmp.Core.DataFlowPipeline; using Rdmp.Core.ReusableLibraryCode.Progress; @@ -17,398 +16,389 @@ using System.Collections.Generic; using Minio.DataModel; -namespace Rdmp.Core.Tests.DataExport.DataRelease +namespace Rdmp.Core.Tests.DataExport.DataRelease; + +public class S3BucketReleaseDestinationTests : TestsRequiringAnExtractionConfiguration { - public class AWSS3BucketReleaseDestinationTests : TestsRequiringAnExtractionConfiguration + private const string Username = "minioadmin"; + private const string Password = "minioadmin"; + private const string Endpoint = "127.0.0.1:9000"; + private static IMinioClient _minioClient; + + + [OneTimeTearDown] + public void OneTimeTearDown() { - private readonly string APILocation = "http://172.17.0.2:9000 "; - private readonly string username = "minioadmin"; - private readonly string password = "minioadmin"; - private readonly string endpoint = "127.0.0.1:9000"; - private static IMinioClient _minioClient; + _minioClient?.Dispose(); + } + [OneTimeSetUp] + public new void OneTimeSetUp() + { + base.OneTimeSetUp(); + _minioClient = new MinioClient() + .WithEndpoint(Endpoint) + .WithCredentials(Username, Password) + .WithSSL(false) + .Build(); + } - [TearDown] - public void TearDown() - { - if (_minioClient is not null) - _minioClient.Dispose(); - } + private void DoExtraction() + { + base.SetUp(); + Execute(out _, out _, ThrowImmediatelyDataLoadEventListener.Quiet); + } - [SetUp] - public void Setup() - { - _minioClient = new MinioClient() - .WithEndpoint(endpoint) - .WithCredentials(username, password) - .WithSSL(false) - .Build(); - } - - private void DoExtraction() - { - base.SetUp(); - base.Execute(out var usecase, out var results, ThrowImmediatelyDataLoadEventListener.Quiet); - } + private static void MakeBucket(string name) + { + var mbArgs = new MakeBucketArgs() + .WithBucket(name); + _minioClient.MakeBucketAsync(mbArgs).Wait(); + } - private void MakeBucket(string name) - { - var mbArgs = new MakeBucketArgs() - .WithBucket(name); - Task.Run(async () => await _minioClient.MakeBucketAsync(mbArgs)).Wait(); - } + private static void DeleteBucket(string name) + { + var rbArgs = new RemoveBucketArgs() + .WithBucket(name); + _minioClient.RemoveBucketAsync(rbArgs).Wait(); + } - private void DeleteBucket(string name) - { - var rbArgs = new RemoveBucketArgs() - .WithBucket(name); - Task.Run(async () => await _minioClient.RemoveBucketAsync(rbArgs)).Wait(); - } + private static List GetObjects(string bucketName) + { + var loArgs = new ListObjectsArgs().WithBucket(bucketName); + var x = _minioClient.ListObjectsEnumAsync(loArgs).ToListAsync(); + return x.IsCompleted ? x.Result : x.AsTask().Result; + } - private static List GetObjects(string bucketName) - { - var loArgs = new ListObjectsArgs().WithBucket(bucketName); - var x = _minioClient.ListObjectsEnumAsync(loArgs); - return Task.Run(async () => await x.ToListAsync()).Result; - } + [Test] + public void AWSLoginTest() + { + var awss3 = new AWSS3("minio", Amazon.RegionEndpoint.EUWest2); + Assert.That(awss3.ListAvailableBuckets().Result, Is.Empty); + } - [Test] - public void AWSLoginTest() + [Test] + public void ReleaseToAWSBasicTest() + { + MakeBucket("releasetoawsbasictest"); + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe1"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - var awss3 = new AWSS3("minio", Amazon.RegionEndpoint.EUWest2); - Assert.That(Task.Run(async () => await awss3.ListAvailableBuckets()).Result.Count, Is.EqualTo(0)); - } + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString() + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.DoesNotThrow(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + var foundObjects = GetObjects("releasetoawsbasictest"); + Assert.That(foundObjects, Has.Count.EqualTo(1)); + DeleteBucket("releasetoawsbasictest"); + } - [Test] - public void ReleaseToAWSBasicTest() + [Test] + public void NoRegion() + { + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe2"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - MakeBucket("releasetoawsbasictest"); - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe1"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString() - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.DoesNotThrow(()=>runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - var foundObjects = GetObjects("releasetoawsbasictest"); - Assert.That(foundObjects.Count, Is.EqualTo(1)); - DeleteBucket("releasetoawsbasictest"); - } - - [Test] - public void NoRegion() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + } + + [Test] + public void NoProfile() + { + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe3"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe2"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - - } - - [Test] - public void NoProfile() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + } + + [Test] + public void BadProfile() + { + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe4"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("junk-profile"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe3"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - - } - - [Test] - public void BadProfile() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + } + + + [Test] + public void NoBucket() + { + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe5"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe4"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("junk-profile"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - - } - - - [Test] - public void NoBucket() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + } + + [Test] + public void BadBucket() + { + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe6"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("doesNotExist"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe5"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - - } - - [Test] - public void BadBucket() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + } + + + [Test] + public void LocationAlreadyExists() + { + MakeBucket("releasetoawsbasictest"); + + DoExtraction(); + var pipe = new Pipeline(CatalogueRepository, "NestedPipe7"); + var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + var args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + var match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + var optsRelease = new ReleaseOptions { - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe6"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("doesNotExist"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - - } - - - [Test] - public void LocationAlreadyExists() + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString() + }; + var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.DoesNotThrow(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + var foundObjects = GetObjects("releasetoawsbasictest"); + Assert.That(foundObjects, Has.Count.EqualTo(1)); + DoExtraction(); + pipe = new Pipeline(CatalogueRepository, "NestedPipe8"); + pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, + "AWS S3 Release"); + pc.SaveToDatabase(); + + args = pc.CreateArgumentsForClassIfNotExists(); + + Assert.That(pc.GetAllArguments().Any()); + + match = args.Single(static a => a.Name == "AWS_Profile"); + match.SetValue("minio"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketName"); + match.SetValue("releasetoawsbasictest"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "AWS_Region"); + match.SetValue("eu-west-2"); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); + match.SetValue(false); + match.SaveToDatabase(); + match = args.Single(static a => a.Name == "BucketFolder"); + match.SetValue("release"); + match.SaveToDatabase(); + + pipe.DestinationPipelineComponent_ID = pc.ID; + pipe.SaveToDatabase(); + optsRelease = new ReleaseOptions { - MakeBucket("releasetoawsbasictest"); - - DoExtraction(); - var pipe = new Pipeline(CatalogueRepository, "NestedPipe7"); - var pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - var args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - var optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString() - }; - var runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.DoesNotThrow(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - var foundObjects = GetObjects("releasetoawsbasictest"); - Assert.That(foundObjects.Count, Is.EqualTo(1)); - DoExtraction(); - pipe = new Pipeline(CatalogueRepository, "NestedPipe8"); - pc = new PipelineComponent(CatalogueRepository, pipe, typeof(AWSS3BucketReleaseDestination), -1, - "AWS S3 Release"); - pc.SaveToDatabase(); - - args = pc.CreateArgumentsForClassIfNotExists(); - - Assert.That(pc.GetAllArguments().Any()); - - match = args.Single(a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); - - pipe.DestinationPipelineComponent_ID = pc.ID; - pipe.SaveToDatabase(); - optsRelease = new ReleaseOptions - { - Configurations = _configuration.ID.ToString(), - Pipeline = pipe.ID.ToString(), - Command = CommandLineActivity.check - - }; - runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); - Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); - foundObjects = GetObjects("releasetoawsbasictest"); - Assert.That(foundObjects.Count, Is.EqualTo(1)); - DeleteBucket("releasetoawsbasictest"); - } - + Configurations = _configuration.ID.ToString(), + Pipeline = pipe.ID.ToString(), + Command = CommandLineActivity.check + }; + runner = new ReleaseRunner(new ThrowImmediatelyActivator(RepositoryLocator), optsRelease); + Assert.Throws(() => runner.Run(RepositoryLocator, ThrowImmediatelyDataLoadEventListener.Quiet, ThrowImmediatelyCheckNotifier.Quiet, new GracefulCancellationToken())); + foundObjects = GetObjects("releasetoawsbasictest"); + Assert.That(foundObjects, Has.Count.EqualTo(1)); + DeleteBucket("releasetoawsbasictest"); } -} +} \ No newline at end of file From 006fd7c5f6ddc6fa12bd2fc422df0e6b30fc019a Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 11:05:54 -0600 Subject: [PATCH 5/8] Tidy param init for S3 tests --- ....cs => S3BucketReleaseDestinationTests.cs} | 191 +++++++----------- 1 file changed, 75 insertions(+), 116 deletions(-) rename Rdmp.Core.Tests/DataExport/DataRelease/{AWSS3BucketReleaseDestinationTests.cs => S3BucketReleaseDestinationTests.cs} (67%) diff --git a/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs similarity index 67% rename from Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs rename to Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs index f92f3b778f..e46cda09b6 100644 --- a/Rdmp.Core.Tests/DataExport/DataRelease/AWSS3BucketReleaseDestinationTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs @@ -15,10 +15,12 @@ using Minio.DataModel.Args; using System.Collections.Generic; using Minio.DataModel; +using Rdmp.Core.Curation.Data.DataLoad; +using Amazon.Runtime.Internal.Transform; namespace Rdmp.Core.Tests.DataExport.DataRelease; -public class S3BucketReleaseDestinationTests : TestsRequiringAnExtractionConfiguration +public sealed class S3BucketReleaseDestinationTests : TestsRequiringAnExtractionConfiguration { private const string Username = "minioadmin"; private const string Password = "minioadmin"; @@ -45,7 +47,7 @@ public void OneTimeTearDown() private void DoExtraction() { - base.SetUp(); + SetUp(); Execute(out _, out _, ThrowImmediatelyDataLoadEventListener.Quiet); } @@ -70,6 +72,16 @@ private static List GetObjects(string bucketName) return x.IsCompleted ? x.Result : x.AsTask().Result; } + private static void SetArgs(IArgument[] args, Dictionary values) + { + foreach (var x in args) + { + if (!values.TryGetValue(x.Name, out var value) || x.GetValueAsSystemType().Equals(value)) continue; + + x.SetValue(value); + x.SaveToDatabase(); + } + } [Test] public void AWSLoginTest() @@ -92,21 +104,14 @@ public void ReleaseToAWSBasicTest() Assert.That(pc.GetAllArguments().Any()); - var match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Profile", "minio" }, + { "BucketName", "releasetoawsbasictest" }, + { "AWS_Region", "eu-west-2" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -135,18 +140,13 @@ public void NoRegion() Assert.That(pc.GetAllArguments().Any()); - var match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Profile", "minio" }, + { "BucketName", "releasetoawsbasictest" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -173,18 +173,13 @@ public void NoProfile() Assert.That(pc.GetAllArguments().Any()); - var match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "BucketName", "releasetoawsbasictest" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -211,20 +206,14 @@ public void BadProfile() Assert.That(pc.GetAllArguments().Any()); - var match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("junk-profile"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "AWS_Profile", "junk-profile" }, + { "BucketName", "releasetoawsbasictest" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -251,19 +240,13 @@ public void NoBucket() var args = pc.CreateArgumentsForClassIfNotExists(); Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "AWS_Profile", "minio" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -289,22 +272,14 @@ public void BadBucket() var args = pc.CreateArgumentsForClassIfNotExists(); Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("doesNotExist"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "AWS_Profile", "minio" }, + { "BucketName", "doesNotExist" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -333,22 +308,14 @@ public void LocationAlreadyExists() var args = pc.CreateArgumentsForClassIfNotExists(); Assert.That(pc.GetAllArguments().Any()); - - var match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "AWS_Profile", "minio" }, + { "BucketName", "doesNotExist" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); @@ -370,22 +337,14 @@ public void LocationAlreadyExists() args = pc.CreateArgumentsForClassIfNotExists(); Assert.That(pc.GetAllArguments().Any()); - - match = args.Single(static a => a.Name == "AWS_Profile"); - match.SetValue("minio"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketName"); - match.SetValue("releasetoawsbasictest"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "AWS_Region"); - match.SetValue("eu-west-2"); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "ConfigureInteractivelyOnRelease"); - match.SetValue(false); - match.SaveToDatabase(); - match = args.Single(static a => a.Name == "BucketFolder"); - match.SetValue("release"); - match.SaveToDatabase(); + SetArgs(args, new Dictionary + { + { "AWS_Region", "eu-west-2" }, + { "AWS_Profile", "minio" }, + { "BucketName", "releasetoawsbasictest" }, + { "ConfigureInteractivelyOnRelease", false }, + { "BucketFolder", "release" } + }); pipe.DestinationPipelineComponent_ID = pc.ID; pipe.SaveToDatabase(); From dd4fdc21624284a0d8ba010544857c34b6852105 Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 11:26:21 -0600 Subject: [PATCH 6/8] Update S3BucketReleaseDestinationTests.cs Skip calling base onetimesetup --- .../DataExport/DataRelease/S3BucketReleaseDestinationTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs index e46cda09b6..112198ddae 100644 --- a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs @@ -16,7 +16,6 @@ using System.Collections.Generic; using Minio.DataModel; using Rdmp.Core.Curation.Data.DataLoad; -using Amazon.Runtime.Internal.Transform; namespace Rdmp.Core.Tests.DataExport.DataRelease; @@ -37,7 +36,6 @@ public void OneTimeTearDown() [OneTimeSetUp] public new void OneTimeSetUp() { - base.OneTimeSetUp(); _minioClient = new MinioClient() .WithEndpoint(Endpoint) .WithCredentials(Username, Password) From bf8c4ae3bbe820aa0aed4031a9fd8cfe298b5678 Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 11:46:05 -0600 Subject: [PATCH 7/8] Update S3BucketReleaseDestinationTests.cs Handle null existing values --- .../DataExport/DataRelease/S3BucketReleaseDestinationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs index 112198ddae..0321794794 100644 --- a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs @@ -74,7 +74,7 @@ private static void SetArgs(IArgument[] args, Dictionary values) { foreach (var x in args) { - if (!values.TryGetValue(x.Name, out var value) || x.GetValueAsSystemType().Equals(value)) continue; + if (!values.TryGetValue(x.Name, out var value) || x.GetValueAsSystemType()?.Equals(value) == true) continue; x.SetValue(value); x.SaveToDatabase(); From 5ff7bd45e5978495bd85617ec6e72dac0bc9ddc6 Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Thu, 21 Nov 2024 16:34:03 -0600 Subject: [PATCH 8/8] Update S3BucketReleaseDestinationTests.cs Fix up bucket naming --- .../DataExport/DataRelease/S3BucketReleaseDestinationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs index 0321794794..08cab023f4 100644 --- a/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs @@ -310,7 +310,7 @@ public void LocationAlreadyExists() { { "AWS_Region", "eu-west-2" }, { "AWS_Profile", "minio" }, - { "BucketName", "doesNotExist" }, + { "BucketName", "releasetoawsbasictest" }, { "ConfigureInteractivelyOnRelease", false }, { "BucketFolder", "release" } });