Skip to content

Commit

Permalink
Add traits for e2e tests to use in final pipeline (#3841)
Browse files Browse the repository at this point in the history
* adding trait for e2e tests to use in final pipeline

* test changes

* removing duplicate test

* fixing tests

* trying to filter tests again

* addressing comments

* adding extra label

* changing spacing back

* trying spacing again

* changing spacing back

* four spaces

* adding trait

* getting build to work

* removing constant

* addressing comments

* group trait
  • Loading branch information
aishwaryabh committed Nov 6, 2024
1 parent e5353d3 commit d6698e5
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Azure.Functions.Cli\Azure.Functions.Cli.csproj" />
</ItemGroup>

<PropertyGroup>
<RunSettingsFilePath>$(MSBuildProjectDirectory)\E2E\StartTests_default.runsettings</RunSettingsFilePath>
</PropertyGroup>
</Project>
29 changes: 29 additions & 0 deletions test/Azure.Functions.Cli.Tests/E2E/Helpers/TestTraits.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Azure.Functions.Cli.Tests.E2E.Helpers
{
internal static class TestTraits
{
/// <summary>
/// Defines a group of tests to be run together. Useful for test isolation.
/// </summary>
public const string Group = "Group";

// Groups
/// <summary>
/// Tests with RequiresNestedInProcArtifacts label will not be run in the default scenario and only in the artifact consolidation pipeline
/// Otherwise tests with this label will fail in the PR/ official core tools pipelines since the nested inproc artifacts are not present.
/// </summary>
public const string RequiresNestedInProcArtifacts = "RequiresNestedInProcArtifacts";

/// <summary>
/// Tests with UseInConsolidatedArtifactGeneration label will be used in the default scenario and in the artifact consolidation pipeline
/// We still want to run these tests in the PR/ official core tools pipelines and in the artifact consolidation pipeline for a sanity check before publishing the artifacts.
/// </summary>
public const string UseInConsolidatedArtifactGeneration = "UseInConsolidatedArtifactGeneration";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<TestCaseFilter>(Group = RequiresNestedInProcArtifacts | Group = UseInConsolidatedArtifactGeneration)</TestCaseFilter>
</RunConfiguration>
</RunSettings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<TestCaseFilter>(Group != RequiresNestedInProcArtifacts)</TestCaseFilter>
</RunConfiguration>
</RunSettings>

0 comments on commit d6698e5

Please sign in to comment.