Skip to content

Commit a916408

Browse files
Merge pull request #680 from Particular/dependabot/nuget/NServiceBus-8.1.1
Bump NServiceBus from 8.0.3 to 8.1.1
2 parents e9a6fe1 + c0ff185 commit a916408

File tree

4 files changed

+56
-7
lines changed

4 files changed

+56
-7
lines changed

src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
17-
<PackageReference Include="NServiceBus" Version="8.0.3" />
17+
<PackageReference Include="NServiceBus" Version="8.1.1" />
1818
<PackageReference Include="NServiceBus.Transport.AzureServiceBus" Version="3.2.0" />
1919
</ItemGroup>
2020

@@ -25,6 +25,13 @@
2525
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2626
</ItemGroup>
2727

28+
<ItemGroup>
29+
<!-- Prevent Functions from removing NServiceBus dependencies that it thinks are included "in the box" -->
30+
<FunctionsPreservedDependencies Include="System.Diagnostics.DiagnosticSource.dll" />
31+
<FunctionsPreservedDependencies Include="System.Text.Json.dll" />
32+
<FunctionsPreservedDependencies Include="System.Text.Encodings.Web.dll" />
33+
</ItemGroup>
34+
2835
<ItemGroup>
2936
<None Update="host.json" CopyToOutputDirectory="PreserveNewest" />
3037
<None Update="local.settings.json" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Never" />

src/IntegrationTests.HostV4/When_starting_the_function_host.cs

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
using System;
44
using System.Diagnostics;
55
using System.IO;
6+
using System.Linq;
67
using System.Net.Http;
78
using System.Threading;
89
using System.Threading.Tasks;
910
using Azure.Messaging.ServiceBus.Administration;
11+
using Microsoft.Extensions.Configuration;
1012
using NUnit.Framework;
1113

1214
[TestFixture]
@@ -15,10 +17,50 @@ public class When_starting_the_function_host
1517
[Test]
1618
public async Task Should_not_blow_up()
1719
{
18-
var pathToFuncExe = Environment.GetEnvironmentVariable("PathToFuncExe");
19-
Assert.IsNotNull(pathToFuncExe, "Environment variable 'PathToFuncExe' should be defined to run tests. When running locally this is usually 'C:\\Users\\MyUser\\AppData\\Local\\AzureFunctionsTools\\Releases\\4.30.0\\cli_x64\\func.exe'");
20+
var configBuilder = new ConfigurationBuilder();
21+
configBuilder.SetBasePath(Directory.GetCurrentDirectory());
22+
configBuilder.AddEnvironmentVariables();
23+
configBuilder.AddJsonFile("local.settings.json", true);
2024

21-
var connectionString = Environment.GetEnvironmentVariable("AzureWebJobsServiceBus");
25+
var config = configBuilder.Build();
26+
27+
var pathToFuncExe = config.GetValue<string>("PathToFuncExe");
28+
29+
if (pathToFuncExe == null)
30+
{
31+
Console.WriteLine("Environment variable 'PathToFuncExe' not defined. Going to try to find the latest version.");
32+
33+
var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
34+
var sdkPath = Path.Combine(userProfile, "AppData", "Local", "AzureFunctionsTools", "Releases");
35+
if (Directory.Exists(sdkPath))
36+
{
37+
var mostRecent = Directory.GetDirectories(sdkPath)
38+
.Select(path =>
39+
{
40+
var name = Path.GetFileName(path);
41+
Version.TryParse(name, out var version);
42+
return new { Name = name, Version = version };
43+
})
44+
.Where(x => x.Version is not null)
45+
.OrderByDescending(x => x.Version)
46+
.FirstOrDefault()
47+
?.Name;
48+
49+
if (mostRecent is not null)
50+
{
51+
var exePath = Path.Combine(sdkPath, mostRecent, "cli_x64", "func.exe");
52+
if (File.Exists(exePath))
53+
{
54+
Console.WriteLine("Found " + exePath);
55+
pathToFuncExe = exePath;
56+
}
57+
}
58+
}
59+
}
60+
61+
Assert.IsNotNull(pathToFuncExe, "Environment variable 'PathToFuncExe' should be defined to run tests. When running locally this is usually 'C:\\Users\\<username>\\AppData\\Local\\AzureFunctionsTools\\Releases\\<version>\\cli_x64\\func.exe'");
62+
63+
var connectionString = config.GetValue<string>("AzureWebJobsServiceBus") ?? config.GetValue<string>("Values:AzureWebJobsServiceBus");
2264
Assert.IsNotNull(connectionString, "Environment variable 'AzureWebJobsServiceBus' should be defined to run tests.");
2365

2466
var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(60));

src/ServiceBus.Tests/ServiceBus.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="NServiceBus" Version="8.0.3" />
22+
<PackageReference Include="NServiceBus" Version="8.1.1" />
2323
<PackageReference Include="Particular.Approvals" Version="0.4.1" />
2424
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
2525
</ItemGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="NServiceBus" Version="8.0.3" />
8+
<PackageReference Include="NServiceBus" Version="8.1.1" />
99
</ItemGroup>
1010

1111
</Project>

0 commit comments

Comments
 (0)