Skip to content
Merged
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
24 changes: 12 additions & 12 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
:versions:
- 17.3.0
- 17.3.1
:when: 2022-08-16 21:39:37.382080790 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks
- :who: mocsharp
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.8
- 6.0.9
:when: 2022-08-29 18:11:22.090772006 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions
- :who: mocsharp
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.8
- 6.0.9
:when: 2022-08-29 18:11:22.090772006 Z
- - :approve
- Microsoft.Extensions.Configuration
Expand Down Expand Up @@ -158,7 +158,7 @@
- :who: mocsharp
:why: MIT (https://github.com/dotnet/runtime/raw/main/LICENSE.TXT)
:versions:
- 6.0.1
- 6.0.2
:when: 2022-08-16 21:39:44.471693654 Z
- - :approve
- Microsoft.Extensions.Logging.Configuration
Expand Down Expand Up @@ -219,9 +219,9 @@
- - :approve
- Microsoft.NET.Test.Sdk
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE)
:versions:
- 17.3.0
- 17.3.1
:when: 2022-08-16 21:39:48.253593534 Z
- - :approve
- Microsoft.NETCore.Platforms
Expand All @@ -240,16 +240,16 @@
- - :approve
- Microsoft.TestPlatform.ObjectModel
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE)
:versions:
- 17.3.0
- 17.3.1
:when: 2022-08-16 21:39:49.547958989 Z
- - :approve
- Microsoft.TestPlatform.TestHost
- :who: mocsharp
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE)
:versions:
- 17.3.0
- 17.3.1
:when: 2022-08-16 21:39:49.963749572 Z
- - :approve
- Microsoft.Win32.Primitives
Expand Down Expand Up @@ -410,14 +410,14 @@
- :who: mocsharp
:why: MIT (https://github.com/TestableIO/System.IO.Abstractions/raw/main/LICENSE)
:versions:
- 17.1.1
- 17.2.3
:when: 2022-08-16 21:39:59.728481602 Z
- - :approve
- System.IO.Abstractions.TestingHelpers
- :who: mocsharp
:why: MIT (https://github.com/TestableIO/System.IO.Abstractions/raw/main/LICENSE)
:versions:
- 17.1.1
- 17.2.3
:when: 2022-08-16 21:40:00.150566731 Z
- - :approve
- System.IO.Compression
Expand Down
2 changes: 1 addition & 1 deletion src/Messaging/Events/TaskCallbackEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class TaskCallbackEvent : EventBase
/// Gets or sets the identity provided by the external service.
/// </summary>
[JsonProperty(PropertyName = "identity")]
[Required, MaxLength(63)]
[Required]
public string Identity { get; set; }

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/Monai.Deploy.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@
<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.8" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="17.1.1" />
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/Messaging/Tests/Monai.Deploy.Messaging.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.1.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.2.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 0 additions & 3 deletions src/Messaging/Tests/TaskCallbackEventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public void ValidationThrowsOnError()
runnerComplete.CorrelationId = Guid.NewGuid().ToString();
Assert.Throws<MessageValidationException>(() => runnerComplete.Validate());

runnerComplete.Identity = "1234567890123456789012345678901234567890123456789012345678901234567890";
Assert.Throws<MessageValidationException>(() => runnerComplete.Validate());

runnerComplete.Identity = "123456789012345678901234567890123456789012345678901234567890123";
var exception = Record.Exception(() => runnerComplete.Validate());
Assert.Null(exception);
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/RabbitMQ/RabbitMQHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public RabbitMQHealthCheck(
{
try
{
_ = _connectionFactory.CreateChannel(
using var channel = _connectionFactory.CreateChannel(
_options[ConfigurationKeys.EndPoint],
_options[ConfigurationKeys.Username],
_options[ConfigurationKeys.Password],
_options[ConfigurationKeys.VirtualHost],
_options.ContainsKey(ConfigurationKeys.UseSSL) ? _options[ConfigurationKeys.UseSSL] : string.Empty,
_options.ContainsKey(ConfigurationKeys.Port) ? _options[ConfigurationKeys.Port] : string.Empty);

channel.Close();
return await Task.FromResult(HealthCheckResult.Healthy()).ConfigureAwait(false);
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.1.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.2.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
8 changes: 7 additions & 1 deletion src/Plugins/RabbitMQ/Tests/RabbitMQHealthCheckTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Moq;
using RabbitMQ.Client;
using Xunit;

namespace Monai.Deploy.Messaging.RabbitMQ.Tests
Expand Down Expand Up @@ -55,12 +56,17 @@ public async Task CheckHealthAsync_WhenFailedToListBucket_ReturnUnhealthy()
[Fact]
public async Task CheckHealthAsync_WhenListBucketSucceeds_ReturnHealthy()
{
_connectionFactory.Setup(p => p.CreateChannel(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()));
var channel = new Mock<IModel>();
channel.Setup(p => p.Close());
_connectionFactory.Setup(p => p.CreateChannel(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()))
.Returns(channel.Object);
var healthCheck = new RabbitMQHealthCheck(_connectionFactory.Object, _options, _logger.Object, (d) => { });
var results = await healthCheck.CheckHealthAsync(new HealthCheckContext()).ConfigureAwait(false);

Assert.Equal(HealthStatus.Healthy, results.Status);
Assert.Null(results.Exception);

channel.Verify(p => p.Close(), Times.Once());
}
}
}
Loading