From 3ea80f6e213534eee2e4a2c253ebe1e33a6deacf Mon Sep 17 00:00:00 2001 From: luczhan Date: Thu, 6 Oct 2022 12:51:01 -0700 Subject: [PATCH 1/2] fix working folder for integration tests --- test/Integration/IntegrationTestBase.cs | 2 +- test/Integration/SqlOutputBindingIntegrationTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Integration/IntegrationTestBase.cs b/test/Integration/IntegrationTestBase.cs index 4fe1db996..a59f384ac 100644 --- a/test/Integration/IntegrationTestBase.cs +++ b/test/Integration/IntegrationTestBase.cs @@ -178,7 +178,7 @@ protected void StartAzurite() /// protected void StartFunctionHost(string functionName, SupportedLanguages language, bool useTestFolder = false, DataReceivedEventHandler customOutputHandler = null) { - string workingDirectory = useTestFolder ? GetPathToBin() : Path.Combine(GetPathToBin(), "SqlExtensionSamples", Enum.GetName(typeof(SupportedLanguages), language)); + string workingDirectory = language == SupportedLanguages.CSharp && useTestFolder ? GetPathToBin() : Path.Combine(GetPathToBin(), "SqlExtensionSamples", Enum.GetName(typeof(SupportedLanguages), language)); if (!Directory.Exists(workingDirectory)) { throw new FileNotFoundException("Working directory not found at " + workingDirectory); diff --git a/test/Integration/SqlOutputBindingIntegrationTests.cs b/test/Integration/SqlOutputBindingIntegrationTests.cs index 5b2d17d63..e30822d16 100644 --- a/test/Integration/SqlOutputBindingIntegrationTests.cs +++ b/test/Integration/SqlOutputBindingIntegrationTests.cs @@ -106,6 +106,7 @@ public void AddProductArrayTest(SupportedLanguages lang) /// The language to run the test against [Theory] [SqlInlineData()] + [UnsupportedLanguages(SupportedLanguages.JavaScript)] // Temporarily skipping while we look into the datetime conversion issue with JavaScript public void AddProductColumnTypesTest(SupportedLanguages lang) { this.StartFunctionHost(nameof(AddProductColumnTypes), lang, true); From fb3a9e0d8284a4a3a2c8939d19ec33ffbd5a17e6 Mon Sep 17 00:00:00 2001 From: luczhan Date: Thu, 6 Oct 2022 13:02:42 -0700 Subject: [PATCH 2/2] fix datetime format --- test/Integration/SqlOutputBindingIntegrationTests.cs | 1 - test/Integration/test-js/AddProductColumnTypes/index.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/Integration/SqlOutputBindingIntegrationTests.cs b/test/Integration/SqlOutputBindingIntegrationTests.cs index e30822d16..5b2d17d63 100644 --- a/test/Integration/SqlOutputBindingIntegrationTests.cs +++ b/test/Integration/SqlOutputBindingIntegrationTests.cs @@ -106,7 +106,6 @@ public void AddProductArrayTest(SupportedLanguages lang) /// The language to run the test against [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.JavaScript)] // Temporarily skipping while we look into the datetime conversion issue with JavaScript public void AddProductColumnTypesTest(SupportedLanguages lang) { this.StartFunctionHost(nameof(AddProductColumnTypes), lang, true); diff --git a/test/Integration/test-js/AddProductColumnTypes/index.js b/test/Integration/test-js/AddProductColumnTypes/index.js index 8d83ac300..465bb67ab 100644 --- a/test/Integration/test-js/AddProductColumnTypes/index.js +++ b/test/Integration/test-js/AddProductColumnTypes/index.js @@ -5,8 +5,8 @@ module.exports = async function (context, req) { const product = { "productId": req.query.productId, - "datetime": Date.now(), - "datetime2": Date.now() + "datetime": new Date().toISOString(), + "datetime2": new Date().toISOString() }; context.bindings.product = JSON.stringify(product);