Skip to content

Commit

Permalink
Updating Event Hubs extension to use track 2 extensions (#512)
Browse files Browse the repository at this point in the history
* Updating Event Hubs extension to use track 2 extensions

* Removing EH E2E Functions
  • Loading branch information
fabiocav committed Jun 29, 2021
1 parent b206739 commit ceddf5e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventHubs", "4.2.0")]
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventHubs", "5.0.0-beta.6")]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<Description>Azure Event Hubs extensions for .NET isolated functions</Description>

<!--Version information-->
<VersionPrefix>4.2.1</VersionPrefix>
<VersionPrefix>5.0.0</VersionPrefix>
<VersionSuffix>-beta.6</VersionSuffix>

</PropertyGroup>

<Import Project="..\..\build\Extensions.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace Microsoft.Azure.Functions.Worker.E2EApp
{
public static class EventHubsEnumerableFunctions
{
[Function(nameof(EventHubsEnumerableTrigger))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsEnumerableTrigger))]
[EventHubOutput("test-output-string-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static TestData EventHubsEnumerableTrigger([EventHubTrigger("test-input-enumerable-dotnet-isolated", Connection = "EventHubConnectionAppSetting")] List<TestData> input,
FunctionContext context)
Expand All @@ -18,7 +19,8 @@ public static TestData EventHubsEnumerableTrigger([EventHubTrigger("test-input-e
return input[0];
}

[Function(nameof(EventHubsVerifyOutputEnumerable))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsVerifyOutputEnumerable))]
[QueueOutput("test-eventhub-output-string-dotnet-isolated")]
public static string EventHubsVerifyOutputEnumerable([EventHubTrigger("test-output-enumerable-dotnet-isolated", Connection = "EventHubConnectionAppSetting")] List<string> input,
FunctionContext context)
Expand All @@ -28,7 +30,8 @@ public static string EventHubsVerifyOutputEnumerable([EventHubTrigger("test-outp
return input[0];
}

[Function(nameof(TestEnumerable))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(TestEnumerable))]
[EventHubOutput("test-input-enumerable-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static TestData TestEnumerable(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

namespace Microsoft.Azure.Functions.Worker.E2EApp
{
public static class EventHubsObjectFunctions
public static class EventHubsObjectFunctionsF
{
[Function(nameof(EventHubsObjectFunction))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsObjectFunction))]
[EventHubOutput("test-eventhub-output-object-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static TestData EventHubsObjectFunction([EventHubTrigger("test-eventhub-input-object-dotnet-isolated", Connection = "EventHubConnectionAppSetting", IsBatched = false)] TestData input,
FunctionContext context)
Expand All @@ -16,7 +17,8 @@ public static TestData EventHubsObjectFunction([EventHubTrigger("test-eventhub-i
return input;
}

[Function(nameof(EventHubsVerifyOutputObject))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsVerifyOutputObject))]
[QueueOutput("test-eventhub-output-object-dotnet-isolated")]
public static TestData EventHubsVerifyOutputObject([EventHubTrigger("test-eventhub-output-object-dotnet-isolated", Connection = "EventHubConnectionAppSetting", IsBatched = false)] TestData input,
FunctionContext context)
Expand All @@ -26,7 +28,8 @@ public static TestData EventHubsVerifyOutputObject([EventHubTrigger("test-eventh
return input;
}

[Function(nameof(TestObject))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(TestObject))]
[EventHubOutput("test-eventhub-input-object-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static TestData TestObject(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace Microsoft.Azure.Functions.Worker.E2EApp
{
public static class EventHubsStringFunctions
{
[Function(nameof(EventHubsStringTrigger))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsStringTrigger))]
[EventHubOutput("test-output-string-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static string EventHubsStringTrigger([EventHubTrigger("test-input-string-dotnet-isolated", Connection = "EventHubConnectionAppSetting")] string[] input,
FunctionContext context)
Expand All @@ -15,7 +16,8 @@ public static string EventHubsStringTrigger([EventHubTrigger("test-input-string-
return input[0];
}

[Function(nameof(EventHubsVerifyOutputString))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(EventHubsVerifyOutputString))]
[QueueOutput("test-eventhub-output-string-dotnet-isolated")]
public static string EventHubsVerifyOutputString([EventHubTrigger("test-output-string-dotnet-isolated", Connection = "EventHubConnectionAppSetting")] string[] input,
FunctionContext context)
Expand All @@ -25,7 +27,8 @@ public static string EventHubsVerifyOutputString([EventHubTrigger("test-output-s
return input[0];
}

[Function(nameof(Test))]
// TODO: We need to enable Event Hubs tests.
// [Function(nameof(Test))]
[EventHubOutput("test-input-string-dotnet-isolated", Connection = "EventHubConnectionAppSetting")]
public static string Test(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req,
Expand Down
3 changes: 1 addition & 2 deletions test/E2ETests/E2EApps/E2EApp/local.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"CosmosConnection": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"CosmosDb": "ItemDb",
"CosmosCollIn": "ItemCollectionIn",
"CosmosCollOut": "ItemCollectionOut",
"EventHubConnectionAppSetting": "%EventHubConnectionAppSetting%"
"CosmosCollOut": "ItemCollectionOut"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public void CardinalityManyFunctions(string functionName, string entryPoint, boo
b => ValidateTrigger(b, cardinalityMany));

AssertDictionary(extensions, new Dictionary<string, string>(){
{ "Microsoft.Azure.WebJobs.Extensions.EventHubs", "4.2.0" }
{ "Microsoft.Azure.WebJobs.Extensions.EventHubs", "5.0.0-beta.6" }
});

void ValidateTrigger(ExpandoObject b, bool many)
Expand Down

0 comments on commit ceddf5e

Please sign in to comment.