parent
1c71752b1f
commit
e7385788b7
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env pwsh
|
||||
#requires -version 4
|
||||
|
||||
[CmdletBinding(PositionalBinding = $false)]
|
||||
param()
|
||||
|
||||
Set-StrictMode -Version 2
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
. $PSScriptRoot\Test-Template.ps1
|
||||
|
||||
Test-Template "worker" "worker" "Microsoft.DotNet.Web.ProjectTemplates.3.0.3.0.0-dev.nupkg" $false
|
||||
|
|
@ -179,7 +179,7 @@ namespace Templates.Test.Helpers
|
|||
return new AspNetProcess(Output, TemplateClientReleaseDir, projectDll, environment);
|
||||
}
|
||||
|
||||
internal AspNetProcess StartBuiltProjectAsync()
|
||||
internal AspNetProcess StartBuiltProjectAsync(bool hasListeningUri = true)
|
||||
{
|
||||
var environment = new Dictionary<string, string>
|
||||
{
|
||||
|
|
@ -188,10 +188,10 @@ namespace Templates.Test.Helpers
|
|||
};
|
||||
|
||||
var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
|
||||
return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment);
|
||||
return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, hasListeningUri: hasListeningUri);
|
||||
}
|
||||
|
||||
internal AspNetProcess StartPublishedProjectAsync()
|
||||
internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true)
|
||||
{
|
||||
var environment = new Dictionary<string, string>
|
||||
{
|
||||
|
|
@ -199,7 +199,7 @@ namespace Templates.Test.Helpers
|
|||
};
|
||||
|
||||
var projectDll = $"{ProjectName}.dll";
|
||||
return new AspNetProcess(Output, TemplatePublishDir, projectDll, environment);
|
||||
return new AspNetProcess(Output, TemplatePublishDir, projectDll, environment, hasListeningUri: hasListeningUri);
|
||||
}
|
||||
|
||||
internal async Task<ProcessEx> RestoreWithRetryAsync(ITestOutputHelper output, string workingDirectory)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Templates.Test
|
|||
public ProjectFactoryFixture ProjectFactory { get; }
|
||||
public ITestOutputHelper Output { get; }
|
||||
|
||||
[Fact(Skip = "Microsoft.NET.Sdk.Worker isn't available yet")]
|
||||
[Fact]
|
||||
public async Task WorkerTemplateAsync()
|
||||
{
|
||||
Project = await ProjectFactory.GetOrCreateProject("worker", Output);
|
||||
|
|
@ -38,14 +38,14 @@ namespace Templates.Test
|
|||
var buildResult = await Project.RunDotNetBuildAsync();
|
||||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", Project, buildResult));
|
||||
|
||||
using (var aspNetProcess = Project.StartBuiltProjectAsync())
|
||||
using (var aspNetProcess = Project.StartBuiltProjectAsync(hasListeningUri: false))
|
||||
{
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built project", Project, aspNetProcess.Process));
|
||||
}
|
||||
|
||||
using (var aspNetProcess = Project.StartPublishedProjectAsync())
|
||||
using (var aspNetProcess = Project.StartPublishedProjectAsync(hasListeningUri: false))
|
||||
{
|
||||
Assert.False(
|
||||
aspNetProcess.Process.HasExited,
|
||||
|
|
|
|||
Loading…
Reference in New Issue