Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show workload update notifications for workloads installed via Visual Studio #40705

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add tests for workload update and install affecting rollback install …
…state
  • Loading branch information
dsplaisted committed May 3, 2024
commit effb24fa29736d7b88975b93aeb9e8463019e53b
11 changes: 11 additions & 0 deletions src/Tests/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,16 @@ protected WorkloadSet ParseRollbackOutput(string output)

return WorkloadSet.FromJson(filteredOutput, defaultFeatureBand: new SdkFeatureBand(SdkInstallerVersion));
}

protected string GetWorkloadVersion()
{
var result = VM.CreateRunCommand("dotnet", "workload", "--version")
.WithIsReadOnly(true)
.Execute();

result.Should().Pass();

return result.StdOut;
}
}
}
29 changes: 28 additions & 1 deletion src/Tests/dotnet-MsiInstallation.Tests/MsiInstallerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void UpdateWithRollback()
InstallSdk();
InstallWorkload("wasm-tools");
ApplyRC1Manifests();

TestWasmWorkload();

// Second time applying same rollback file shouldn't do anything
Expand All @@ -220,6 +220,33 @@ public void InstallWithRollback()
TestWasmWorkload();
}

[Fact]
public void InstallShouldNotUpdatePinnedRollback()
{
InstallSdk();
ApplyRC1Manifests();
var workloadVersion = GetWorkloadVersion();

InstallWorkload("aspire");

GetWorkloadVersion().Should().Be(workloadVersion);
}

[Fact]
public void UpdateShouldUndoPinnedRollback()
{
InstallSdk();
ApplyRC1Manifests();
var workloadVersion = GetWorkloadVersion();

VM.CreateRunCommand("dotnet", "workload", "update")
.Execute()
.Should().Pass();

GetWorkloadVersion().Should().NotBe(workloadVersion);

}

[Fact]
public void ShouldNotShowRebootMessage()
{
Expand Down
11 changes: 0 additions & 11 deletions src/Tests/dotnet-MsiInstallation.Tests/WorkloadSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,6 @@ public void UpdateToWorkloadSetVersionWithManifestsNotAvailable()
GetWorkloadVersion().Should().Be(workloadVersionBeforeUpdate);
}

string GetWorkloadVersion()
{
var result = VM.CreateRunCommand("dotnet", "workload", "--version")
.WithIsReadOnly(true)
.Execute();

result.Should().Pass();

return result.StdOut;
}

string GetUpdateMode()
{
var result = VM.CreateRunCommand("dotnet", "workload", "config", "--update-mode")
Expand Down