Re-enable test parallelization. Fixes #63.

This commit is contained in:
Steve Sanderson 2017-11-20 10:58:56 +00:00
parent f79fa6e110
commit 7961894771
2 changed files with 8 additions and 5 deletions

View File

@ -15,6 +15,8 @@ namespace Templates.Test
{
public class TemplateTestBase : IDisposable
{
private static object DotNetNewLock = new object();
protected string ProjectName { get; set; }
protected string TemplateOutputDir { get; private set; }
protected ITestOutputHelper Output { get; private set; }
@ -63,7 +65,12 @@ namespace Templates.Test
args += $" -lang {language}";
}
ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args).WaitForExit(assertSuccess: true);
// Only run one instance of 'dotnet new' at once, as a workaround for
// https://github.com/aspnet/templating/issues/63
lock (DotNetNewLock)
{
ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args).WaitForExit(assertSuccess: true);
}
}
protected void RunNpmInstall()

View File

@ -1,4 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
[assembly: Xunit.CollectionBehavior(DisableTestParallelization = true)]