Skip to content

Commit 105e8f0

Browse files
committed
Add ability to have all the failed tests
1 parent 4ed83d8 commit 105e8f0

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.github/workflows/dispatched-sqlite-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
required: false
1414
default: ''
1515
type: string
16+
show_all_fails:
17+
description: 'No mute tests'
18+
type: boolean
19+
default: false
20+
required: true
1621
sqlite3:
1722
description: 'SQLite 3'
1823
type: boolean
@@ -43,6 +48,7 @@ jobs:
4348
target_framework: ${{ matrix.net }}
4449
specific_sha: ${{ inputs.specific_sha }}
4550
fetch_depth: ${{ fromJSON(inputs.fetch_depth) }}
51+
show_all_fails: ${{ fromJSON(inputs.show_all_fails) }}
4652
test_output_verbosity: minimal
4753
test_run_timeout: 30
4854
run_main: true

.github/workflows/reusable-storage-dependant-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
required: false
2929
default: 1
3030
type: number
31+
show_all_fails:
32+
description: 'No mute tests'
33+
type: boolean
34+
default: false
35+
required: true
3136
test_output_verbosity:
3237
description: 'Verbosity for dotnet test command'
3338
required: true
@@ -81,6 +86,7 @@ jobs:
8186
REQUIRES_DOCKER: ${{ inputs.storage != 'sqlite3' }} #sqlite3 exists within runner
8287
DOCKER_SCRIPT_KEY: ''
8388
TEST_RESULTS_FOLDER: _Build/tests/${{ inputs.build_config }}/${{ inputs.target_framework }}/${{ inputs.storage }}
89+
GA_NO_IGNORE: ${{ inputs.show_all_fails }}
8490

8591
steps:
8692
- name: Downgrade OpenSSL

Orm/Xtensive.Orm.Tests.Framework/NUnitFrameworkExtensions/IgnoreIfGithubActionsAttribute.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ protected override void OnAfterTestCheck(ITest test)
120120

121121
private void Check()
122122
{
123+
if (TestInfo.NoIgnoreOnGithubActions) {
124+
return;
125+
}
123126
if (Provider.HasValue && !StorageProviderInfo.Instance.CheckProviderIs(Provider.Value)) {
124127
return;
125128
}
126-
127129
if (TriggerEvent.HasValue && TriggerEvent != TestInfo.GithubActionTrigger) {
128130
return;
129131
}

Orm/Xtensive.Orm.Tests.Framework/TestInfo.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static class TestInfo
3333
{
3434
private static readonly bool isBuildServer;
3535
private static readonly bool isGithubActions;
36+
private static readonly bool noIgnoreOnGithubActions;
37+
3638
private static readonly GithubActionsEvents? githubActionsTriggeredBy;
3739

3840
/// <summary>
@@ -63,6 +65,11 @@ public static class TestInfo
6365
/// </summary>
6466
public static bool IsGithubActions => isGithubActions;
6567

68+
/// <summary>
69+
/// In case of run on GinHubActions, no test ignore happens in <see cref="IgnoreIfGithubActionsAttribute"/> nor <see cref="IgnoreOnGithubActionsIfFailedAttribute"/>
70+
/// </summary>
71+
public static bool NoIgnoreOnGithubActions => noIgnoreOnGithubActions;
72+
6673
/// <summary>
6774
/// Gets the event that triggered test run within Github Actions environment.
6875
/// </summary>
@@ -101,7 +108,8 @@ private static IEnumerable<T> GetMethodAttributes<T>() where T : Attribute
101108
static TestInfo()
102109
{
103110
isBuildServer = Environment.GetEnvironmentVariable("TEAMCITY_VERSION") != null;
104-
isGithubActions = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null;
111+
isGithubActions = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE").Equals("true", StringComparison.OrdinalIgnoreCase);
112+
noIgnoreOnGithubActions = isGithubActions && Environment.GetEnvironmentVariable("GA_NO_IGNORE").Equals("true", StringComparison.OrdinalIgnoreCase);
105113
githubActionsTriggeredBy = TryParseGithubEventName(Environment.GetEnvironmentVariable("GITHUB_EVENT_NAME"));
106114
}
107115
}

0 commit comments

Comments
 (0)