Skip to content

Commit f3eafb0

Browse files
authored
Fix code coverage in trigger branch (#880)
* run only csharp test task * comment out trigger tests * don't start func hosts in the beginning * start three functions in beginning * start only csharp host * fix build error * start both csharp and java hosts * start only csharp and oop hosts * add logging for disposefunctionhosts * start only csharp host * revert commented out code * add comment
1 parent 1a0fe10 commit f3eafb0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/Integration/IntegrationTestFixture.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Microsoft.Azure.WebJobs.Extensions.Sql.Tests.Common;
1010
using Xunit;
1111
using static Microsoft.Azure.WebJobs.Extensions.Sql.Telemetry.Telemetry;
12+
using System.Linq;
1213

1314
namespace Microsoft.Azure.WebJobs.Extensions.Sql.Tests.Integration
1415
{
@@ -47,7 +48,6 @@ public class IntegrationTestFixture : IDisposable
4748
/// </summary>
4849
private readonly List<string> TestFunctions = new() { "GetProductsColumnTypesSerialization", "AddProductColumnTypes", "AddProductExtraColumns", "AddProductMissingColumns", "AddProductMissingColumnsExceptionFunction", "AddProductsNoPartialUpsert", "AddProductIncorrectCasing", "AddProductDefaultPKAndDifferentColumnOrder" };
4950

50-
5151
/// <summary>
5252
/// Host processes for Azure Function CLI.
5353
/// </summary>
@@ -66,7 +66,11 @@ public IntegrationTestFixture()
6666
private void StartFunctionHosts()
6767
{
6868
string binPath = TestUtils.GetPathToBin();
69-
foreach (SupportedLanguages lang in Enum.GetValues(typeof(SupportedLanguages)))
69+
// Only start CSharp host for CSharp only tests task to ensure code coverage shows in pipeline.
70+
string languages = Environment.GetEnvironmentVariable("LANGUAGES_TO_TEST");
71+
SupportedLanguages[] supportedLanguages = languages == null ? (SupportedLanguages[])Enum.GetValues(typeof(SupportedLanguages))
72+
: languages.Split(',').Select(l => (SupportedLanguages)Enum.Parse(typeof(SupportedLanguages), l)).ToArray();
73+
foreach (SupportedLanguages lang in supportedLanguages)
7074
{
7175
if (lang == SupportedLanguages.CSharp)
7276
{

0 commit comments

Comments
 (0)