Skip to content

Commit 9bb5ac3

Browse files
author
Ryan Nowak
committed
Re-enable components E2E tests on the CI
1 parent d52d7e3 commit 9bb5ac3

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Linq;
88
using System.Reflection;
9+
using System.Runtime.ExceptionServices;
910
using System.Threading;
1011

1112
namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
@@ -52,13 +53,30 @@ protected static void RunInBackgroundThread(Action action)
5253
{
5354
var isDone = new ManualResetEvent(false);
5455

56+
ExceptionDispatchInfo edi = null;
5557
new Thread(() =>
5658
{
57-
action();
59+
try
60+
{
61+
action();
62+
}
63+
catch (Exception ex)
64+
{
65+
edi = ExceptionDispatchInfo.Capture(ex);
66+
}
67+
5868
isDone.Set();
5969
}).Start();
6070

61-
isDone.WaitOne();
71+
if (!isDone.WaitOne(TimeSpan.FromSeconds(10)))
72+
{
73+
throw new TimeoutException("Timed out waiting for: " + action);
74+
}
75+
76+
if (edi != null)
77+
{
78+
throw edi.SourceException;
79+
}
6280
}
6381
}
6482
}

src/Components/test/E2ETest/Infrastructure/ServerFixtures/WebHostServerFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public override void Dispose()
2424
{
2525
// This can be null if creating the webhost throws, we don't want to throw here and hide
2626
// the original exception.
27+
Host?.Dispose();
2728
Host?.StopAsync();
2829
}
2930

src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
<TargetFramework>netcoreapp3.0</TargetFramework>
88
<TestGroupName>Components.E2ETests</TestGroupName>
99

10-
<SkipTests Condition="$(ContinuousIntegrationBuild) == 'true'" >true</SkipTests>
1110
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
1211
<BuildHelixPayload>false</BuildHelixPayload>
12+
13+
<!-- Run on platforms where we support Selenium -->
14+
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>
1315

1416
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
1517
<BaseOutputPath />
18+
19+
1620
<OutputPath />
1721

1822
</PropertyGroup>

0 commit comments

Comments
 (0)