Skip to content

Commit bc02e61

Browse files
Skip two failing tests and add SkipOnHelixCondition attribute (#38203)
* Skip SDK-dependent tests on Helix Add SkipOnHelixConditionAttribute to the ConditionalFact infrastructure in EFCore.Specification.Tests. Use it on Csproj_metadata_can_be_extracted and File_based_app_can_be_built since these tests require a full dotnet SDK which is not available on Helix agents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Skip SDK-dependent tests on Helix with SkipOnHelixCondition Add SkipOnHelixConditionAttribute to the ConditionalFact infrastructure in EFCore.Specification.Tests. Replace all inline HELIX_WORKITEM_ROOT checks across 31 SqlServer type test files and 2 dotnet-ef tests with the new [SkipOnHelixCondition] attribute. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Rename 'Validate Job Results' to 'Job Results' in pipelines Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d917719 commit bc02e61

36 files changed

Lines changed: 146 additions & 191 deletions

azure-pipelines-internal-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ extends:
623623
condition: always()
624624
jobs:
625625
- job: Validate_Job_Results
626-
displayName: Validate Job Results
626+
displayName: Job Results
627627
pool:
628628
name: $(DncEngInternalBuildPool)
629629
demands: ImageOverride -equals 1es-windows-2022

azure-pipelines-public.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ stages:
442442
condition: always()
443443
jobs:
444444
- job: Validate_Job_Results
445-
displayName: Validate Job Results
445+
displayName: Job Results
446446
pool:
447447
name: $(DncEngPublicBuildPool)
448448
demands: ImageOverride -equals 1es-windows-2022-open
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
5+
6+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
7+
public sealed class SkipOnHelixConditionAttribute : Attribute, ITestCondition
8+
{
9+
public ValueTask<bool> IsMetAsync()
10+
=> new(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is null);
11+
12+
public string SkipReason { get; set; } = "Test does not run on Helix.";
13+
}

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyCollectionTypeTest(SqlServerGeographyCollectionTypeTest.GeographyCollectionTypeFixture fixture, ITestOutputHelper testOutputHelper)
@@ -175,15 +177,11 @@ FROM [JsonTypeEntity] AS [j]
175177
}
176178
}
177179

180+
// TODO: Currently failing on Helix only, see #36746
178181
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
182+
[SkipOnHelixCondition]
179183
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
180184
{
181-
// TODO: Currently failing on Helix only, see #36746
182-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
183-
{
184-
return;
185-
}
186-
187185
await base.ExecuteUpdate_within_json_to_nonjson_column();
188186

189187
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyLineStringTypeTest(
@@ -169,15 +171,11 @@ FROM [JsonTypeEntity] AS [j]
169171
}
170172
}
171173

174+
// TODO: Currently failing on Helix only, see #36746
172175
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
176+
[SkipOnHelixCondition]
173177
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
174178
{
175-
// TODO: Currently failing on Helix only, see #36746
176-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
177-
{
178-
return;
179-
}
180-
181179
await base.ExecuteUpdate_within_json_to_nonjson_column();
182180

183181
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyMultiLineStringTypeTest(
@@ -173,15 +175,11 @@ FROM [JsonTypeEntity] AS [j]
173175
}
174176
}
175177

178+
// TODO: Currently failing on Helix only, see #36746
176179
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
180+
[SkipOnHelixCondition]
177181
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
178182
{
179-
// TODO: Currently failing on Helix only, see #36746
180-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
181-
{
182-
return;
183-
}
184-
185183
await base.ExecuteUpdate_within_json_to_nonjson_column();
186184

187185
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyMultiPointTypeTest(SqlServerGeographyMultiPointTypeTest.MultiPointTypeFixture fixture, ITestOutputHelper testOutputHelper)
@@ -175,15 +177,11 @@ FROM [JsonTypeEntity] AS [j]
175177
}
176178
}
177179

180+
// TODO: Currently failing on Helix only, see #36746
178181
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
182+
[SkipOnHelixCondition]
179183
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
180184
{
181-
// TODO: Currently failing on Helix only, see #36746
182-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
183-
{
184-
return;
185-
}
186-
187185
await base.ExecuteUpdate_within_json_to_nonjson_column();
188186

189187
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyMultiPolygonTypeTest(
@@ -173,15 +175,11 @@ FROM [JsonTypeEntity] AS [j]
173175
}
174176
}
175177

178+
// TODO: Currently failing on Helix only, see #36746
176179
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
180+
[SkipOnHelixCondition]
177181
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
178182
{
179-
// TODO: Currently failing on Helix only, see #36746
180-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
181-
{
182-
return;
183-
}
184-
185183
await base.ExecuteUpdate_within_json_to_nonjson_column();
186184

187185
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyPointTypeTest(SqlServerGeographyPointTypeTest.PointTypeFixture fixture, ITestOutputHelper testOutputHelper)
@@ -167,15 +169,11 @@ FROM [JsonTypeEntity] AS [j]
167169
}
168170
}
169171

172+
// TODO: Currently failing on Helix only, see #36746
170173
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
174+
[SkipOnHelixCondition]
171175
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
172176
{
173-
// TODO: Currently failing on Helix only, see #36746
174-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
175-
{
176-
return;
177-
}
178-
179177
await base.ExecuteUpdate_within_json_to_nonjson_column();
180178

181179
if (Fixture.UsingJsonType)

test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using NetTopologySuite.Geometries;
55

6+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
7+
68
namespace Microsoft.EntityFrameworkCore.Types.Geography;
79

810
public class SqlServerGeographyPolygonTypeTest(SqlServerGeographyPolygonTypeTest.PolygonTypeFixture fixture, ITestOutputHelper testOutputHelper)
@@ -167,15 +169,11 @@ FROM [JsonTypeEntity] AS [j]
167169
}
168170
}
169171

172+
// TODO: Currently failing on Helix only, see #36746
170173
[SqlServerCondition(SqlServerCondition.SupportsFunctions2022)]
174+
[SkipOnHelixCondition]
171175
public override async Task ExecuteUpdate_within_json_to_nonjson_column()
172176
{
173-
// TODO: Currently failing on Helix only, see #36746
174-
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null)
175-
{
176-
return;
177-
}
178-
179177
await base.ExecuteUpdate_within_json_to_nonjson_column();
180178

181179
if (Fixture.UsingJsonType)

0 commit comments

Comments
 (0)