Skip to content

Commit 9ad45c6

Browse files
authored
[automated] Merge branch 'release/9.0.3xx' => 'main' (#48577)
2 parents d75e58a + 0addfb2 commit 9ad45c6

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs

+14-12
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public async Task EndToEnd_NoAPI_ProjectType(string projectType, bool addPackage
587587
CommandResult commandResult = new DotnetCommand(
588588
_testOutput,
589589
"publish",
590-
"/p:PublishProfile=DefaultContainer",
590+
"/t:PublishContainer",
591591
"/p:RuntimeIdentifier=linux-x64",
592592
$"/p:ContainerBaseImage={DockerRegistryManager.FullyQualifiedBaseImageAspNet}",
593593
$"/p:ContainerRegistry={DockerRegistryManager.LocalRegistry}",
@@ -616,12 +616,14 @@ public async Task EndToEnd_NoAPI_ProjectType(string projectType, bool addPackage
616616
var containerName = $"test-container-1-{projectType}-{addPackageReference}";
617617
CommandResult processResult = ContainerCli.RunCommand(
618618
_testOutput,
619-
"--rm",
620-
"--name",
621-
containerName,
622-
"-P",
623-
"--detach",
624-
$"{DockerRegistryManager.LocalRegistry}/{imageName}:{imageTag}")
619+
[
620+
"--rm",
621+
"--name",
622+
containerName,
623+
"-P",
624+
..projectType != "console" ? ["--detach"] : new string[]{},
625+
$"{DockerRegistryManager.LocalRegistry}/{imageName}:{imageTag}"
626+
])
625627
.Execute();
626628
processResult.Should().Pass();
627629
Assert.NotNull(processResult.StdOut);
@@ -665,14 +667,13 @@ public async Task EndToEnd_NoAPI_ProjectType(string projectType, bool addPackage
665667
Assert.True(everSucceeded, $"{appUri}weatherforecast never responded.");
666668

667669
ContainerCli.StopCommand(_testOutput, appContainerId)
668-
.Execute()
669-
.Should().Pass();
670+
.Execute()
671+
.Should().Pass();
670672
}
671673
else if (projectType == "worker")
672674
{
673675
// the worker template needs a second to start up and emit the logs we are looking for
674676
await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false);
675-
var containerLogs =
676677
ContainerCli.LogsCommand(_testOutput, appContainerId)
677678
.Execute()
678679
.Should().Pass()
@@ -681,10 +682,11 @@ public async Task EndToEnd_NoAPI_ProjectType(string projectType, bool addPackage
681682
ContainerCli.StopCommand(_testOutput, appContainerId)
682683
.Execute()
683684
.Should().Pass();
685+
684686
}
685-
else
687+
else if (projectType == "console")
686688
{
687-
throw new NotImplementedException("Unknown project type");
689+
processResult.Should().Pass().And.HaveStdOutContaining("Hello, World!");
688690
}
689691

690692
newProjectDir.Delete(true);

0 commit comments

Comments
 (0)