From bd3bd7bab582dd473816e6db4e977951c2b64742 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:25:29 +0000 Subject: [PATCH 1/3] Bump NServiceBus from 8.0.3 to 8.1.1 Bumps NServiceBus from 8.0.3 to 8.1.1. --- updated-dependencies: - dependency-name: NServiceBus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj | 2 +- src/ServiceBus.Tests/ServiceBus.Tests.csproj | 2 +- src/Testing.Handlers/Testing.Handlers.csproj | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj index bbd91f9c..cd6e9c20 100644 --- a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj +++ b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/ServiceBus.Tests/ServiceBus.Tests.csproj b/src/ServiceBus.Tests/ServiceBus.Tests.csproj index ad234cdd..dd063a29 100644 --- a/src/ServiceBus.Tests/ServiceBus.Tests.csproj +++ b/src/ServiceBus.Tests/ServiceBus.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Testing.Handlers/Testing.Handlers.csproj b/src/Testing.Handlers/Testing.Handlers.csproj index 5527b962..e392ed6b 100644 --- a/src/Testing.Handlers/Testing.Handlers.csproj +++ b/src/Testing.Handlers/Testing.Handlers.csproj @@ -1,11 +1,11 @@ - + net6.0;net7.0 - + From db6ed87967fb8edce75f7dcc1d4e725dd2ba2f79 Mon Sep 17 00:00:00 2001 From: David Boike Date: Tue, 27 Jun 2023 14:18:42 -0500 Subject: [PATCH 2/3] Make it easier to run the integration test locally --- .../When_starting_the_function_host.cs | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/src/IntegrationTests.HostV4/When_starting_the_function_host.cs b/src/IntegrationTests.HostV4/When_starting_the_function_host.cs index 5a7d4a66..6af4e977 100644 --- a/src/IntegrationTests.HostV4/When_starting_the_function_host.cs +++ b/src/IntegrationTests.HostV4/When_starting_the_function_host.cs @@ -3,10 +3,12 @@ using System; using System.Diagnostics; using System.IO; + using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Azure.Messaging.ServiceBus.Administration; + using Microsoft.Extensions.Configuration; using NUnit.Framework; [TestFixture] @@ -15,10 +17,50 @@ public class When_starting_the_function_host [Test] public async Task Should_not_blow_up() { - var pathToFuncExe = Environment.GetEnvironmentVariable("PathToFuncExe"); - 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'"); + var configBuilder = new ConfigurationBuilder(); + configBuilder.SetBasePath(Directory.GetCurrentDirectory()); + configBuilder.AddEnvironmentVariables(); + configBuilder.AddJsonFile("local.settings.json", true); - var connectionString = Environment.GetEnvironmentVariable("AzureWebJobsServiceBus"); + var config = configBuilder.Build(); + + var pathToFuncExe = config.GetValue("PathToFuncExe"); + + if (pathToFuncExe == null) + { + Console.WriteLine("Environment variable 'PathToFuncExe' not defined. Going to try to find the latest version."); + + var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + var sdkPath = Path.Combine(userProfile, "AppData", "Local", "AzureFunctionsTools", "Releases"); + if (Directory.Exists(sdkPath)) + { + var mostRecent = Directory.GetDirectories(sdkPath) + .Select(path => + { + var name = Path.GetFileName(path); + Version.TryParse(name, out var version); + return new { Name = name, Version = version }; + }) + .Where(x => x.Version is not null) + .OrderByDescending(x => x.Version) + .FirstOrDefault() + ?.Name; + + if (mostRecent is not null) + { + var exePath = Path.Combine(sdkPath, mostRecent, "cli_x64", "func.exe"); + if (File.Exists(exePath)) + { + Console.WriteLine("Found " + exePath); + pathToFuncExe = exePath; + } + } + } + } + + Assert.IsNotNull(pathToFuncExe, "Environment variable 'PathToFuncExe' should be defined to run tests. When running locally this is usually 'C:\\Users\\\\AppData\\Local\\AzureFunctionsTools\\Releases\\\\cli_x64\\func.exe'"); + + var connectionString = config.GetValue("AzureWebJobsServiceBus") ?? config.GetValue("Values:AzureWebJobsServiceBus"); Assert.IsNotNull(connectionString, "Environment variable 'AzureWebJobsServiceBus' should be defined to run tests."); var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(60)); From c0ff185cab154afc194ff03c67a887440992a14c Mon Sep 17 00:00:00 2001 From: David Boike Date: Wed, 28 Jun 2023 09:52:35 -0500 Subject: [PATCH 3/3] FunctionsPreservedDependencies --- src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj index cd6e9c20..144ef1ad 100644 --- a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj +++ b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj @@ -25,6 +25,13 @@ + + + + + + +