Skip to content
8 changes: 6 additions & 2 deletions test/Integration/IntegrationTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Azure.WebJobs.Extensions.Sql.Tests.Common;
using Xunit;
using static Microsoft.Azure.WebJobs.Extensions.Sql.Telemetry.Telemetry;
using System.Linq;

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


/// <summary>
/// Host processes for Azure Function CLI.
/// </summary>
Expand All @@ -66,7 +66,11 @@ public IntegrationTestFixture()
private void StartFunctionHosts()
{
string binPath = TestUtils.GetPathToBin();
foreach (SupportedLanguages lang in Enum.GetValues(typeof(SupportedLanguages)))
// Only start CSharp host for CSharp only tests task to ensure code coverage shows in pipeline.
string languages = Environment.GetEnvironmentVariable("LANGUAGES_TO_TEST");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment here explaining why we're doing this? Will help make sure we don't break it in the future 😄

SupportedLanguages[] supportedLanguages = languages == null ? (SupportedLanguages[])Enum.GetValues(typeof(SupportedLanguages))
: languages.Split(',').Select(l => (SupportedLanguages)Enum.Parse(typeof(SupportedLanguages), l)).ToArray();
foreach (SupportedLanguages lang in supportedLanguages)
{
if (lang == SupportedLanguages.CSharp)
{
Expand Down