Skip to content

Commit f6b1ebe

Browse files
author
Jason Zhai
committed
Attempt to inject resolverFactory to avoid writing to read-only FS
1 parent 5994c00 commit f6b1ebe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/dotnet.Tests/CommandTests/Workload/Update/GivenDotnetWorkloadUpdate.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public void GivenWorkloadUpdateAcrossFeatureBandsItUpdatesPacks(bool userLocal)
257257
};
258258
Directory.CreateDirectory(Path.GetDirectoryName(installStatePath));
259259
File.WriteAllText(installStatePath, oldInstallState.ToString());
260-
new WorkloadConfigCommand(Parser.Instance.Parse(["dotnet", "workload", "config", "--update-mode", "manifests"])).Execute().Should().Be(0);
260+
new WorkloadConfigCommand(Parser.Instance.Parse(["dotnet", "workload", "config", "--update-mode", "manifests"]), workloadResolverFactory: workloadResolverFactory).Execute().Should().Be(0);
261261
updateCommand.Execute();
262262
var newInstallState = InstallStateContents.FromPath(installStatePath);
263263
newInstallState.Manifests.Should().BeNull();
@@ -539,10 +539,10 @@ public void ApplyRollbackAcrossFeatureBand(string existingSdkFeatureBand, string
539539
{
540540
new(new ManifestVersionUpdate(new ManifestId("mock-manifest"), new ManifestVersion("2.0.0"), newSdkFeatureBand), null),
541541
};
542-
(var dotnetPath, var updateCommand, var packInstaller, _, _, _) = GetTestInstallers(parseResult, manifestUpdates: manifestsToUpdate, sdkVersion: "6.0.300", identifier: existingSdkFeatureBand + newSdkFeatureBand, installedFeatureBand: existingSdkFeatureBand);
542+
(var dotnetPath, var updateCommand, var packInstaller, _, _, _, var resolverFactory) = GetTestInstallers(parseResult, manifestUpdates: manifestsToUpdate, sdkVersion: "6.0.300", identifier: existingSdkFeatureBand + newSdkFeatureBand, installedFeatureBand: existingSdkFeatureBand);
543543

544544
parseResult = Parser.Instance.Parse(["dotnet", "workload", "config", "--update-mode", "manifests"]);
545-
WorkloadConfigCommand configCommand = new(parseResult);
545+
WorkloadConfigCommand configCommand = new(parseResult, workloadResolverFactory: resolverFactory);
546546
configCommand.Execute().Should().Be(0);
547547
updateCommand.Execute()
548548
.Should().Be(0);

0 commit comments

Comments
 (0)