Skip to content

Commit

Permalink
Fix buid and unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp committed Sep 8, 2023
1 parent ae3e0d0 commit 415440a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/InformaticsGateway/Logging/Log.500.ExportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static partial class Log
public static partial void FileReadyForExport(this ILogger logger, string file);

[LoggerMessage(EventId = 505, Level = LogLevel.Information, Message = "Export task completed with {failedCount} failures out of {fileCount}. Time to export: {durationMilliseconds}ms.")]
public static partial void ExportCompleted(this ILogger logger, int failedCount, int fileCount, int durationMilliseconds);
public static partial void ExportCompleted(this ILogger logger, int failedCount, int fileCount, double durationMilliseconds);

[LoggerMessage(EventId = 506, Level = LogLevel.Error, Message = "Error downloading payload. Waiting {timeSpan} before next retry. Retry attempt {retryCount}.")]
public static partial void ErrorDownloadingPayloadWithRetry(this ILogger logger, Exception ex, TimeSpan timeSpan, int retryCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Monai.Deploy.InformaticsGateway.Api;
using Monai.Deploy.InformaticsGateway.Api.Rest;
using Monai.Deploy.InformaticsGateway.Api.Storage;
using Monai.Deploy.InformaticsGateway.Common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<Target Name="CopyPluginsBuild" AfterTargets="Build">
<ItemGroup>
<PluginDlls Include="$(OutDir)Monai.Deploy.InformaticsGateway.Test.PlugIns.dll;$(OutDir)Monai.Deploy.InformaticsGateway.Test.dll" />
<PluginDlls Include="$(OutDir)Monai.Deploy.InformaticsGateway.Test.PlugIns.dll;$(OutDir)Monai.Deploy.InformaticsGateway.Test.dll;$(OutDir)Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution.dll;" />
</ItemGroup>
<Copy SourceFiles="@(PluginDlls)" DestinationFolder="$(OutDir)\plug-ins\" SkipUnchangedFiles="true" />
<Message Text="Files copied successfully to $(OutDir)\plug-ins\." Importance="high" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Extensions.Logging;
using Monai.Deploy.InformaticsGateway.Api.PlugIns;
using Monai.Deploy.InformaticsGateway.Common;
using Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution;
using Monai.Deploy.InformaticsGateway.Services.Common;
using Monai.Deploy.InformaticsGateway.SharedTest;
using Monai.Deploy.InformaticsGateway.Test.PlugIns;
Expand Down Expand Up @@ -50,6 +51,7 @@ public void RegisteredPlugIns_WhenCalled_ReturnsListOfPlugIns()
var result = factory.RegisteredPlugIns();

Assert.Collection(result,
p => VerifyPlugIn(p, typeof(DicomReidentifier)),
p => VerifyPlugIn(p, typeof(TestInputDataPlugInAddWorkflow)),
p => VerifyPlugIn(p, typeof(TestInputDataPlugInResumeWorkflow)),
p => VerifyPlugIn(p, typeof(TestInputDataPlugInModifyDicomFile)),
Expand All @@ -59,6 +61,7 @@ public void RegisteredPlugIns_WhenCalled_ReturnsListOfPlugIns()
_logger.VerifyLogging($"{typeof(IInputDataPlugIn).Name} data plug-in found {typeof(TestInputDataPlugInResumeWorkflow).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(TestInputDataPlugInResumeWorkflow).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugIn).Name} data plug-in found {typeof(TestInputDataPlugInModifyDicomFile).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(TestInputDataPlugInModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugIn).Name} data plug-in found {typeof(TestInputDataPlugInVirtualAE).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(TestInputDataPlugInVirtualAE).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IInputDataPlugIn).Name} data plug-in found {typeof(DicomReidentifier).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(DicomReidentifier).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
}

private void VerifyPlugIn(KeyValuePair<string, string> values, Type type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Extensions.Logging;
using Monai.Deploy.InformaticsGateway.Api.PlugIns;
using Monai.Deploy.InformaticsGateway.Common;
using Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution;
using Monai.Deploy.InformaticsGateway.Services.Common;
using Monai.Deploy.InformaticsGateway.SharedTest;
using Monai.Deploy.InformaticsGateway.Test.PlugIns;
Expand Down Expand Up @@ -50,12 +51,14 @@ public void RegisteredPlugIns_WhenCalled_ReturnsListOfPlugIns()
var result = factory.RegisteredPlugIns();

Assert.Collection(result,
p => VerifyPlugIn(p, typeof(DicomDeidentifier)),
p => VerifyPlugIn(p, typeof(TestOutputDataPlugInAddMessage)),
p => VerifyPlugIn(p, typeof(TestOutputDataPlugInModifyDicomFile))
);

_logger.VerifyLogging($"{typeof(IOutputDataPlugIn).Name} data plug-in found {typeof(TestOutputDataPlugInAddMessage).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(TestOutputDataPlugInAddMessage).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IOutputDataPlugIn).Name} data plug-in found {typeof(TestOutputDataPlugInModifyDicomFile).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(TestOutputDataPlugInModifyDicomFile).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
_logger.VerifyLogging($"{typeof(IOutputDataPlugIn).Name} data plug-in found {typeof(DicomDeidentifier).GetCustomAttribute<PlugInNameAttribute>()?.Name}: {typeof(DicomDeidentifier).GetShortTypeAssemblyName()}.", LogLevel.Information, Times.Once());
}

private void VerifyPlugIn(KeyValuePair<string, string> values, Type type)
Expand Down

0 comments on commit 415440a

Please sign in to comment.