Re-enable components E2E tests on the CI

This commit is contained in:
Ryan Nowak 2019-07-31 20:12:23 -07:00 committed by Ryan Nowak
parent a69555ad96
commit 352df35864
3 changed files with 26 additions and 3 deletions

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Threading;
namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
@ -52,13 +53,30 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
{
var isDone = new ManualResetEvent(false);
ExceptionDispatchInfo edi = null;
new Thread(() =>
{
action();
try
{
action();
}
catch (Exception ex)
{
edi = ExceptionDispatchInfo.Capture(ex);
}
isDone.Set();
}).Start();
isDone.WaitOne();
if (!isDone.WaitOne(TimeSpan.FromSeconds(10)))
{
throw new TimeoutException("Timed out waiting for: " + action);
}
if (edi != null)
{
throw edi.SourceException;
}
}
}
}

View File

@ -24,6 +24,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
{
// This can be null if creating the webhost throws, we don't want to throw here and hide
// the original exception.
Host?.Dispose();
Host?.StopAsync();
}

View File

@ -7,12 +7,16 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>Components.E2ETests</TestGroupName>
<SkipTests Condition="$(ContinuousIntegrationBuild) == 'true'" >true</SkipTests>
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
<BuildHelixPayload>false</BuildHelixPayload>
<!-- Run on platforms where we support Selenium -->
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<BaseOutputPath />
<OutputPath />
</PropertyGroup>