Skip to content

Commit

Permalink
enable rest of the trigger tests for oop (#798)
Browse files Browse the repository at this point in the history
* enable all trigger tests for OOP

* undo

* fix test

* merge conflict

* remove Java
  • Loading branch information
MaddyDev authored Apr 12, 2023
1 parent c86e154 commit a552385
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions test-outofproc/MultiFunctionTrigger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using DotnetIsolatedTests.Common;
using Microsoft.Extensions.Logging;
Expand All @@ -15,22 +16,24 @@ namespace DotnetIsolatedTests
/// </summary>
public static class MultiFunctionTrigger
{
private static readonly Action<ILogger, string, Exception> _loggerMessage = LoggerMessage.Define<string>(LogLevel.Information, eventId: new EventId(0, "INFO"), formatString: "{Message}");

[Function(nameof(MultiFunctionTrigger1))]
public static void MultiFunctionTrigger1(
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
IReadOnlyList<SqlChange<Product>> products,
ILogger logger)
FunctionContext context)
{
logger.LogInformation("Trigger1 Changes: " + Utils.JsonSerializeObject(products));
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger1 Changes: " + Utils.JsonSerializeObject(products), null);
}

[Function(nameof(MultiFunctionTrigger2))]
public static void MultiFunctionTrigger2(
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
IReadOnlyList<SqlChange<Product>> products,
ILogger logger)
FunctionContext context)
{
logger.LogInformation("Trigger2 Changes: " + Utils.JsonSerializeObject(products));
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger2 Changes: " + Utils.JsonSerializeObject(products), null);
}
}
}
12 changes: 6 additions & 6 deletions test/Integration/SqlTriggerBindingIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public async Task PollingIntervalOverrideTriggerTest(SupportedLanguages lang)
{
const int firstId = 1;
Expand Down Expand Up @@ -293,7 +293,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public async Task MultiFunctionTriggerTest(SupportedLanguages lang)
{
const string Trigger1Changes = "Trigger1 Changes: ";
Expand Down Expand Up @@ -472,7 +472,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void TableNotPresentTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -487,7 +487,7 @@ public void TableNotPresentTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -503,7 +503,7 @@ public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -519,7 +519,7 @@ public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void UnsupportedColumnTypesTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand Down

0 comments on commit a552385

Please sign in to comment.