Skip to content

Commit 2807892

Browse files
committed
Update VM tests to install required runtimes
1 parent 3878491 commit 2807892

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/Tests/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,23 @@ protected void InstallSdk(bool deployStage2 = true)
6666
.Should()
6767
.Pass();
6868

69-
VM.CreateRunCommand($@"c:\SdkTesting\{SdkInstallerFileName}", "/quiet")
70-
.WithDescription($"Install SDK {SdkInstallerVersion}")
69+
var sdkTestingDir = VM.GetRemoteDirectory(@"c:\SdkTesting");
70+
List<string> runtimeInstallers = new List<string>();
71+
string installerPrefix = "dotnet-runtime-";
72+
string installerSuffix = "-win-x64.exe";
73+
foreach (var file in sdkTestingDir.Files.Select(Path.GetFileName))
74+
{
75+
if (file.StartsWith(installerPrefix) && file.EndsWith(installerSuffix))
76+
{
77+
runtimeInstallers.Add(file);
78+
}
79+
}
80+
81+
VM.CreateActionGroup($"Install SDK {SdkInstallerVersion}",
82+
[
83+
VM.CreateRunCommand($@"c:\SdkTesting\{SdkInstallerFileName}", "/quiet"),
84+
..runtimeInstallers.Select(i => VM.CreateRunCommand($@"c:\SdkTesting\{i}", "/quiet"))
85+
])
7186
.Execute()
7287
.Should()
7388
.Pass();

0 commit comments

Comments
 (0)