From df5fdf3a221fae64081f48e72dbd53ee63ec619c Mon Sep 17 00:00:00 2001
From: Kamil Sobol <61715331+kasobol-msft@users.noreply.github.com>
Date: Mon, 12 Oct 2020 16:06:00 -0700
Subject: [PATCH] [Storage][Webjobs] Remove TestCommon. (#15878)
* move fake queue options.
* get rid of test common.
* rename.
* get common tests namespace in order.
* this remains...
* remove e2e project.
* fix sln.
* realy?
* trim signing knobs after dropping key depedency.
* let's see if we need this.
---
...Jobs.Extensions.Storage.Blobs.Tests.csproj | 8 ----
.../tests/BlobConfigurationTests.cs | 1 -
.../tests/BlobTests.cs | 4 +-
.../tests/BlobTriggerTests.cs | 8 ++--
.../tests/HostCallTests.cs | 18 +++++---
...orageBlobsWebJobsBuilderExtensionsTests.cs | 2 +-
...obs.Extensions.Storage.Common.Tests.csproj | 7 ----
.../ExpectManualCompletionLogger{TResult}.cs | 2 +-
.../tests}/FunctionalTest.cs | 42 ++++++-------------
.../tests}/RandomNameResolver.cs | 3 +-
.../TestConfigurationBuilderExtensions.cs | 4 +-
.../tests}/TestExtensions.cs | 2 +-
.../tests}/TestHelpers.cs | 5 ++-
.../tests}/TestJobHost.cs | 5 ++-
...obs.Extensions.Storage.Queues.Tests.csproj | 9 +---
.../tests/BinderTests.cs | 6 ++-
.../tests/DataBindingFunctionalTests.cs | 1 -
.../tests}/FakeQueuesOptionsSetup.cs | 0
.../tests/HostCallTests.cs | 15 +++++--
.../tests/HostStartTests.cs | 2 +-
.../tests/HostStopTests.cs | 3 +-
.../tests/InstanceTests.cs | 1 -
.../tests/QueueListenerTests.cs | 3 +-
.../tests/QueueProcessorTests.cs | 3 +-
.../tests/QueueTests.cs | 7 +++-
.../tests/QueueTriggerTests.cs | 21 +++++++---
...rageQueuesWebJobsBuilderExtensionsTests.cs | 2 +-
...Webjobs.Extensions.Storage.Samples.csproj} | 0
....Extensions.Storage.Scenario.Tests.csproj} | 11 ++---
.../tests/AzureStorageEndToEndTests.cs | 2 -
.../tests/BlobBindingEndToEndTests.cs | 2 -
.../tests/BlobTriggerEndToEndTests.cs | 2 -
.../tests/CustomObject.cs | 0
.../MultipleStorageAccountsEndToEndTests.cs | 1 -
.../tests/Properties/AssemblyInfo.cs | 0
.../tests/ScenarioTests.cs | 5 ++-
.../tests/appsettings.json | 0
.../Azure.Storage.Webjobs.Extensions.sln | 12 ++----
sdk/storage/Directory.Build.props | 4 --
.../Azure.WebJobs.Host.TestCommon.csproj | 24 -----------
.../Properties/AssemblyInfo.cs | 23 ----------
41 files changed, 98 insertions(+), 172 deletions(-)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/ExpectManualCompletionLogger{TResult}.cs (98%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/FunctionalTest.cs (67%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/RandomNameResolver.cs (89%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/TestConfigurationBuilderExtensions.cs (93%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/TestExtensions.cs (97%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/TestHelpers.cs (98%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Common/tests}/TestJobHost.cs (96%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.TestCommon => Azure.Storage.Webjobs.Extensions.Queues/tests}/FakeQueuesOptionsSetup.cs (100%)
rename sdk/storage/Azure.Storage.Webjobs.Extensions.Samples/{Azure.Storage.Webjobs.Extensions.Samples.csproj => Azure.Webjobs.Extensions.Storage.Samples.csproj} (100%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Azure.WebJobs.Host.EndToEnd.Tests.csproj => Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Azure.WebJobs.Extensions.Storage.Scenario.Tests.csproj} (78%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/AzureStorageEndToEndTests.cs (99%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/BlobBindingEndToEndTests.cs (99%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/BlobTriggerEndToEndTests.cs (99%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/CustomObject.cs (100%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/MultipleStorageAccountsEndToEndTests.cs (99%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/Properties/AssemblyInfo.cs (100%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/ScenarioTests.cs (96%)
rename sdk/storage/{Microsoft.Azure.WebJobs.Host.EndToEndTests => Azure.Storage.Webjobs.Extensions.Scenario.Tests}/tests/appsettings.json (100%)
delete mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Azure.WebJobs.Host.TestCommon.csproj
delete mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Properties/AssemblyInfo.cs
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/Azure.WebJobs.Extensions.Storage.Blobs.Tests.csproj b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/Azure.WebJobs.Extensions.Storage.Blobs.Tests.csproj
index 8958a19b30b07..77c43e294735a 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/Azure.WebJobs.Extensions.Storage.Blobs.Tests.csproj
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/Azure.WebJobs.Extensions.Storage.Blobs.Tests.csproj
@@ -2,13 +2,6 @@
$(RequiredTargetFrameworks)
-
- 1.0.0-beta.1
- This extension adds bindings for Storage
- false
- false
- true
-
@@ -16,7 +9,6 @@
-
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobConfigurationTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobConfigurationTests.cs
index 7c764a115c794..d219c4bcb8415 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobConfigurationTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobConfigurationTests.cs
@@ -5,7 +5,6 @@
using System.Threading.Tasks;
using Azure.Storage.Blobs.Specialized;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTests.cs
index e83a3c653067c..8c62e02ab8dc1 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTests.cs
@@ -6,13 +6,13 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.Hosting;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Azure.Storage.Queues;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;
using NUnit.Framework;
using Azure.WebJobs.Extensions.Storage.Blobs.Tests;
using System.Collections.Generic;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
{
@@ -103,6 +103,8 @@ await FunctionalTest.RunTriggerAsync(b => {
{
builder.ConfigureDefaults(options => options.Transport = AzuriteNUnitFixture.Instance.GetTransport());
});
+ b.AddAzureStorageBlobs();
+ b.AddAzureStorageQueues();
}, programType,
settings: new Dictionary() {
// This takes precedence over env variables.
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTriggerTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTriggerTests.cs
index f99e8368a4e85..b8d4630be8283 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTriggerTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/BlobTriggerTests.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Azure.Storage.Blobs;
@@ -12,7 +11,6 @@
using Azure.WebJobs.Extensions.Storage.Common.Tests;
using NUnit.Framework;
using Azure.WebJobs.Extensions.Storage.Blobs.Tests;
-using Azure.WebJobs.Extensions.Storage.Blobs;
using Azure.Storage.Queues;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
@@ -113,7 +111,11 @@ private static BlobContainerClient CreateContainer(BlobServiceClient blobService
private async Task RunTriggerAsync(Type programType,
Action> setTaskSource)
{
- return await FunctionalTest.RunTriggerAsync(b => b.UseStorageServices(blobServiceClient, queueServiceClient), programType, setTaskSource);
+ return await FunctionalTest.RunTriggerAsync(b =>
+ {
+ b.AddAzureStorageBlobs();
+ b.UseStorageServices(blobServiceClient, queueServiceClient);
+ }, programType, setTaskSource);
}
}
}
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/HostCallTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/HostCallTests.cs
index 31d9baa5cdce3..86cdd2d91d381 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/HostCallTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/HostCallTests.cs
@@ -9,12 +9,12 @@
using Microsoft.Azure.WebJobs.Host.Blobs;
using Microsoft.Azure.WebJobs.Host.Config;
using Azure.Storage.Blobs.Specialized;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
-using Microsoft.Azure.WebJobs.Extensions.Storage.Common;
+using Microsoft.Extensions.Hosting;
using NUnit.Framework;
using Azure.Storage.Blobs;
using Azure.WebJobs.Extensions.Storage.Blobs.Tests;
using Azure.Storage.Queues;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
{
@@ -460,24 +460,30 @@ private class PocoBlob
private async Task CallAsync(Type programType, string methodName, params Type[] customExtensions)
{
- await FunctionalTest.CallAsync(b => b.UseStorageServices(blobServiceClient, queueServiceClient), programType, programType.GetMethod(methodName), null, customExtensions);
+ await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), null, customExtensions);
}
private async Task CallAsync(Type programType, string methodName,
IDictionary arguments, params Type[] customExtensions)
{
- await FunctionalTest.CallAsync(b => b.UseStorageServices(blobServiceClient, queueServiceClient), programType, programType.GetMethod(methodName), arguments, customExtensions);
+ await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), arguments, customExtensions);
}
private async Task CallAsync(Type programType, string methodName,
IDictionary arguments, Action> setTaskSource)
{
- return await FunctionalTest.CallAsync(b => b.UseStorageServices(blobServiceClient, queueServiceClient), programType, programType.GetMethod(methodName), arguments, setTaskSource);
+ return await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), arguments, setTaskSource);
}
private async Task CallFailureAsync(Type programType, string methodName)
{
- return await FunctionalTest.CallFailureAsync(b => b.UseStorageServices(blobServiceClient, queueServiceClient), programType, programType.GetMethod(methodName), null);
+ return await FunctionalTest.CallFailureAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), null);
+ }
+
+ private void ConfigureStorage(IWebJobsBuilder builder)
+ {
+ builder.AddAzureStorageBlobs();
+ builder.UseStorageServices(blobServiceClient, queueServiceClient);
}
private struct CustomDataValue
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/StorageBlobsWebJobsBuilderExtensionsTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/StorageBlobsWebJobsBuilderExtensionsTests.cs
index 002deaad6482b..79afbc1567f26 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/StorageBlobsWebJobsBuilderExtensionsTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Blobs/tests/StorageBlobsWebJobsBuilderExtensionsTests.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT License.
using System.Collections.Generic;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
using Microsoft.Azure.WebJobs.Host;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Hosting;
using NUnit.Framework;
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/Azure.WebJobs.Extensions.Storage.Common.Tests.csproj b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/Azure.WebJobs.Extensions.Storage.Common.Tests.csproj
index 2400c28263c40..cda78020bcfc4 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/Azure.WebJobs.Extensions.Storage.Common.Tests.csproj
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/Azure.WebJobs.Extensions.Storage.Common.Tests.csproj
@@ -2,13 +2,6 @@
$(RequiredTargetFrameworks)
-
- 1.0.0-beta.1
- This extension adds bindings for Storage
- false
- false
- true
-
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/ExpectManualCompletionLogger{TResult}.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/ExpectManualCompletionLogger{TResult}.cs
similarity index 98%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/ExpectManualCompletionLogger{TResult}.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/ExpectManualCompletionLogger{TResult}.cs
index 33706c31476cf..33b3346961749 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/ExpectManualCompletionLogger{TResult}.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/ExpectManualCompletionLogger{TResult}.cs
@@ -7,7 +7,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public class ExpectManualCompletionLogger : ILogger
{
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/FunctionalTest.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/FunctionalTest.cs
similarity index 67%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/FunctionalTest.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/FunctionalTest.cs
index fd003718c684c..1d8016df94cfa 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/FunctionalTest.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/FunctionalTest.cs
@@ -5,23 +5,20 @@
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.FunctionalTests.TestDoubles;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
+using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
using NUnit.Framework;
-namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
// $$$ Remove all this. See Blob_IfBoundToCloudBlockBlob_BindsAndCreatesContainerButNotBlob for an example of what it should be.
- internal class FunctionalTest
+ public class FunctionalTest
{
// $$$ Reconcile with TestJobHost.
- internal static async Task RunTriggerAsync(
+ public static async Task RunTriggerAsync(
Action configureWebJobsBuilderAction,
Type programType,
Action> setTaskSource,
@@ -35,13 +32,7 @@ internal static async Task RunTriggerAsync(
var host = new HostBuilder()
.ConfigureLogging(b => b.AddProvider(new ExpectManualCompletionLoggerProvider(src, signalOnFirst, ignoreFailureFunctions)))
.ConfigureAppConfiguration(cb => cb.AddInMemoryCollection(settings))
- .ConfigureDefaultTestHost(builder =>
- {
- builder.AddAzureStorageBlobs().AddAzureStorageQueues();
- configureWebJobsBuilderAction.Invoke(builder);
-
- builder.Services.AddSingleton, FakeQueuesOptionsSetup>();
- }, programType)
+ .ConfigureDefaultTestHost(builder => configureWebJobsBuilderAction.Invoke(builder), programType)
.Build();
try
@@ -82,7 +73,7 @@ internal static async Task RunTriggerAsync(
// Runs the first triggered function and then returns.
// Expected that this instance provided some side-effect (ie, wrote to storage)
// that the caller can monitor.
- internal static async Task RunTriggerAsync(Action configureWebJobsBuilderAction, Type programType, Dictionary settings = default)
+ public static async Task RunTriggerAsync(Action configureWebJobsBuilderAction, Type programType, Dictionary settings = default)
{
TaskCompletionSource src = new TaskCompletionSource();
await RunTriggerAsync(
@@ -93,7 +84,7 @@ await RunTriggerAsync(
settings: settings);
}
- internal static async Task RunTriggerFailureAsync(Action configureWebJobsBuilderAction, Type programType, Action> setTaskSource)
+ public static async Task RunTriggerFailureAsync(Action configureWebJobsBuilderAction, Type programType, Action> setTaskSource)
{
try
{
@@ -108,14 +99,10 @@ internal static async Task RunTriggerFailureAsync(Action CallFailureAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, object arguments)
+ public static async Task CallFailureAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, object arguments)
{
var host = new HostBuilder()
- .ConfigureDefaultTestHost(b =>
- {
- b.AddAzureStorageBlobs().AddAzureStorageQueues();
- configureWebJobsBuilderAction.Invoke(b);
- }, programType)
+ .ConfigureDefaultTestHost(b => configureWebJobsBuilderAction.Invoke(b), programType)
.Build();
var jobHost = host.GetJobHost();
@@ -132,12 +119,11 @@ internal static async Task CallFailureAsync(Action c
return null;
}
- internal static async Task CallAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, object arguments, params Type[] customExtensions)
+ public static async Task CallAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, object arguments, params Type[] customExtensions)
{
var host = new HostBuilder()
.ConfigureDefaultTestHost(b =>
{
- b.AddAzureStorageBlobs().AddAzureStorageQueues();
configureWebJobsBuilderAction.Invoke(b);
foreach (var extension in customExtensions)
@@ -151,17 +137,13 @@ internal static async Task CallAsync(Action configureWebJobsBui
await jobHost.CallAsync(methodInfo, arguments);
}
- internal static async Task CallAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, IDictionary arguments, Action> setTaskSource)
+ public static async Task CallAsync(Action configureWebJobsBuilderAction, Type programType, MethodInfo methodInfo, IDictionary arguments, Action> setTaskSource)
{
TaskCompletionSource src = new TaskCompletionSource();
setTaskSource(src);
var host = new HostBuilder()
- .ConfigureDefaultTestHost(builder =>
- {
- builder.AddAzureStorageBlobs().AddAzureStorageQueues();
- configureWebJobsBuilderAction.Invoke(builder);
- }, programType)
+ .ConfigureDefaultTestHost(builder => configureWebJobsBuilderAction.Invoke(builder), programType)
.Build();
var jobHost = host.GetJobHost();
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/RandomNameResolver.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/RandomNameResolver.cs
similarity index 89%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/RandomNameResolver.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/RandomNameResolver.cs
index 6b10abfae8821..8418ffa4ee496 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/RandomNameResolver.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/RandomNameResolver.cs
@@ -3,8 +3,9 @@
using System;
using System.Globalization;
+using Microsoft.Azure.WebJobs;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public class RandomNameResolver : INameResolver
{
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestConfigurationBuilderExtensions.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestConfigurationBuilderExtensions.cs
similarity index 93%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestConfigurationBuilderExtensions.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestConfigurationBuilderExtensions.cs
index e97f4981ed86b..ee358377d4d55 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestConfigurationBuilderExtensions.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestConfigurationBuilderExtensions.cs
@@ -5,7 +5,7 @@
using System.IO;
using Microsoft.Extensions.Configuration;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public static class TestConfigurationBuilderExtensions
{
@@ -20,4 +20,4 @@ public static IConfigurationBuilder AddTestSettings(this IConfigurationBuilder b
return builder.AddJsonFile(configPath, true);
}
}
-}
\ No newline at end of file
+}
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestExtensions.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestExtensions.cs
similarity index 97%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestExtensions.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestExtensions.cs
index 3011961f4cff6..81245ad18dd67 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestExtensions.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestExtensions.cs
@@ -8,7 +8,7 @@
using Azure.Storage.Blobs.Models;
using Azure.Storage.Blobs.Specialized;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public static class TestExtensions
{
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestHelpers.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestHelpers.cs
similarity index 98%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestHelpers.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestHelpers.cs
index c232164e207c5..2150da536b542 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestHelpers.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestHelpers.cs
@@ -9,7 +9,8 @@
using System.Reflection;
using System.Threading.Tasks;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
-using Microsoft.Azure.WebJobs.Host.FunctionalTests.TestDoubles;
+using Microsoft.Azure.WebJobs;
+using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Host.Indexers;
using Microsoft.Azure.WebJobs.Host.Loggers;
using Microsoft.Azure.WebJobs.Host.Timers;
@@ -20,7 +21,7 @@
using Microsoft.Extensions.Options;
using NUnit.Framework;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public static class TestHelpers
{
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestJobHost.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestJobHost.cs
similarity index 96%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestJobHost.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestJobHost.cs
index 05c23e0e3ad02..8f93cc596ad71 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/TestJobHost.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Common/tests/TestJobHost.cs
@@ -1,15 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Microsoft.Azure.WebJobs;
+using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Host.Executors;
using Microsoft.Azure.WebJobs.Host.Indexers;
using Microsoft.Extensions.Options;
using NUnit.Framework;
-namespace Microsoft.Azure.WebJobs.Host.TestCommon
+namespace Azure.WebJobs.Extensions.Storage.Common.Tests
{
public class JobHost : JobHost
{
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/Azure.WebJobs.Extensions.Storage.Queues.Tests.csproj b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/Azure.WebJobs.Extensions.Storage.Queues.Tests.csproj
index 824e4004942eb..1932ed97f6d88 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/Azure.WebJobs.Extensions.Storage.Queues.Tests.csproj
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/Azure.WebJobs.Extensions.Storage.Queues.Tests.csproj
@@ -2,20 +2,13 @@
$(RequiredTargetFrameworks)
-
- 1.0.0-beta.1
- This extension adds bindings for Storage
- false
- false
- true
-
-
+
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/BinderTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/BinderTests.cs
index 55a52eae54a07..98eba31cfff83 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/BinderTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/BinderTests.cs
@@ -7,6 +7,7 @@
using Azure.Storage.Queues.Models;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
using Azure.WebJobs.Extensions.Storage.Queues.Tests;
+using Microsoft.Extensions.Hosting;
using NUnit.Framework;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
@@ -49,7 +50,10 @@ private static QueueClient CreateQueue(QueueServiceClient queueServiceClient, st
private async Task RunTriggerFailureAsync(Type programType,
Action> setTaskSource)
{
- return await FunctionalTest.RunTriggerFailureAsync(b => b.UseQueueService(queueServiceClient), programType, setTaskSource);
+ return await FunctionalTest.RunTriggerFailureAsync(b => {
+ b.AddAzureStorageQueues();
+ b.UseQueueService(queueServiceClient);
+ }, programType, setTaskSource);
}
private class BindToQueueTriggerViaIBinderProgram
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/DataBindingFunctionalTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/DataBindingFunctionalTests.cs
index 24776f782efbe..f9b182cfb51c0 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/DataBindingFunctionalTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/DataBindingFunctionalTests.cs
@@ -4,7 +4,6 @@
using System;
using System.Reflection;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using NUnit.Framework;
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/FakeQueuesOptionsSetup.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/FakeQueuesOptionsSetup.cs
similarity index 100%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/FakeQueuesOptionsSetup.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/FakeQueuesOptionsSetup.cs
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostCallTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostCallTests.cs
index eb20e6e60df88..4e489d5c60d60 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostCallTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostCallTests.cs
@@ -7,6 +7,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Indexers;
+using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
@@ -305,26 +306,32 @@ private static void AssertEqual(StructMessage expected, StructMessage actual)
private async Task CallAsync(Type programType, string methodName, params Type[] customExtensions)
{
- await FunctionalTest.CallAsync(b => b.UseQueueService(queueServiceClient), programType, programType.GetMethod(methodName), null, customExtensions);
+ await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), null, customExtensions);
}
private async Task CallAsync(Type programType, string methodName,
IDictionary arguments, params Type[] customExtensions)
{
- await FunctionalTest.CallAsync(b => b.UseQueueService(queueServiceClient), programType, programType.GetMethod(methodName), arguments, customExtensions);
+ await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), arguments, customExtensions);
}
private async Task CallAsync(Type programType, string methodName,
Action> setTaskSource)
{
IDictionary arguments = null;
- return await FunctionalTest.CallAsync(b => b.UseQueueService(queueServiceClient), programType, programType.GetMethod(methodName), arguments, setTaskSource);
+ return await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), arguments, setTaskSource);
}
private async Task CallAsync(Type programType, string methodName,
IDictionary arguments, Action> setTaskSource)
{
- return await FunctionalTest.CallAsync(b => b.UseQueueService(queueServiceClient), programType, programType.GetMethod(methodName), arguments, setTaskSource);
+ return await FunctionalTest.CallAsync(b => ConfigureStorage(b), programType, programType.GetMethod(methodName), arguments, setTaskSource);
+ }
+
+ private void ConfigureStorage(IWebJobsBuilder builder)
+ {
+ builder.AddAzureStorageQueues();
+ builder.UseQueueService(queueServiceClient);
}
private struct CustomDataValue
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStartTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStartTests.cs
index 2f2538b270870..be2e40c5104ca 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStartTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStartTests.cs
@@ -4,11 +4,11 @@
using System;
using System.Globalization;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Hosting;
using Azure.Storage.Queues;
using NUnit.Framework;
using Azure.WebJobs.Extensions.Storage.Queues.Tests;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
{
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStopTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStopTests.cs
index 15a3c9a0bed63..4735ed04fc004 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStopTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/HostStopTests.cs
@@ -3,7 +3,6 @@
using System.Threading;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Azure.Storage.Queues;
@@ -38,7 +37,7 @@ public async Task Stop_TriggersCancellationToken()
var host = new HostBuilder()
.ConfigureDefaultTestHost(c =>
{
- c.AddAzureStorageBlobs().AddAzureStorageQueues();
+ c.AddAzureStorageQueues();
c.Services.AddSingleton(_ => new FakeQueueServiceClientProvider(queueServiceClient));
})
.Build();
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/InstanceTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/InstanceTests.cs
index 66fc14fd151fa..07f970ae81186 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/InstanceTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/InstanceTests.cs
@@ -3,7 +3,6 @@
using System;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Hosting;
using Moq;
using Azure.Storage.Queues.Models;
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueListenerTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueListenerTests.cs
index c19e2207c03ca..359182c01f42f 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueListenerTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueListenerTests.cs
@@ -11,7 +11,6 @@
using Microsoft.Azure.WebJobs.Host.Queues;
using Microsoft.Azure.WebJobs.Host.Queues.Listeners;
using Microsoft.Azure.WebJobs.Host.Scale;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Azure.WebJobs.Host.Timers;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
@@ -647,7 +646,7 @@ public TestFixture()
IHost host = new HostBuilder()
.ConfigureDefaultTestHost(b =>
{
- b.AddAzureStorageBlobs().AddAzureStorageQueues();
+ b.AddAzureStorageQueues();
})
.Build();
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueProcessorTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueProcessorTests.cs
index 4b442cb39b55c..1e0443438506d 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueProcessorTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueProcessorTests.cs
@@ -9,7 +9,6 @@
using Microsoft.Azure.WebJobs.Host.Queues;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
using System.Linq;
@@ -219,7 +218,7 @@ public TestFixture()
IHost host = new HostBuilder()
.ConfigureDefaultTestHost(b =>
{
- b.AddAzureStorageBlobs().AddAzureStorageQueues();
+ b.AddAzureStorageQueues();
})
.Build();
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTests.cs
index 1660f29192c66..72585beea6189 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTests.cs
@@ -6,7 +6,6 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
@@ -487,7 +486,11 @@ private static async Task CreateQueue(QueueServiceClient client, st
private async Task RunTriggerAsync(Type programType,
Action> setTaskSource)
{
- return await FunctionalTest.RunTriggerAsync(b => b.UseQueueService(queueServiceClient), programType, setTaskSource);
+ return await FunctionalTest.RunTriggerAsync(b =>
+ {
+ b.AddAzureStorageQueues();
+ b.UseQueueService(queueServiceClient);
+ }, programType, setTaskSource);
}
private class BindToCloudQueueProgram
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTriggerTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTriggerTests.cs
index 4617351e1677c..7e2f4982eb2f3 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTriggerTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/QueueTriggerTests.cs
@@ -9,11 +9,13 @@
using Newtonsoft.Json;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
-using Microsoft.Azure.WebJobs.Extensions.Storage.Common;
using Microsoft.Azure.WebJobs.Host.FunctionalTests.TestDoubles;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using Microsoft.Extensions.Hosting;
using NUnit.Framework;
-using Azure.WebJobs.Extensions.Storage.Common.Tests;
using Azure.WebJobs.Extensions.Storage.Queues.Tests;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
{
@@ -684,19 +686,19 @@ public async Task CallQueueTrigger_ProvidesPopReceiptBindingData()
private async Task RunTriggerAsync(Type programType,
Action> setTaskSource)
{
- return await FunctionalTest.RunTriggerAsync(b => b.UseQueueService(queueServiceClient), programType, setTaskSource);
+ return await FunctionalTest.RunTriggerAsync(b => ConfigureQueues(b), programType, setTaskSource);
}
private async Task RunTriggerAsync(Type programType,
Action> setTaskSource, IEnumerable ignoreFailureFunctions)
{
- return await FunctionalTest.RunTriggerAsync(b => b.UseQueueService(queueServiceClient), programType, setTaskSource, ignoreFailureFunctions);
+ return await FunctionalTest.RunTriggerAsync(b => ConfigureQueues(b), programType, setTaskSource, ignoreFailureFunctions);
}
private async Task RunTriggerFailureAsync(Type programType,
Action> setTaskSource)
{
- return await FunctionalTest.RunTriggerFailureAsync(b => b.UseQueueService(queueServiceClient), programType, setTaskSource);
+ return await FunctionalTest.RunTriggerFailureAsync(b => ConfigureQueues(b), programType, setTaskSource);
}
private async Task CallQueueTriggerAsync(object message, Type programType,
@@ -705,7 +707,7 @@ private async Task CallQueueTriggerAsync(object message, Type
var method = programType.GetMethod("Run");
Assert.NotNull(method);
- var result = await FunctionalTest.CallAsync(b => b.UseQueueService(queueServiceClient), programType, method, new Dictionary
+ var result = await FunctionalTest.CallAsync(b => ConfigureQueues(b), programType, method, new Dictionary
{
{ "message", message }
}, setTaskSource);
@@ -713,6 +715,13 @@ private async Task CallQueueTriggerAsync(object message, Type
return result;
}
+ private void ConfigureQueues(IWebJobsBuilder builder)
+ {
+ builder.AddAzureStorageQueues();
+ builder.Services.AddSingleton, FakeQueuesOptionsSetup>();
+ builder.UseQueueService(queueServiceClient);
+ }
+
private static async Task CreateQueue(QueueServiceClient client, string queueName)
{
var queue = client.GetQueueClient(queueName);
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/StorageQueuesWebJobsBuilderExtensionsTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/StorageQueuesWebJobsBuilderExtensionsTests.cs
index b9b51654d7a8a..bfff784bdc301 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/StorageQueuesWebJobsBuilderExtensionsTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Queues/tests/StorageQueuesWebJobsBuilderExtensionsTests.cs
@@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
using Microsoft.Azure.WebJobs.Host;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Hosting;
using NUnit.Framework;
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.Samples/Azure.Storage.Webjobs.Extensions.Samples.csproj b/sdk/storage/Azure.Storage.Webjobs.Extensions.Samples/Azure.Webjobs.Extensions.Storage.Samples.csproj
similarity index 100%
rename from sdk/storage/Azure.Storage.Webjobs.Extensions.Samples/Azure.Storage.Webjobs.Extensions.Samples.csproj
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Samples/Azure.Webjobs.Extensions.Storage.Samples.csproj
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Azure.WebJobs.Host.EndToEnd.Tests.csproj b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Azure.WebJobs.Extensions.Storage.Scenario.Tests.csproj
similarity index 78%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Azure.WebJobs.Host.EndToEnd.Tests.csproj
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Azure.WebJobs.Extensions.Storage.Scenario.Tests.csproj
index 1a82e6eafd1d1..12216652f3063 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Azure.WebJobs.Host.EndToEnd.Tests.csproj
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Azure.WebJobs.Extensions.Storage.Scenario.Tests.csproj
@@ -1,10 +1,6 @@
- netcoreapp2.1
- Microsoft.Azure.WebJobs.Host.EndToEndTests
- false
- false
- true
+ $(RequiredTargetFrameworks)
@@ -17,12 +13,13 @@
-
+
+
-
+
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/AzureStorageEndToEndTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/AzureStorageEndToEndTests.cs
similarity index 99%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/AzureStorageEndToEndTests.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/AzureStorageEndToEndTests.cs
index 739926866f7e0..f4f3c5a2adcdb 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/AzureStorageEndToEndTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/AzureStorageEndToEndTests.cs
@@ -12,9 +12,7 @@
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
-using Microsoft.Azure.WebJobs.Extensions.Storage.Common;
using Microsoft.Azure.WebJobs.Host.Queues;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobBindingEndToEndTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobBindingEndToEndTests.cs
similarity index 99%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobBindingEndToEndTests.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobBindingEndToEndTests.cs
index 4112944e69621..92e0807f86930 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobBindingEndToEndTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobBindingEndToEndTests.cs
@@ -9,14 +9,12 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Executors;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using Azure.Storage.Blobs.Specialized;
using Azure.Storage.Blobs.Models;
using Azure.Storage.Blobs;
-using Microsoft.Azure.WebJobs.Extensions.Storage.Common;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
using NUnit.Framework;
using Azure.Core.TestFramework;
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobTriggerEndToEndTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobTriggerEndToEndTests.cs
similarity index 99%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobTriggerEndToEndTests.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobTriggerEndToEndTests.cs
index 9f9d3ea0be656..400e7b5c048dd 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/BlobTriggerEndToEndTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/BlobTriggerEndToEndTests.cs
@@ -11,8 +11,6 @@
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;
using Azure.WebJobs.Extensions.Storage.Common.Tests;
-using Microsoft.Azure.WebJobs.Extensions.Storage.Common;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json.Linq;
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/CustomObject.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/CustomObject.cs
similarity index 100%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/CustomObject.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/CustomObject.cs
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/MultipleStorageAccountsEndToEndTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/MultipleStorageAccountsEndToEndTests.cs
similarity index 99%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/MultipleStorageAccountsEndToEndTests.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/MultipleStorageAccountsEndToEndTests.cs
index 1326700a8d425..b16325d7906d3 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/MultipleStorageAccountsEndToEndTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/MultipleStorageAccountsEndToEndTests.cs
@@ -5,7 +5,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json.Linq;
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Properties/AssemblyInfo.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Properties/AssemblyInfo.cs
similarity index 100%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/Properties/AssemblyInfo.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/Properties/AssemblyInfo.cs
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/ScenarioTests.cs b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/ScenarioTests.cs
similarity index 96%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/ScenarioTests.cs
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/ScenarioTests.cs
index 23648e259051e..594d9af22f19a 100644
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/ScenarioTests.cs
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/ScenarioTests.cs
@@ -8,8 +8,9 @@
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;
using Azure.Storage.Queues;
-using Microsoft.Azure.WebJobs.Host.TestCommon;
+using Azure.WebJobs.Extensions.Storage.Common.Tests;
using Microsoft.Extensions.Azure;
+using Microsoft.Extensions.Hosting;
using NUnit.Framework;
namespace Microsoft.Azure.WebJobs.Host.FunctionalTests
@@ -70,6 +71,8 @@ private async Task RunTriggerAsync(Type programType,
{
builder.ConfigureDefaults(options => options.Transport = AzuriteNUnitFixture.Instance.GetTransport());
});
+ b.AddAzureStorageQueues();
+ b.AddAzureStorageBlobs();
}, programType, setTaskSource,
settings: new Dictionary() {
// This takes precedence over env variables.
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/appsettings.json b/sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/appsettings.json
similarity index 100%
rename from sdk/storage/Microsoft.Azure.WebJobs.Host.EndToEndTests/tests/appsettings.json
rename to sdk/storage/Azure.Storage.Webjobs.Extensions.Scenario.Tests/tests/appsettings.json
diff --git a/sdk/storage/Azure.Storage.Webjobs.Extensions.sln b/sdk/storage/Azure.Storage.Webjobs.Extensions.sln
index f5b02304451a5..832c313889dab 100644
--- a/sdk/storage/Azure.Storage.Webjobs.Extensions.sln
+++ b/sdk/storage/Azure.Storage.Webjobs.Extensions.sln
@@ -26,15 +26,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.WebJobs.Extensions.St
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.WebJobs.Extensions.Storage.Queues.Tests", "Azure.Storage.Webjobs.Extensions.Queues\tests\Azure.WebJobs.Extensions.Storage.Queues.Tests.csproj", "{E3AD2DCE-7699-4EA4-AA85-CAF2EE0CD5D5}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.WebJobs.Host.TestCommon", "Microsoft.Azure.WebJobs.Host.TestCommon\Azure.WebJobs.Host.TestCommon.csproj", "{DE1A44A0-FE29-48D6-8758-BFDC8D6F1EB5}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.Common", "Azure.Storage.Common\src\Azure.Storage.Common.csproj", "{A90BB7A5-51D3-4966-BB8E-3D0B832497DF}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.WebJobs.Host.EndToEnd.Tests", "Microsoft.Azure.WebJobs.Host.EndToEndTests\tests\Azure.WebJobs.Host.EndToEnd.Tests.csproj", "{F1997C00-7304-481F-8002-7AB0728DB6C1}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.WebJobs.Extensions.Storage.Scenario.Tests", "Azure.Storage.Webjobs.Extensions.Scenario.Tests\tests\Azure.WebJobs.Extensions.Storage.Scenario.Tests.csproj", "{F1997C00-7304-481F-8002-7AB0728DB6C1}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.Webjobs.Extensions.Samples", "Azure.Storage.Webjobs.Extensions.Samples\Azure.Storage.Webjobs.Extensions.Samples.csproj", "{0425DF36-E0F1-419A-8B07-E01DE249D066}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Webjobs.Extensions.Storage.Samples", "Azure.Storage.Webjobs.Extensions.Samples\Azure.Webjobs.Extensions.Storage.Samples.csproj", "{0425DF36-E0F1-419A-8B07-E01DE249D066}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.Azure", "..\extensions\Microsoft.Extensions.Azure\src\Microsoft.Extensions.Azure.csproj", "{CB002B93-3D25-42DD-B1A6-472C10B99BA7}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure", "..\extensions\Microsoft.Extensions.Azure\src\Microsoft.Extensions.Azure.csproj", "{CB002B93-3D25-42DD-B1A6-472C10B99BA7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -78,10 +76,6 @@ Global
{E3AD2DCE-7699-4EA4-AA85-CAF2EE0CD5D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3AD2DCE-7699-4EA4-AA85-CAF2EE0CD5D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3AD2DCE-7699-4EA4-AA85-CAF2EE0CD5D5}.Release|Any CPU.Build.0 = Release|Any CPU
- {DE1A44A0-FE29-48D6-8758-BFDC8D6F1EB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DE1A44A0-FE29-48D6-8758-BFDC8D6F1EB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DE1A44A0-FE29-48D6-8758-BFDC8D6F1EB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DE1A44A0-FE29-48D6-8758-BFDC8D6F1EB5}.Release|Any CPU.Build.0 = Release|Any CPU
{A90BB7A5-51D3-4966-BB8E-3D0B832497DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A90BB7A5-51D3-4966-BB8E-3D0B832497DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A90BB7A5-51D3-4966-BB8E-3D0B832497DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/sdk/storage/Directory.Build.props b/sdk/storage/Directory.Build.props
index 080f51199f92b..5077d2726e204 100644
--- a/sdk/storage/Directory.Build.props
+++ b/sdk/storage/Directory.Build.props
@@ -6,10 +6,6 @@
true
true
-
- false
- true
-
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Azure.WebJobs.Host.TestCommon.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Azure.WebJobs.Host.TestCommon.csproj
deleted file mode 100644
index 620d29cb53a73..0000000000000
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Azure.WebJobs.Host.TestCommon.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- $(RequiredTargetFrameworks)
- Microsoft.Azure.WebJobs.Host.TestCommon
- Microsoft.Azure.WebJobs.Host.TestCommon
- false
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Properties/AssemblyInfo.cs b/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Properties/AssemblyInfo.cs
deleted file mode 100644
index 6d55de557b943..0000000000000
--- a/sdk/storage/Microsoft.Azure.WebJobs.Host.TestCommon/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("Azure.WebJobs.Extensions.Storage.Blobs.Tests, PublicKey=" +
- "0024000004800000940000000602000000240000525341310004000001000100d15ddcb2968829" +
- "5338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc" +
- "012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" +
- "e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" +
- "aa7b11b4")]
-[assembly: InternalsVisibleTo("Azure.WebJobs.Extensions.Storage.Queues.Tests, PublicKey=" +
- "0024000004800000940000000602000000240000525341310004000001000100d15ddcb2968829" +
- "5338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc" +
- "012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" +
- "e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" +
- "aa7b11b4")]
-[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Host.EndToEndTests, PublicKey=" +
- "0024000004800000940000000602000000240000525341310004000001000100d15ddcb2968829" +
- "5338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc" +
- "012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" +
- "e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" +
- "aa7b11b4")]
\ No newline at end of file