Skip to content

Commit a552385

Browse files
authored
enable rest of the trigger tests for oop (#798)
* enable all trigger tests for OOP * undo * fix test * merge conflict * remove Java
1 parent c86e154 commit a552385

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

test-outofproc/MultiFunctionTrigger.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
using System;
45
using System.Collections.Generic;
56
using DotnetIsolatedTests.Common;
67
using Microsoft.Extensions.Logging;
@@ -15,22 +16,24 @@ namespace DotnetIsolatedTests
1516
/// </summary>
1617
public static class MultiFunctionTrigger
1718
{
19+
private static readonly Action<ILogger, string, Exception> _loggerMessage = LoggerMessage.Define<string>(LogLevel.Information, eventId: new EventId(0, "INFO"), formatString: "{Message}");
20+
1821
[Function(nameof(MultiFunctionTrigger1))]
1922
public static void MultiFunctionTrigger1(
2023
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
2124
IReadOnlyList<SqlChange<Product>> products,
22-
ILogger logger)
25+
FunctionContext context)
2326
{
24-
logger.LogInformation("Trigger1 Changes: " + Utils.JsonSerializeObject(products));
27+
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger1 Changes: " + Utils.JsonSerializeObject(products), null);
2528
}
2629

2730
[Function(nameof(MultiFunctionTrigger2))]
2831
public static void MultiFunctionTrigger2(
2932
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
3033
IReadOnlyList<SqlChange<Product>> products,
31-
ILogger logger)
34+
FunctionContext context)
3235
{
33-
logger.LogInformation("Trigger2 Changes: " + Utils.JsonSerializeObject(products));
36+
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger2 Changes: " + Utils.JsonSerializeObject(products), null);
3437
}
3538
}
3639
}

test/Integration/SqlTriggerBindingIntegrationTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ await this.WaitForProductChanges(
168168
/// </summary>
169169
[Theory]
170170
[SqlInlineData()]
171-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
171+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
172172
public async Task PollingIntervalOverrideTriggerTest(SupportedLanguages lang)
173173
{
174174
const int firstId = 1;
@@ -293,7 +293,7 @@ await this.WaitForProductChanges(
293293
/// </summary>
294294
[Theory]
295295
[SqlInlineData()]
296-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
296+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
297297
public async Task MultiFunctionTriggerTest(SupportedLanguages lang)
298298
{
299299
const string Trigger1Changes = "Trigger1 Changes: ";
@@ -472,7 +472,7 @@ await this.WaitForProductChanges(
472472
/// </summary>
473473
[Theory]
474474
[SqlInlineData()]
475-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
475+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
476476
public void TableNotPresentTriggerTest(SupportedLanguages lang)
477477
{
478478
this.StartFunctionHostAndWaitForError(
@@ -487,7 +487,7 @@ public void TableNotPresentTriggerTest(SupportedLanguages lang)
487487
/// </summary>
488488
[Theory]
489489
[SqlInlineData()]
490-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
490+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
491491
public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
492492
{
493493
this.StartFunctionHostAndWaitForError(
@@ -503,7 +503,7 @@ public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
503503
/// </summary>
504504
[Theory]
505505
[SqlInlineData()]
506-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
506+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
507507
public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
508508
{
509509
this.StartFunctionHostAndWaitForError(
@@ -519,7 +519,7 @@ public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
519519
/// </summary>
520520
[Theory]
521521
[SqlInlineData()]
522-
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
522+
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
523523
public void UnsupportedColumnTypesTriggerTest(SupportedLanguages lang)
524524
{
525525
this.StartFunctionHostAndWaitForError(

0 commit comments

Comments
 (0)