Skip to content

Commit affc098

Browse files
committed
Clean up skipped tests, remove per-test AddValidation
1 parent f017416 commit affc098

12 files changed

+26
-43
lines changed

src/Tests/CollectionRuleActions.UnitTests/ActionListExecutorTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public ActionListExecutorTests(ITestOutputHelper outputHelper)
4646
_outputHelper = outputHelper;
4747
}
4848

49-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
49+
[Fact]
5050
public async Task ActionListExecutor_AllActionsSucceed()
5151
{
5252
await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
@@ -73,16 +73,16 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
7373
await executor.ExecuteActions(context, startCallback, cancellationTokenSource.Token);
7474

7575
VerifyStartCallbackCount(waitForCompletion: false, callbackCount);
76-
}, TestValidatableTypes.AddValidation);
76+
});
7777
}
7878

79-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
79+
[Fact]
8080
public Task ActionListExecutor_SecondActionFail_DeferredCompletion()
8181
{
8282
return ActionListExecutor_SecondActionFail(waitForCompletion: false);
8383
}
8484

85-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
85+
[Fact]
8686
public Task ActionListExecutor_SecondActionFail_WaitedCompletion()
8787
{
8888
return ActionListExecutor_SecondActionFail(waitForCompletion: true);
@@ -119,7 +119,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
119119
Assert.Equal(string.Format(Strings.ErrorMessage_NonzeroExitCode, "1"), actionExecutionException.Message);
120120

121121
VerifyStartCallbackCount(waitForCompletion, callbackCount);
122-
}, TestValidatableTypes.AddValidation);
122+
});
123123
}
124124

125125
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/61379")]
@@ -165,7 +165,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
165165
Assert.Equal(string.Format(Strings.ErrorMessage_NonzeroExitCode, "1"), actionExecutionException.Message);
166166

167167
VerifyStartCallbackCount(waitForCompletion, callbackCount);
168-
}, TestValidatableTypes.AddValidation);
168+
});
169169
}
170170

171171

@@ -187,7 +187,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
187187
}, serviceCollection =>
188188
{
189189
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
190-
TestValidatableTypes.AddValidation(serviceCollection);
191190
});
192191
}
193192
private static void VerifyStartCallbackCount(bool waitForCompletion, int callbackCount)

src/Tests/CollectionRuleActions.UnitTests/CollectDumpActionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ await runner.ExecuteAsync(async () =>
101101

102102
await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
103103
});
104-
}, TestValidatableTypes.AddValidation);
104+
});
105105
}
106106
}
107107
}

src/Tests/CollectionRuleActions.UnitTests/CollectGCDumpActionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ await runner.ExecuteAsync(async () =>
104104

105105
await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
106106
});
107-
}, TestValidatableTypes.AddValidation);
107+
});
108108
}
109109

110110
private static async Task ValidateGCDump(Stream gcdumpStream)

src/Tests/CollectionRuleActions.UnitTests/CollectLiveMetricsActionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ await LiveMetricsTestUtilities.ValidateMetrics(new[] { providerName },
111111

112112
await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
113113
});
114-
}, TestValidatableTypes.AddValidation);
114+
});
115115
}
116116

117117
[Theory(Skip = "Flaky")]

src/Tests/CollectionRuleActions.UnitTests/CollectTraceActionTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
5555
}, async host =>
5656
{
5757
await PerformTrace(host, tfm);
58-
}, TestValidatableTypes.AddValidation);
58+
});
5959
}
6060

6161
[Theory]
@@ -79,8 +79,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
7979
options.Duration = TimeSpan.FromSeconds(2);
8080
})
8181
.SetStartupTrigger();
82-
}, host => PerformTrace(host, tfm),
83-
TestValidatableTypes.AddValidation);
82+
}, host => PerformTrace(host, tfm));
8483
}
8584

8685
[Fact]
@@ -100,8 +99,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
10099
options.Duration = TimeSpan.FromSeconds(2);
101100
})
102101
.SetStartupTrigger();
103-
}, host => PerformTrace(host, TargetFrameworkMoniker.Current, artifactName),
104-
TestValidatableTypes.AddValidation);
102+
}, host => PerformTrace(host, TargetFrameworkMoniker.Current, artifactName));
105103
}
106104

107105
private async Task PerformTrace(IHost host, TargetFrameworkMoniker tfm, string artifactName = null)

src/Tests/CollectionRuleActions.UnitTests/EnvironmentVariableActionTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public EnvironmentVariableActionTests(ITestOutputHelper outputHelper)
4141
/// <remarks>
4242
/// The required APIs only exist on .NET 6.0+
4343
/// </remarks>
44-
[Theory(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
44+
[Theory]
4545
[MemberData(nameof(ActionTestsHelper.GetTfms), MemberType = typeof(ActionTestsHelper))]
4646
public async Task TestSetEnvVar(TargetFrameworkMoniker tfm)
4747
{
@@ -79,7 +79,7 @@ await runner.ExecuteAsync(async () =>
7979

8080
await runner.SendCommandAsync(TestAppScenarios.EnvironmentVariables.Commands.ShutdownScenario);
8181
});
82-
}, TestValidatableTypes.AddValidation);
82+
});
8383
}
8484

8585
/// <summary>
@@ -88,7 +88,7 @@ await runner.ExecuteAsync(async () =>
8888
/// <remarks>
8989
/// The required APIs only exist on .NET 6.0+
9090
/// </remarks>
91-
[Theory(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
91+
[Theory]
9292
[MemberData(nameof(ActionTestsHelper.GetTfms), MemberType = typeof(ActionTestsHelper))]
9393
public async Task TestGetEnvVar(TargetFrameworkMoniker tfm)
9494
{
@@ -145,7 +145,7 @@ await runner.ExecuteAsync(async () =>
145145

146146
await runner.SendCommandAsync(TestAppScenarios.EnvironmentVariables.Commands.ShutdownScenario);
147147
});
148-
}, TestValidatableTypes.AddValidation);
148+
});
149149
}
150150

151151
/// <summary>
@@ -155,7 +155,7 @@ await runner.ExecuteAsync(async () =>
155155
/// <remarks>
156156
/// The required APIs only exist on .NET 6.0+
157157
/// </remarks>
158-
[Theory(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
158+
[Theory]
159159
[MemberData(nameof(ActionTestsHelper.GetTfms), MemberType = typeof(ActionTestsHelper))]
160160
public async Task TestEnvVarRoundTrip(TargetFrameworkMoniker tfm)
161161
{
@@ -199,7 +199,7 @@ await runner.ExecuteAsync(async () =>
199199
Assert.True(getResult.OutputValues.TryGetValue(CollectionRuleActionConstants.EnvironmentVariableValueName, out string value));
200200
Assert.Equal(DefaultVarValue, value);
201201
});
202-
}, TestValidatableTypes.AddValidation);
202+
});
203203
}
204204
}
205205
}

src/Tests/CollectionRuleActions.UnitTests/ExecuteActionTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public ExecuteActionTests(ITestOutputHelper outputHelper, ExecuteActionFixture f
4141
_fixture = fixture;
4242
}
4343

44-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
44+
[Fact]
4545
public async Task ExecuteAction_ZeroExitCode()
4646
{
4747
await ValidateAction(
@@ -60,7 +60,7 @@ await ValidateAction(
6060
});
6161
}
6262

63-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
63+
[Fact]
6464
public async Task ExecuteAction_NonzeroExitCode()
6565
{
6666
await ValidateAction(
@@ -80,7 +80,7 @@ await ValidateAction(
8080
});
8181
}
8282

83-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
83+
[Fact]
8484
public async Task ExecuteAction_TokenCancellation()
8585
{
8686
// This timeout is much shorter than the default test timeout.
@@ -107,7 +107,7 @@ await Assert.ThrowsAsync<TaskCanceledException>(
107107
});
108108
}
109109

110-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
110+
[Fact]
111111
public async Task ExecuteAction_TextFileOutput()
112112
{
113113
using TemporaryDirectory outputDirectory = new(_outputHelper);
@@ -134,7 +134,7 @@ await ValidateAction(
134134
Assert.Equal(testMessage, File.ReadAllText(textFileOutputPath));
135135
}
136136

137-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
137+
[Fact]
138138
public async Task ExecuteAction_InvalidPath()
139139
{
140140
string uniquePathName = Guid.NewGuid().ToString();
@@ -154,7 +154,7 @@ await ValidateAction(
154154
});
155155
}
156156

157-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/pull/61402")]
157+
[Fact]
158158
public async Task ExecuteAction_IgnoreExitCode()
159159
{
160160
await ValidateAction(

src/Tests/CollectionRuleActions.UnitTests/LoadProfilerActionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ await runner.ExecuteAsync(async () =>
7373

7474
await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
7575
});
76-
}, TestValidatableTypes.AddValidation);
76+
});
7777
}
7878

7979
/// <summary>

src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ActionDependencyAnalyzerTests.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
136136
}, serviceCollection =>
137137
{
138138
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
139-
TestValidatableTypes.AddValidation(serviceCollection);
140139
});
141140
}
142141

@@ -177,7 +176,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
177176
}, serviceCollection =>
178177
{
179178
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
180-
TestValidatableTypes.AddValidation(serviceCollection);
181179
});
182180
}
183181

@@ -216,7 +214,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
216214
{
217215
serviceCollection.AddSingleton<TimeProvider, MockTimeProvider>();
218216
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
219-
TestValidatableTypes.AddValidation(serviceCollection);
220217
});
221218
}
222219

@@ -261,7 +258,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
261258
}, serviceCollection =>
262259
{
263260
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
264-
TestValidatableTypes.AddValidation(serviceCollection);
265261
}, loggingBuilder =>
266262
{
267263
loggingBuilder.AddProvider(new TestLoggerProvider(record));
@@ -299,7 +295,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
299295
}, serviceCollection =>
300296
{
301297
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
302-
TestValidatableTypes.AddValidation(serviceCollection);
303298
});
304299
}
305300

@@ -362,7 +357,6 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
362357
}, serviceCollection =>
363358
{
364359
serviceCollection.RegisterCollectionRuleAction<PassThroughActionFactory, PassThroughOptions, PassThroughActionDescriptor>();
365-
TestValidatableTypes.AddValidation(serviceCollection);
366360
});
367361
}
368362
}

src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/CollectionRuleDefaultsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
7373
() => ActionTestsHelper.GetActionOptions<OptionsValidationException>(host, DefaultRuleName));
7474

7575
Assert.Equal(string.Format(OptionsDisplayStrings.ErrorMessage_NoDefaultEgressProvider), invalidOptionsException.Message);
76-
}, TestValidatableTypes.AddValidation);
76+
});
7777
}
7878

7979
[Fact]

0 commit comments

Comments
 (0)