2139 references to Path
Aspire.Hosting.Azure.EntraId.Tests (42)
EntraIdApiProvisioningTests.cs (5)
766using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 782workspace.Path, options, app.Services, NullLogger<AzurePublishingContext>.Instance, step); 786await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 787.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")), "bicep") 788.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep");
EntraIdAppRoleAssignmentTests.cs (5)
216using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 249workspace.Path, app.Services.GetRequiredService<IOptions<AzureProvisioningOptions>>().Value, 253await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 255.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")), "bicep") 256.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "worker", "worker.bicep")), "bicep");
EntraIdProvisioningTests.cs (29)
798using var first = entra.Resource.GetBicepTemplateFile(workspace.Path); 800using var second = entra.Resource.GetBicepTemplateFile(workspace.Path); 863var manifest = await ManifestUtils.GetManifest(entra.Resource, workspace.Path); 873using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 886workspace.Path, options, app.Services, NullLogger<AzurePublishingContext>.Instance, step); 890await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 891.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 898using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 909workspace.Path, 917await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 918.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 925using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 934workspace.Path, 945await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep"); 952using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 967workspace.Path, 975await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 976.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 983using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 998workspace.Path, 1006await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "web", "web.bicep")), "bicep"); 1013using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 1039workspace.Path, options, app.Services, NullLogger<AzurePublishingContext>.Instance, step); 1043var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1044var apiBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")); 1045var webBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")); 1046var consumerBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "consumer", "consumer.bicep")); 1047Assert.Equal(new[] { "consumer", "entra-api", "entra-web" }, Directory.GetDirectories(workspace.Path).Select(Path.GetFileName).Order()); 1665DistributedApplicationOperation.Publish, outputHelper, workspace.Path, step: WellKnownPipelineSteps.Deploy);
EntraIdStarterScenarioPublishTests.cs (3)
27var apiProject = CreateProject(workspace.Path, "aspire-entra.ApiService", 5101, 7101); 28var webProject = CreateProject(workspace.Path, "aspire-entra.Web", 5102, 7102); 29var outputPath = Path.Combine(workspace.Path, "out");
Aspire.Hosting.Azure.Kubernetes.Tests (36)
AzureKubernetesEnvironmentExtensionsTests.cs (30)
608var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 609var clusterBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 610var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "cluster-roles", "cluster-roles.bicep")); 818var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 819var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 820var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, roles.Name, $"{roles.Name}.bicep")); 821var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 822var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 823var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 824var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity-roles-aks-kubelet-identity", "aks-control-plane-identity-roles-aks-kubelet-identity.bicep")); 1033var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1034var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1035var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, roles.Name, $"{roles.Name}.bicep")); 1036var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 1131var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1132var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1133var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, operatorRole.Name, $"{operatorRole.Name}.bicep")); 1134var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-acr", "aks-acr.bicep")); 1135var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 1136var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 1137var registryRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, registryRole.Name, $"{registryRole.Name}.bicep")); 1221var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1222var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 1223var registryRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, registryRole.Name, $"{registryRole.Name}.bicep")); 1224var networkBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "network", "network.bicep")); 1225var networkRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, networkRole.Name, $"{networkRole.Name}.bicep")); 1226var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1227var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 1228var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 1230var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, operatorRoleName, $"{operatorRoleName}.bicep"));
AzureKubernetesFoundryReferenceTests.cs (1)
77var valuesPath = Directory.EnumerateFiles(workspace.Path, "values.yaml", SearchOption.AllDirectories).Single();
AzureKubernetesIngressTests.cs (1)
32var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
AzureKubernetesPersistentVolumeTests.cs (3)
40var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 92var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 96var statefulSetPath = Path.Combine(workspace.Path, "templates", "service", "statefulset.yaml");
AzureKubernetesTestBuilder.cs (1)
29.Create(operation, workspace.Path, step: step)
Aspire.Hosting.Azure.Kusto.Tests (2)
KustoFunctionalTests.cs (2)
247container.WithBindMount(workspace.Path, dbPath); 271return Directory.GetFileSystemEntries(workspace.Path, searchPattern, enumerationOptions);
Aspire.Hosting.Azure.Tests (104)
AzureApiManagementTests.cs (10)
387var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 423var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 881var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 915var documentPath = Path.Combine(workspace.Path, "deploy-only.json"); 939var documentPath = Path.Combine(workspace.Path, "deploy-only.json"); 966var documentPath = Path.Combine(workspace.Path, "generated.json"); 992var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 1086var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 2083workspace.Path); 2096var mainBicepPath = Path.Combine(workspace.Path, "main.bicep");
AzureAppServiceTests.cs (10)
239var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path, step: "validate-appservice-config-env"); 280var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path, step: "validate-appservice-config-env"); 312var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "validate-appservice-config-env"); 615var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 631var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 635var envBicepPath = Path.Combine(workspace.Path, "env", "env.bicep"); 639var apiBicepPath = Path.Combine(workspace.Path, "api", "api.bicep"); 811var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path, step: "publish-manifest"); 832Path.Combine(workspace.Path, "aspire-manifest.json"), 841var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path);
AzureBicepResourceTests.cs (4)
257var bicepFilePath = Path.Combine(workspace.Path, bicepFileName); 264var outputDir = Path.Combine(workspace.Path, "output"); 282var bicepFilePath = Path.Combine(workspace.Path, bicepFileName); 306var outputDir = Path.Combine(workspace.Path, "output");
AzureContainerAppEnvironmentExtensionsTests.cs (5)
552var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 565var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 569var envBicepPath = Path.Combine(workspace.Path, "env", "env.bicep"); 586var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 606Assert.True(File.Exists(Path.Combine(workspace.Path, "main.bicep")));
AzureContainerAppExpressEndpointTests.cs (2)
232using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path); 267Assert.True(File.Exists(Path.Combine(workspace.Path, "main.bicep")));
AzureContainerAppsTests.cs (11)
2020var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputHelper, workspace.Path, step: "publish-manifest"); 2038await VerifyFile(Path.Combine(workspace.Path, "aspire-manifest.json")); 2142workspace.Path, 2172workspace.Path, 2292workspace.Path, 2318workspace.Path, 2347workspace.Path, 2376workspace.Path, 2836File.WriteAllText(Path.Combine(workspace.Path, "Dockerfile"), "FROM alpine"); 2838builder.AddDockerfile("with-bind-mount", workspace.Path) 2839.WithBindMount(workspace.Path, "/app/data");
AzureEnvironmentResourceTests.cs (24)
56using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 93using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 305workspace.Path); 320var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep")); 328using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 365var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep")); 374using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 381var outputPath = Path.Combine(workspace.Path, "exclude-main"); 403using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 408var context = await CreatePublishingContextAsync(app, workspace.Path); 419Assert.True(File.Exists(Path.Combine(workspace.Path, resourceName, $"{resourceName}.bicep"))); 420var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 428using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 435var outputPath = Path.Combine(workspace.Path, "write-main"); 460using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 474var outputPath = Path.Combine(workspace.Path, "provider"); 523output, workspace.Path); 537var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 542var includedStorageBicepPath = Path.Combine(workspace.Path, "included-storage", "included-storage.bicep"); 546var excludedStorageBicepPath = Path.Combine(workspace.Path, "excluded-storage", "excluded-storage.bicep"); 556var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, output, workspace.Path); 568var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 581remoteInvokeOptions.StartInfo.WorkingDirectory = workspace.Path; 582using var handle = RemoteExecutor.Invoke(RunTest, workspace.Path, remoteInvokeOptions);
AzureFrontDoorAppServicePrivateLinkTests.cs (4)
20DistributedApplicationOperation.Publish, testOutputHelper, workspace.Path); 30await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep"); 31Assert.True(File.Exists(Path.Combine(workspace.Path, "api", "api.bicep"))); 32Assert.True(File.Exists(Path.Combine(workspace.Path, "frontdoor", "frontdoor.bicep")));
AzureFunctionsTests.cs (30)
308var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript); 331var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript); 356var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript) 380builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript); 406var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript) 433var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.JavaScript) 459builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript); 471using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 472var appDirectory = CreateNodeFunctionsAppDirectory(tempDir.Path, includePackageLock); 476var manifest = await ManifestUtils.GetManifest(funcApp.Resource, tempDir.Path); 505var dockerfilePath = Path.Combine(tempDir.Path, "funcapp.Dockerfile"); 525using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 526var appDirectory = CreateNodeFunctionsAppDirectory(tempDir.Path, includePackageLock); 530await ManifestUtils.GetManifest(funcApp.Resource, tempDir.Path); 544var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "funcapp.Dockerfile")); 557using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 558var appDirectory = CreateNodeFunctionsAppDirectory(tempDir.Path, includePackageLock: true); 563var manifest = await ManifestUtils.GetManifest(funcApp.Resource, tempDir.Path); 567Assert.False(File.Exists(Path.Combine(tempDir.Path, "funcapp.Dockerfile"))); 577using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 582var appDirectory = CreateNodeFunctionsAppDirectory(tempDir.Path, includePackageLock: true); 601var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.TypeScript); 615var funcApp = builder.AddAzureFunctionsApp("funcapp", tempDir.Path, AzureFunctionsLanguage.JavaScript); 966var projectPath = Path.Combine(workspace.Path, "TestFunctions.csproj"); 991var projectPath = Path.Combine(workspace.Path, "MyFunctions.csproj"); 1013var projectPath = Path.Combine(workspace.Path, "TestFunctions.csproj"); 1043var projectPath1 = Path.Combine(workspace.Path, "Functions1.csproj"); 1044var projectPath2 = Path.Combine(workspace.Path, "Functions2.csproj"); 1065var projectPath = Path.Combine(workspace.Path, "Functions.csproj"); 1095var projectPath = Path.Combine(workspace.Path, "Functions.csproj");
AzureSandboxesTests.cs (2)
211workspace.Path); 218var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep"));
JavaScriptPublishValidationTests.cs (2)
33builder.AddJavaScriptApp("js", workspace.Path) 37builder.AddNextJsApp("nextjs", workspace.Path).WithExternalHttpEndpoints();
Aspire.Hosting.Docker.Tests (145)
DockerComposePublisherTests.cs (104)
31using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-env"); 63await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env") 73using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 92await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")), "yaml").UseParameters(longNames); 105using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 128using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 148using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-env"); 170await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env").UseParameters(overridden); 177using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-env"); 199await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")), "yaml") 200.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env")), "env") 201.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env"); 210var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 285var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 286var envPath = Path.Combine(workspace.Path, ".env"); 298var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 308var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml")); 324var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 346var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 347var envPath = Path.Combine(workspace.Path, ".env"); 359var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 369var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml")); 370var environment = File.ReadAllText(Path.Combine(workspace.Path, ".env")); 379using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path) 394var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 404using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "publish-docker-compose") 423var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 432var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 474var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 476var envPath = Path.Combine(workspace.Path, ".env"); 487var envFilePath = Path.Combine(workspace.Path, ".env"); 491var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 518var envFilePath = Path.Combine(workspace.Path, ".env"); 522var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 559var envFilePath = Path.Combine(workspace.Path, ".env"); 562var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 578var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 592var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 604var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 618var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 633var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 650var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 665var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 681var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 696var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 709var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 722var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 743var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 754var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 767var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 782var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 795var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 811var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 825var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 839var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 854var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 867var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 886var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 898var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 911var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 923var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Run, workspace.Path); 935var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 944var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 962var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 972var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 991var envFilePath = Path.Combine(workspace.Path, ".env.Staging"); 1004var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1025var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1035var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1047var envFilePath = Path.Combine(workspace.Path, ".env.Production"); 1068var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1081var envFilePath = Path.Combine(workspace.Path, ".env.Staging"); 1098var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1114var composeContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")); 1115var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1125var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1147var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1156var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "prepare-docker-compose"); 1173var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1184var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1198var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1199var envPath = Path.Combine(workspace.Path, ".env"); 1212var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1225var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1241var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1256var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1257var envPath = Path.Combine(workspace.Path, ".env"); 1269var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1284var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1295var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1320var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1321var envPath = Path.Combine(workspace.Path, ".env"); 1334var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1368var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1369var envPath = Path.Combine(workspace.Path, ".env"); 1388var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1402var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1403var envPath = Path.Combine(workspace.Path, ".env"); 1415var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1446var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1456var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1480var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1490var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1508var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
DockerComposeTests.cs (25)
52using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 64var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 72using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 86var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 153var outputPath = Path.Combine(workspace.Path, "output"); 180var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 192var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 204var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 226var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 240var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 265var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 325var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: step); 352var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 379var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Diagnostics); 428var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: step); 694var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "push-servicea"); 725var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: "push-servicea"); 762var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Diagnostics); 810var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Diagnostics); 970["OutputPath"] = workspace.Path, 972["ComposeFilePath"] = Path.Combine(workspace.Path, "docker-compose.yaml") 976var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Destroy); 1013var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Destroy); 1045var deployBuilder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Deploy); 1069var destroyBuilder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path, step: WellKnownPipelineSteps.Destroy);
EnvFileTests.cs (16)
16var envFilePath = Path.Combine(workspace.Path, ".env"); 50var envFilePath = Path.Combine(workspace.Path, ".env"); 70var envFilePath = Path.Combine(workspace.Path, ".env"); 88var envFilePath = Path.Combine(workspace.Path, ".env"); 108var envFilePath = Path.Combine(workspace.Path, ".env"); 123var envFilePath = Path.Combine(workspace.Path, ".env"); 145var envFilePath = Path.Combine(workspace.Path, ".env"); 165var envFilePath = Path.Combine(workspace.Path, ".env"); 185var envFilePath = Path.Combine(workspace.Path, ".env"); 212var envFilePath = Path.Combine(workspace.Path, ".env"); 228var envFilePath = Path.Combine(workspace.Path, ".env"); 254var envFilePath = Path.Combine(workspace.Path, ".env"); 280var envFilePath = Path.Combine(workspace.Path, ".env"); 320var envFilePath = Path.Combine(workspace.Path, ".env"); 345var envFilePath = Path.Combine(workspace.Path, ".env"); 362var envFilePath = Path.Combine(workspace.Path, ".env");
Aspire.Hosting.Dotnet.Tests (348)
DotnetProjectBuildArtifactManagerTests.cs (7)
18var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 45var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 78var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 114var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 139var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 153var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 168var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
DotnetProjectBuildCoordinatorTests.cs (270)
46options => options.ProjectDirectory = workspace.Path, 108options => options.ProjectDirectory = workspace.Path, 111var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 139var globalJsonPath = Path.Combine(workspace.Path, "global.json"); 144options => options.ProjectDirectory = workspace.Path, 153var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 200options => options.ProjectDirectory = workspace.Path, 210var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 211var firstDotnetPath = Path.Combine(workspace.Path, "first-sdk"); 212var secondDotnetPath = Path.Combine(workspace.Path, "second-sdk"); 268options => options.ProjectDirectory = workspace.Path, 272var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 290var sharedProject = CreateSharedProject(workspace.Path); 291var projectPath = CreateConsoleProject(workspace.Path, "Api", sharedProject); 293options => options.ProjectDirectory = workspace.Path, 347options => options.ProjectDirectory = workspace.Path, 359var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 381options => options.ProjectDirectory = workspace.Path, 390var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 414options => options.ProjectDirectory = workspace.Path, 426var sharedProject = CreateSharedProject(workspace.Path); 427var projectPath = CreateConsoleProject(workspace.Path, "Api", sharedProject); 428var filePath = CreateFileApp(workspace.Path, "Worker", sharedProject); 470options => options.ProjectDirectory = workspace.Path, 479var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 500options => options.ProjectDirectory = workspace.Path, 509var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 532options => options.ProjectDirectory = workspace.Path, 537var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 554options => options.ProjectDirectory = workspace.Path, 563var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 581options => options.ProjectDirectory = workspace.Path, 583var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 625var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 677var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 762options => options.ProjectDirectory = workspace.Path, 765var filePath = Path.Combine(workspace.Path, "worker.cs"); 772Path.Combine(workspace.Path, "artifacts"); 794var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 821options => options.ProjectDirectory = workspace.Path, 824var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 825var fileDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "worker")); 910options => options.ProjectDirectory = workspace.Path, 912var sharedProject = CreateSharedProject(workspace.Path); 913var firstPath = CreateFileApp(workspace.Path, "First", sharedProject); 914var secondPath = CreateFileApp(workspace.Path, "Second", sharedProject); 915var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt"); 916var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 985var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 1072options => options.ProjectDirectory = workspace.Path, 1074var firstProject = CreateProject(workspace.Path, "First's Project", "First.csproj"); 1075var secondProject = CreateProject(workspace.Path, "Second", "Second.csproj"); 1104var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 1105var customTargetsPath = Path.Combine(workspace.Path, "CustomNuGet.targets"); 1115workspace.Path, 1116Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1120workspace.Path, 1128WorkingDirectory = workspace.Path, 1159var projectPath = CreateProjectFile(workspace.Path, "Service", """ 1168workspace.Path, 1169Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1173workspace.Path, 1179var missingTargetsPath = Path.Combine(workspace.Path, "missing", "NuGet.targets"); 1182WorkingDirectory = workspace.Path, 1215using var builder = TestDistributedApplicationBuilder.Create(options => options.ProjectDirectory = workspace.Path, outputHelper); 1216var aspireStoreRoot = Path.Combine(workspace.Path, "custom-obj"); 1218var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1234var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 1235var buildDirectory = Path.Combine(workspace.Path, "obj", ".aspire", "build"); 1236using var unified = new DotnetProjectBuildResource("unified", workspace.Path, buildDirectory, TimeProvider.System); 1237using var individual = new DotnetProjectBuildResource("individual", workspace.Path, buildDirectory, TimeProvider.System); 1238unified.ConfigureTraversalBuild([projectPath], workspace.Path, buildConfiguration: null, restoreProjectsIndividually: false); 1239individual.ConfigureTraversalBuild([projectPath], workspace.Path, buildConfiguration: null, restoreProjectsIndividually: true); 1257options => options.ProjectDirectory = workspace.Path, 1259var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 1356workspace.Path, 1357Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1361workspace.Path, 1408var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 1443var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 1502options => options.ProjectDirectory = workspace.Path, 1504var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1505var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1525options => options.ProjectDirectory = workspace.Path, 1527var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1528var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1548options => options.ProjectDirectory = workspace.Path, 1550var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1551var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1577options => options.ProjectDirectory = workspace.Path, 1579var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1580var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1599options => options.ProjectDirectory = workspace.Path, 1601var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1602var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1625options => options.ProjectDirectory = workspace.Path, 1643var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1663options => options.ProjectDirectory = workspace.Path, 1665var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1692options => options.ProjectDirectory = workspace.Path, 1695var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 1696var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1751options => options.ProjectDirectory = workspace.Path, 1753var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1787options => options.ProjectDirectory = workspace.Path, 1789var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1826options => options.ProjectDirectory = workspace.Path, 1829var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1877options => options.ProjectDirectory = workspace.Path, 1880var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 1947var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 1995options => options.ProjectDirectory = workspace.Path, 1997var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2041options => options.ProjectDirectory = workspace.Path, 2044var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2097options => options.ProjectDirectory = workspace.Path, 2100var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2155options => options.ProjectDirectory = workspace.Path, 2158var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2216var projectPath = CreateBrokenProject(workspace.Path, "COORDINATED_BUILD_MARKER"); 2223options.ProjectDirectory = workspace.Path; 2266options => options.ProjectDirectory = workspace.Path, 2268var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2318options => options.ProjectDirectory = workspace.Path, 2320var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2352options => options.ProjectDirectory = workspace.Path, 2354var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2392options => options.ProjectDirectory = workspace.Path, 2394var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2463options => options.ProjectDirectory = workspace.Path, 2465var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 2466var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2493options => options.ProjectDirectory = workspace.Path, 2495var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2516options => options.ProjectDirectory = workspace.Path, 2518var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2538options => options.ProjectDirectory = workspace.Path, 2540var appPath = Path.Combine(workspace.Path, "app.cs"); 2558options => options.ProjectDirectory = workspace.Path, 2560var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2599options => options.ProjectDirectory = workspace.Path, 2601var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2729options => options.ProjectDirectory = workspace.Path, 2731var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2810options => options.ProjectDirectory = workspace.Path, 2812var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2861options => options.ProjectDirectory = workspace.Path, 2863var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2931options => options.ProjectDirectory = workspace.Path, 2933var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 2960options => options.ProjectDirectory = workspace.Path, 2962var apiPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 2963var workerPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 3001var workspaceRoot = PathNormalizer.ResolvePathCasing(workspace.Path); 3057options => options.ProjectDirectory = workspace.Path, 3059var projectPath = CreateProject(workspace.Path, "Worker", "Worker.csproj"); 3061var firstSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-1")).FullName; 3062var secondSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-2")).FullName; 3107options => options.ProjectDirectory = workspace.Path, 3109var sourceRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName; 3113var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")).FullName; 3132options => options.ProjectDirectory = workspace.Path, 3135Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName, 3139var foreignRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "foreign")).FullName; 3167options => options.ProjectDirectory = workspace.Path, 3169var activePath = CreateProject(workspace.Path, "Active", "Active.csproj"); 3170var removedPath = CreateProject(workspace.Path, "Removed", "Removed.csproj"); 3191options => options.ProjectDirectory = workspace.Path, 3193var activePath = CreateProject(workspace.Path, "Active", "Active.csproj"); 3194var replacedPath = CreateProject(workspace.Path, "Replaced", "Replaced.csproj"); 3201@event.Model.Resources[index] = new ExecutableResource(replaced.Resource.Name, "dotnet", workspace.Path); 3217options => options.ProjectDirectory = workspace.Path, 3219var projectPath = CreateProject(workspace.Path, "Project", "Project.csproj"); 3220var filePath = Path.Combine(workspace.Path, "worker.cs"); 3267options => options.ProjectDirectory = workspace.Path, 3269var firstPath = CreateProject(workspace.Path, "First", "First.csproj"); 3270var secondPath = CreateProject(workspace.Path, "Second", "Second.csproj"); 3314options => options.ProjectDirectory = workspace.Path, 3316var physicalRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "Physical")); 3326var linkPath = Path.Combine(workspace.Path, "Alias"); 3337var otherProjectPath = CreateProject(workspace.Path, "Other", "Other.csproj"); 3364options => options.ProjectDirectory = workspace.Path, 3366var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3388options => options.ProjectDirectory = workspace.Path, 3390var removedProjectPath = CreateProject(workspace.Path, "Removed", "Removed.csproj"); 3397var activeProjectPath = CreateProject(workspace.Path, "Active", "Active.csproj"); 3418options => options.ProjectDirectory = workspace.Path, 3420var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3448options => options.ProjectDirectory = workspace.Path, 3450var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3481options => options.ProjectDirectory = workspace.Path, 3483var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3514options => options.ProjectDirectory = workspace.Path, 3516var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3539options => options.ProjectDirectory = workspace.Path, 3541var projectPath = CreateProject(workspace.Path, "Service", "Service.csproj"); 3542var removedPath = CreateProject(workspace.Path, "Removed", "Removed.csproj"); 3543var missingPath = Path.Combine(workspace.Path, "Missing", "Missing.csproj"); 3566options => options.ProjectDirectory = workspace.Path, 3568var firstPath = CreateProject(workspace.Path, "First", "First.csproj"); 3569var secondPath = CreateProject(workspace.Path, "Second", "Second.csproj"); 3625options => options.ProjectDirectory = workspace.Path, 3627var projectPath = CreateProject(workspace.Path, "Service", "App.csproj"); 3628var linkDirectory = Path.Combine(workspace.Path, "ServiceAlias"); 3667workspace.Path, 3668Path.Combine(workspace.Path, "obj", ".aspire", "build"), 3670buildResource.AddProject(CreateProject(workspace.Path, "Api", "Api.csproj")); 3717var sharedProject = CreateSharedProject(workspace.Path); 3718var apiProject = CreateConsoleProject(workspace.Path, "Api", sharedProject, extension); 3719var workerProject = CreateConsoleProject(workspace.Path, "Worker", sharedProject, workerExtension); 3720var escapedDirectory = Path.Combine(workspace.Path, "Api's Project 100% (test)"); 3723var apiSentinel = Path.Combine(workspace.Path, "api-ran.txt"); 3724var workerSentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 3727options => options.ProjectDirectory = workspace.Path, 3778var sharedProject = CreateSharedProject(workspace.Path); 3779var projectPath = CreateConsoleProject(workspace.Path, "Api", sharedProject); 3787var sentinels = Directory.CreateDirectory(Path.Combine(workspace.Path, "instances")).FullName; 3789options => options.ProjectDirectory = workspace.Path, 3844var projectPath = CreateBrokenProject(workspace.Path, "REPLICAS_BUILD_FAILED"); 3846options => options.ProjectDirectory = workspace.Path, 3878var firstProject = CreateSentinelProject(workspace.Path, "First", """ 3883var secondProject = CreateSentinelProject(workspace.Path, "Second", """ 3889var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt"); 3890var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 3893options => options.ProjectDirectory = workspace.Path, 3933var brokenProject = CreateBrokenProject(workspace.Path, "FIRST_BUILD_FAILED"); 3934var secondBuildMarker = Path.Combine(workspace.Path, "second-built.txt"); 3935var secondProject = CreateSentinelProject(workspace.Path, "Second", $$""" 3940var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 3943options => options.ProjectDirectory = workspace.Path, 3988var validProject = CreateProjectFile(workspace.Path, "Valid", """ 3999var sentinelPath = Path.Combine(workspace.Path, "valid-ran.txt"); 4000var missingProject = Path.Combine(workspace.Path, "Missing", "Missing.csproj"); 4003options => options.ProjectDirectory = workspace.Path, 4045options => options.ProjectDirectory = workspace.Path, 4053var missingPath = Path.Combine(workspace.Path, "Missing", $"Missing.{extension}"); 4081var projectPath = CreateProjectFile(workspace.Path, "EnvironmentBuild", $$""" 4107var sentinelPath = Path.Combine(workspace.Path, "environment-build-ran.txt"); 4112options => options.ProjectDirectory = workspace.Path, 4203var projectPath = CreateProjectWithBuildProducedRunPropertiesSentinel(workspace.Path); 4206options => options.ProjectDirectory = workspace.Path, 4264var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4265var filePath = Path.Combine(workspace.Path, "worker.cs"); 4268options => options.ProjectDirectory = workspace.Path, outputHelper); 4297var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4299options => options.ProjectDirectory = workspace.Path, outputHelper); 4369var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4371options => options.ProjectDirectory = workspace.Path, outputHelper); 4413var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4415options => options.ProjectDirectory = workspace.Path, outputHelper); 4448var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4450options => options.ProjectDirectory = workspace.Path, outputHelper); 4497var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4498var filePath = Path.Combine(workspace.Path, "worker.cs"); 4501options => options.ProjectDirectory = workspace.Path, outputHelper); 4531var projectPath = CreateProject(workspace.Path, "Api", "Api.csproj"); 4532var filePath = Path.Combine(workspace.Path, "worker.cs"); 4535options => options.ProjectDirectory = workspace.Path, 4594var projectPath = CreateProject(workspace.Path, "EnvironmentBuild", "EnvironmentBuild.csproj"); 4597options => options.ProjectDirectory = workspace.Path, 4603Path.Combine(workspace.Path, "missing-dotnet"); 4638var brokenProject = CreateBrokenProject(workspace.Path, buildLogMarker); 4639var fileApp = Path.Combine(workspace.Path, "worker.cs"); 4640var sentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 4650options => options.ProjectDirectory = workspace.Path, 4701var releaseBuild = Path.Combine(workspace.Path, "release-build"); 4702var brokenProject = CreateGatedBrokenProject(workspace.Path, releaseBuild); 4703var fileApp = Path.Combine(workspace.Path, "worker.cs"); 4704var sentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 4714options => options.ProjectDirectory = workspace.Path,
DotnetProjectFacadeTests.cs (1)
160var path = Path.Combine(workspace.Path, "Service.vbproj");
DotnetProjectLaunchProfileTests.cs (9)
27var path = CreateProject(workspace.Path, ".VBPROJ"); 78var path = CreateProject(workspace.Path, ".vbproj"); 115var path = CreateProject(workspace.Path, ".vbproj"); 150var path = CreateProject(workspace.Path, ".vbproj"); 167var path = CreateProject(workspace.Path, ".vbproj"); 199var path = CreateProject(workspace.Path, extension); 225var path = CreateProject(workspace.Path, extension); 247var path = CreateProject(workspace.Path, ".vbproj"); 264var path = CreateProject(workspace.Path, ".vbproj");
DotnetProjectOptionsTests.cs (3)
26var projectPath = await CreateProjectAsync(workspace.Path, includeKestrel: false); 50var projectPath = await CreateProjectAsync(workspace.Path, includeKestrel: false); 76var projectPath = await CreateProjectAsync(workspace.Path, includeKestrel: true);
DotnetProjectPathTests.cs (19)
24var projectPath = Path.Combine(workspace.Path, $"Service{extension}"); 27options => options.ProjectDirectory = workspace.Path, 39Assert.Equal(workspace.Path, resource.Resource.WorkingDirectory); 63options => options.ProjectDirectory = workspace.Path, 89var path = Path.Combine(workspace.Path, "Service.fsproj"); 95options => options.ProjectDirectory = workspace.Path, 101includeProject ? path : workspace.Path, 127options => options.ProjectDirectory = workspace.Path, 158var path = Path.Combine(workspace.Path, fileName); 164options => options.ProjectDirectory = workspace.Path, 196options => options.ProjectDirectory = workspace.Path, 216var path = Path.Combine(workspace.Path, $"Service{extension}"); 221var legacy = builder.AddProject("legacy", workspace.Path, options => options.ExcludeLaunchProfile = true); 223var modern = builder.AddDotnetProject("modern", workspace.Path, options => options.ExcludeLaunchProfile = true); 225Assert.Equal(workspace.Path, legacy.Resource.GetProjectMetadata().ProjectPath); 237var path = Path.Combine(workspace.Path, $"Service{extension}"); 287var path = Path.Combine(workspace.Path, fileName); 308var path = Path.Combine(workspace.Path, "MissingDirectory"); 327var path = Path.Combine(workspace.Path, $"Missing{extension}");
DotnetProjectResourceTests.cs (33)
163"project" => CreateFile(workspace.Path, "MyService.csproj"), 164"fsharp-project" => CreateFile(workspace.Path, "MyService.fsproj"), 165"visualbasic-project" => CreateFile(workspace.Path, "MyService.vbproj"), 166"directory" => CreateProjectDirectory(workspace.Path), 167"file" => CreateFile(workspace.Path, "service.cs"), 174var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 176var expectedPath = Path.GetRelativePath(workspace.Path, metadata.ProjectPath).Replace('\\', '/'); 190var projectPath = CreateFile(workspace.Path, "MyService.csproj"); 207var resource = new DotnetProjectResource("svc", workspace.Path); 209() => ManifestUtils.GetManifest(resource, workspace.Path)); 221var projectPath = CreateFile(workspace.Path, "MyService.csproj"); 229var manifest = await ManifestUtils.GetManifestOrNull(resource.Resource, workspace.Path); 237var projectPath = CreateFile(workspace.Path, "MyService.csproj"); 245var manifest = await ManifestUtils.GetManifest(resource.Resource, workspace.Path); 253var projectPath = CreateFile(workspace.Path, "MyService.csproj"); 254await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Dockerfile"), "FROM scratch"); 263var manifest = await ManifestUtils.GetManifest(resource.Resource, workspace.Path); 293var appPath = Path.Combine(workspace.Path, "app.cs"); 300var archivePath = Path.Combine(workspace.Path, "app.tar.gz"); 330var sentinelDockerfilePath = Path.Combine(workspace.Path, "Dockerfile.sentinel"); 331await File.WriteAllTextAsync(Path.Combine(workspace.Path, "sentinel.txt"), marker, cancellation.Token); 334workspace.Path, 399var projectPath = Path.Combine(workspace.Path, "Project.csproj"); 406context.OutputPath = Path.Combine(workspace.Path, "project.tar"); 425var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project")); 427var runtimeDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")); 451var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 469var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "AmbiguousService")); 538var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 672var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 742var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 1125var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project")); 1152var archivePath = Path.Combine(workspace.Path, "project.tar.gz");
DotnetProjectRunPropertiesResolverTests.cs (6)
20var projectPath = Path.Combine(workspace.Path, "Broken.csproj"); 39workspace.Path, 55var projectPath = Path.Combine(workspace.Path, "Warning.csproj"); 75workspace.Path, 83Path.Combine(workspace.Path, "bin"), 84Path.Combine(workspace.Path, "bin", "app.dll"),
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFOutputDiffingTests.cs (4)
26using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "inspect"); 76var artifact = Path.Combine(workspace.Path, "efmigrations", bundle ? "migrations" : "migrations.sql"); 79using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 118Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message);
Aspire.Hosting.Go.Tests (24)
AddGoAppTests.cs (8)
1015using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1020var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1075using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1079var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1088using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1093var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1102using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1107var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path);
GoRunDebuggingTests.cs (5)
354File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/debugflags\n\ngo 1.18\n"); 355File.WriteAllText(Path.Combine(workspace.Path, "main.go"), """ 421File.WriteAllText(Path.Combine(workspace.Path, "tag.go"), """ 431var go = builder.AddGoApp("api", workspace.Path) 436var goEnvironment = Path.Combine(workspace.Path, "go.env");
GoVersionDetectorTests.cs (11)
13var version = GoVersionDetector.Detect(workspace.Path); 22File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23\n"); 24var version = GoVersionDetector.Detect(workspace.Path); 33File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23.4\n"); 35var version = GoVersionDetector.Detect(workspace.Path); 44File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), 47var version = GoVersionDetector.Detect(workspace.Path); 57File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), 60var version = GoVersionDetector.Detect(workspace.Path); 69File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n"); 71var version = GoVersionDetector.Detect(workspace.Path);
Aspire.Hosting.Java.Tests (4)
AddJavaAppPublishTests.cs (4)
46Directory.CreateDirectory(Path.Combine(workspace.Path, "build", "libs")); 50await File.WriteAllTextAsync(Path.Combine(workspace.Path, "build", "libs", "reports service.jar"), ""); 52var destination = Path.Combine(workspace.Path, "app.jar"); 58WorkingDirectory = workspace.Path,
Aspire.Hosting.JavaScript.Tests (489)
AddBunAppTests.cs (31)
32using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 34var appDir = Path.Combine(workspace.Path, "js"); 44await ManifestUtils.GetManifest(bunApp.Resource, workspace.Path); 46var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 60using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 62var appDir = Path.Combine(workspace.Path, "js"); 71await ManifestUtils.GetManifest(bunApp.Resource, workspace.Path); 73await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"))); 80using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 82var appDir = Path.Combine(workspace.Path, "js"); 88await ManifestUtils.GetManifest(bunApp.Resource, workspace.Path); 93var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 111using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 113var appDir = Path.Combine(workspace.Path, "js"); 119await ManifestUtils.GetManifest(bunApp.Resource, workspace.Path); 121var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 131await ManifestUtils.GetManifest(bunApp.Resource, workspace.Path); 143File.WriteAllText(Path.Combine(workspace.Path, "server.ts"), "console.log('hi');"); 147builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 165File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 169builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 217var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 309var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 322var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 334var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts") 349File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 351var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts") 364var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts"); 371Assert.Equal(Path.GetFullPath("server.ts", workspace.Path), launchConfig.ScriptPath); 382File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 384var bunApp = builder.AddBunApp("bunapp", workspace.Path, "server.ts")
AddDenoAppTests.cs (221)
60using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 62var appDir = Path.Combine(workspace.Path, "js"); 72await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 74var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 88using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 90var appDir = Path.Combine(workspace.Path, "js"); 99await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 101var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 111using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 113var appDir = Path.Combine(workspace.Path, "js"); 119await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 124var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 143using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 145var appDir = Path.Combine(workspace.Path, "js"); 150await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 152var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 178using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 180var appDir = Path.Combine(workspace.Path, "js"); 187await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 189var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 198using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 200var appDir = Path.Combine(workspace.Path, "js"); 210await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 212var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 222using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 224var appDir = Path.Combine(workspace.Path, "js"); 236await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 238await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"))); 245using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 247var appDir = Path.Combine(workspace.Path, "js"); 254await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 256var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 265using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 267var appDir = Path.Combine(workspace.Path, "js"); 279await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 281var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 292using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 294var appDir = Path.Combine(workspace.Path, "js"); 303await ManifestUtils.GetManifest(app.Resource, workspace.Path); 305var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 318using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 320var appDir = Path.Combine(workspace.Path, "js"); 334await ManifestUtils.GetManifest(app.Resource, workspace.Path); 336var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 349using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 351var appDir = Path.Combine(workspace.Path, "js"); 358() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 369using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 371var appDir = Path.Combine(workspace.Path, "js"); 378() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 389using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 391var appDir = Path.Combine(workspace.Path, "js"); 399await ManifestUtils.GetManifest(app.Resource, workspace.Path); 401var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile")); 413using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 415var appDir = Path.Combine(workspace.Path, "js"); 424await ManifestUtils.GetManifest(app.Resource, workspace.Path); 426var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile")); 438using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 440var appDir = Path.Combine(workspace.Path, "js"); 444await ManifestUtils.GetManifest(app.Resource, workspace.Path); 446var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 456using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 458var appDir = Path.Combine(workspace.Path, "js"); 463await ManifestUtils.GetManifest(app.Resource, workspace.Path); 465var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 475using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 477var appDir = Path.Combine(workspace.Path, "js"); 484await ManifestUtils.GetManifest(app.Resource, workspace.Path); 486var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 502using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 504var appDir = Path.Combine(workspace.Path, "js"); 511() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 521using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 523var appDir = Path.Combine(workspace.Path, "js"); 530await ManifestUtils.GetManifest(app.Resource, workspace.Path); 532Assert.False(File.Exists(Path.Combine(workspace.Path, "js.Dockerfile"))); 539using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 541var appDir = Path.Combine(workspace.Path, "js"); 551await ManifestUtils.GetManifest(app.Resource, workspace.Path); 553var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 566using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 568var appDir = Path.Combine(workspace.Path, "js"); 582await ManifestUtils.GetManifest(app.Resource, workspace.Path); 584var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 609using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 611var appDir = Path.Combine(workspace.Path, "js"); 618await ManifestUtils.GetManifest(app.Resource, workspace.Path); 622var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 630using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 632var appDir = Path.Combine(workspace.Path, "js"); 639await ManifestUtils.GetManifest(app.Resource, workspace.Path); 643var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 651using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 653var appDir = Path.Combine(workspace.Path, "js"); 662await ManifestUtils.GetManifest(app.Resource, workspace.Path); 664var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 673using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 675var appDir = Path.Combine(workspace.Path, "js"); 684await ManifestUtils.GetManifest(app.Resource, workspace.Path); 687var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 695using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 697var appDir = Path.Combine(workspace.Path, "js"); 706await ManifestUtils.GetManifest(app.Resource, workspace.Path); 708var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 724using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 726var appDir = Path.Combine(workspace.Path, "js"); 744await ManifestUtils.GetManifest(app.Resource, workspace.Path); 746var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 755using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 757var appDir = Path.Combine(workspace.Path, "js"); 765await ManifestUtils.GetManifest(app.Resource, workspace.Path); 767var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 859using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 861var appDir = Path.Combine(workspace.Path, "js"); 871await ManifestUtils.GetManifest(app.Resource, workspace.Path); 873var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 883using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 885var appDir = Path.Combine(workspace.Path, "js"); 892await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 894var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 902using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 904var appDir = Path.Combine(workspace.Path, "js"); 911await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 913var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 921using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 923var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 926var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => ManifestUtils.GetManifest(denoApp.Resource, workspace.Path)); 935using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 937var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 941var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => ManifestUtils.GetManifest(denoApp.Resource, workspace.Path)); 950using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 952var appDir = Path.Combine(workspace.Path, "js"); 959await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 961var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 971using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 973var appDir = Path.Combine(workspace.Path, "js"); 982await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 984var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 994using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 996var appDir = Path.Combine(workspace.Path, "js"); 1003await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1005var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1020using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1022var appDir = Path.Combine(workspace.Path, "js"); 1028await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1030var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1038using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1040var appDir = Path.Combine(workspace.Path, "js"); 1047await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1049var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1059using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1061var appDir = Path.Combine(workspace.Path, "js"); 1068await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1070var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1080using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1082var appDir = Path.Combine(workspace.Path, "js"); 1091var manifest = await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1094var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1106var appDir = Path.Combine(workspace.Path, "js"); 1124var appDir = Path.Combine(workspace.Path, "js"); 1151var appDir = Path.Combine(workspace.Path, "js"); 1180var appDir = Path.Combine(workspace.Path, "js"); 1199var appDir = Path.Combine(workspace.Path, "js"); 1226using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1228var appDir1 = Path.Combine(workspace.Path, "js1"); 1229var appDir2 = Path.Combine(workspace.Path, "js2"); 1241await ManifestUtils.GetManifest(denoApp2.Resource, workspace.Path); 1243var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js2.Dockerfile")); 1253File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');"); 1257builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 1275File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 1279builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 1302File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 1306builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 1324File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');"); 1327builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 1492builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 1507var app = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 1524var app = builder.AddJavaScriptApp("js", workspace.Path) 1541var app = builder.AddJavaScriptApp("js", workspace.Path) 1559builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 1576using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1578var appDir = Path.Combine(workspace.Path, "js"); 1585await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1587var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1600using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1602var appDir = Path.Combine(workspace.Path, "js"); 1610await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1612var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1627using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1629var appDir = Path.Combine(workspace.Path, "js"); 1636await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1638var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1647using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1649var appDir = Path.Combine(workspace.Path, "js"); 1655await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 1657var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1682using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 1684var appDir = Path.Combine(workspace.Path, "js"); 1691() => ManifestUtils.GetManifest(denoApp.Resource, workspace.Path)); 2295var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 2335var exception = Assert.Throws<ArgumentException>(() => builder.AddDenoApp("denoapp", workspace.Path, scriptPath)); 2346using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 2348var appDir = Path.Combine(workspace.Path, "deno-app"); 2357await ManifestUtils.GetManifest(denoApp.Resource, workspace.Path); 2359var dockerfilePath = Path.Combine(workspace.Path, "deno-app.Dockerfile"); 2529var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 2542var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 2554var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2568var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts"); 2575Assert.Equal(Path.GetFullPath("main.ts", workspace.Path), launchConfig.ScriptPath); 2586File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 2588var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2604File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 2606var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2623File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 2625var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2642var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2658var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts") 2677var denoApp = builder.AddDenoApp("denoapp", workspace.Path, "main.ts");
AddJavaScriptAppTests.cs (83)
24using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 26var appDir = Path.Combine(workspace.Path, "js"); 33await ManifestUtils.GetManifest(yarnApp.Resource, workspace.Path); 35var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 46using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 48var appDir = Path.Combine(workspace.Path, "js"); 56await ManifestUtils.GetManifest(yarnApp.Resource, workspace.Path); 58var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 66using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 68var appDir = Path.Combine(workspace.Path, "js"); 76await ManifestUtils.GetManifest(yarnApp.Resource, workspace.Path); 78var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 86using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 88var appDir = Path.Combine(workspace.Path, "js"); 96await ManifestUtils.GetManifest(yarnApp.Resource, workspace.Path); 98var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 108using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 111var appDir = Path.Combine(workspace.Path, "js"); 123await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 125var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 135using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 137var appDir = Path.Combine(workspace.Path, "js"); 144await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 146var dockerfileLines = await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 169using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 171var appDir = Path.Combine(workspace.Path, "js"); 184await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 186var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 196using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 198var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 202var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 213using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 215var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 221var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifestForModel(appModel, workspace.Path)); 232using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 234var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 239var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 253var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 274var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 296var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 321var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 341using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 343var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 347var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 356using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 358var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 365var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 375using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 377var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 384var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 393using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 395var appDir = CreateJavaScriptAppWithDockerfile(workspace.Path); 400var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 411using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 413var appDir = Path.Combine(workspace.Path, "js"); 422await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 424var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 442using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 444var appDir = Path.Combine(workspace.Path, "js"); 458await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 460var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 476using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 478var appDir = Path.Combine(workspace.Path, "js"); 493await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 495var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 508using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 510var appDir = Path.Combine(workspace.Path, "js"); 524await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 526var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 537using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 539var appDir = Path.Combine(workspace.Path, "js"); 553await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 555var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 576using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 578var appDir = Path.Combine(workspace.Path, "js"); 602using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 605var appDir = Path.Combine(workspace.Path, "pnpm-app"); 625await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 627var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile"); 698using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 700var appDir = Path.Combine(workspace.Path, "pnpm-app"); 721await ManifestUtils.GetManifest(pnpmApp.Resource, workspace.Path); 723var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile");
AddNodeAppTests.cs (28)
97using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 99var appDir = Path.Combine(workspace.Path, "js"); 110await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 112var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 165using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 167var appDir = Path.Combine(workspace.Path, "js"); 179await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 181var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 212using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 214var appDir = Path.Combine(workspace.Path, "js"); 224await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 227var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 236File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "{}"); 240builder.AddNodeApp("nodeapp", workspace.Path, "app.js"); 263File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 267builder.AddNodeApp("nodeapp", workspace.Path, "app.js"); 440var nodeApp = builder.AddNodeApp("nodeapp", workspace.Path, "app.js"); 453var nodeApp = builder.AddNodeApp("nodeapp", workspace.Path, "app.js"); 465var viteApp = builder.AddViteApp("viteapp", workspace.Path); 478var viteApp = builder.AddViteApp("viteapp", workspace.Path) 505var viteApp = builder.AddViteApp("viteapp", workspace.Path) 522var viteApp = builder.AddViteApp("viteapp", workspace.Path) 539var resource = new JavaScriptAppResource("jsapp", "npm", workspace.Path); 560File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "console.log('hello');"); 562var nodeApp = builder.AddNodeApp("nodeapp", workspace.Path, "app.js") 598var nodeApp = builder.AddNodeApp("nodeapp", workspace.Path, "app.js"); 605Assert.Equal(Path.GetFullPath("app.js", workspace.Path), launchConfig.ScriptPath); 614var viteApp = builder.AddViteApp("viteapp", workspace.Path);
AddViteAppTests.cs (101)
23using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 26var viteDir = Path.Combine(workspace.Path, "vite"); 35var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 61var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 85using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 87var viteDir = Path.Combine(workspace.Path, "vite"); 95await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 97var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 111using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 113var viteDir = Path.Combine(workspace.Path, "vite"); 117var apiDir = Path.Combine(workspace.Path, "api"); 128await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 130var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 138using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 140var viteDir = Path.Combine(workspace.Path, "vite"); 159using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 161var viteDir = Path.Combine(workspace.Path, "vite"); 165var apiDir = Path.Combine(workspace.Path, "api"); 189using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 191var appDir = Path.Combine(workspace.Path, "angular"); 199await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 201var dockerfilePath = Path.Combine(workspace.Path, "angular.Dockerfile"); 215using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 217var appDir = Path.Combine(workspace.Path, "vite"); 225await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 227var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 238using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 240var nextDir = Path.Combine(workspace.Path, "nextjs"); 247await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 249var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile"); 259using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 261var nextDir = Path.Combine(workspace.Path, "nextjs"); 268await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 270var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile"); 278using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 280var appDir = Path.Combine(workspace.Path, "nuxt"); 288await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 290var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile"); 298using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 300var appDir = Path.Combine(workspace.Path, "nuxt"); 308await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 310var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile"); 320File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), "18.20.0"); 322using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 323var nodeApp = builder.AddViteApp("vite", workspace.Path) 326var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 328var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 340File.WriteAllText(Path.Combine(workspace.Path, ".node-version"), "v21.5.0"); 342using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 343var nodeApp = builder.AddViteApp("vite", workspace.Path) 346var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 348var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 365File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions); 367using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 368var nodeApp = builder.AddViteApp("vite", workspace.Path) 371var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 373var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 391File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions); 393using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 394var nodeApp = builder.AddViteApp("vite", workspace.Path) 397var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 399var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 417File.WriteAllText(Path.Combine(workspace.Path, "package.json"), packageJson); 419using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 420var nodeApp = builder.AddViteApp("vite", workspace.Path) 423var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 425var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 436using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 437var nodeApp = builder.AddViteApp("vite", workspace.Path) 440var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 442var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 458File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), versionString); 460using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 461var nodeApp = builder.AddViteApp("vite", workspace.Path) 464var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 466var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 475using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path).WithResourceCleanUp(true); 478var nodeApp = builder.AddViteApp("vite", workspace.Path) 482var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, workspace.Path); 488var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 546Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 549var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 553var viteApp = builder.AddViteApp("test-app", workspace.Path) 607Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 610var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 614var viteApp = builder.AddViteApp("test-app", workspace.Path); 666var viteApp = builder.AddViteApp("test-app", workspace.Path); 711var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 715builder.AddViteApp("test-app", workspace.Path); 754Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 757var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 761var viteApp = builder.AddViteApp("test-app", workspace.Path); 809var repoRoot = Path.Combine(workspace.Path, "repo"); 885var repoRoot = Path.Combine(workspace.Path, "repo"); 948var repoRoot = Path.Combine(workspace.Path, "repo"); 994Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 997var viteConfigPath = Path.Combine(workspace.Path, configFileName); 1001var viteApp = builder.AddViteApp("test-app", workspace.Path); 1049var nextDir = Path.Combine(workspace.Path, "nextjs"); 1072var nextDir = Path.Combine(workspace.Path, "nextjs"); 1093var nextDir = Path.Combine(workspace.Path, "nextjs");
PackageInstallationTests.cs (15)
458File.WriteAllText(Path.Combine(workspace.Path, "package-lock.json"), "empty"); 462var app = builder.AddViteApp("test-app", workspace.Path) 485File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 489var app = builder.AddViteApp("test-app", workspace.Path) 495var app2 = builder.AddViteApp("test-app2", workspace.Path) 506File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 507File.WriteAllText(Path.Combine(workspace.Path, ".yarnrc.yml"), "empty"); 511var app = builder.AddViteApp("test-app", workspace.Path) 522File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 523Directory.CreateDirectory(Path.Combine(workspace.Path, ".yarn", "releases")); 527var app = builder.AddViteApp("test-app", workspace.Path) 538File.WriteAllText(Path.Combine(workspace.Path, "pnpm-lock.yaml"), "empty"); 542var app = builder.AddViteApp("test-app", workspace.Path) 553File.WriteAllText(Path.Combine(workspace.Path, "bun.lock"), "empty"); 557var app = builder.AddViteApp("test-app", workspace.Path)
RequiredCommandTests.cs (10)
30var app = builder.AddNodeApp("app", workspace.Path, "server.js"); 42var app = builder.AddNodeApp("app", workspace.Path, "server.js") 54var app = builder.AddNodeApp("app", workspace.Path, "server.js") 67var app = builder.AddNodeApp("app", workspace.Path, "server.js") 158File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 160var app = builder.AddBunApp("app", workspace.Path, "server.ts"); 171File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 173var app = builder.AddDenoApp("app", workspace.Path, "server.ts"); 184var app = builder.AddDenoApp("app", workspace.Path, "server.ts") 197var app = builder.AddBunApp("app", workspace.Path, "server.ts")
Aspire.Hosting.Keycloak.Tests (2)
KeycloakPublicApiTests.cs (2)
158keycloak.WithRealmImport(workspace.Path); 177var filePath = Path.Combine(workspace.Path, file);
Aspire.Hosting.Kubernetes.Tests (296)
KubernetesDeployTests.cs (60)
308workspace.Path, 349workspace.Path, 389workspace.Path, 430workspace.Path, 470workspace.Path, 505workspace.Path, 541workspace.Path, 565workspace.Path, 590workspace.Path, 797var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 831var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 845var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml")); 858var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 876var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml")); 889var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 898var deploymentYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "svc", "deployment.yaml")); 912workspace.Path, 939var outputPath = Path.Combine(workspace.Path, "env"); 986var outputPath = Path.Combine(workspace.Path, "env"); 1006var outputPath = Path.Combine(workspace.Path, "env"); 1080var outputPath = Path.Combine(workspace.Path, "env"); 1131workspace.Path, 1164workspace.Path, 1237var outputPath = Path.Combine(workspace.Path, "env"); 1287var outputPath = Path.Combine(workspace.Path, "env"); 1310workspace.Path, 1336var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1359var serverSecretsTemplatePath = Path.Combine(workspace.Path, "templates", "server", "secrets.yaml"); 1381workspace.Path, 1411var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1438var outputPath = Path.Combine(workspace.Path, "deploy"); 1500workspace.Path, 1526workspace.Path, env, CancellationToken.None); 1528var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1554workspace.Path, 1587workspace.Path, env, CancellationToken.None); 1589var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1600workspace.Path, 1632workspace.Path, env, CancellationToken.None); 1634var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1645workspace.Path, 1672workspace.Path, env, CancellationToken.None); 1674var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1675await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1677await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "myapp", "config.yaml")), 1737workspace.Path, 1752var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1774workspace.Path, 1793var configPath = Path.Combine(workspace.Path, "templates", resourceName, "config.yaml"); 1811workspace.Path, 1828var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1846workspace.Path, 1863var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1882workspace.Path, 1899var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1940workspace.Path, 1971workspace.Path, 2011workspace.Path, 2056workspace.Path, 2104workspace.Path,
KubernetesEnvironmentResourceTests.cs (5)
20using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 30var chartYaml = Path.Combine(workspace.Path, "Chart.yaml"); 31var valuesYaml = Path.Combine(workspace.Path, "values.yaml"); 32var deploymentYaml = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 96var outputPath = Path.Combine(workspace.Path, "output");
KubernetesGatewayTests.cs (33)
18var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 34var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 61var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 75var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 88var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 106var gatewayPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 107var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml"); 108var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 119var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 136var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml"); 145var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 175var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 210var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 239var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 256var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 274var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 291var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 300var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 322var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 335var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 356var gatewayDir = Path.Combine(workspace.Path, "templates", "empty"); 371var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 423var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 434var templatesDir = Path.Combine(workspace.Path, "templates", "myapi"); 446var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 464var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 496var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 513var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 533var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 558var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 580var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 596var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 613var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path);
KubernetesIngressTests.cs (48)
18var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 34var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 50var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 64var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 86$"Pipeline:OutputPath={workspace.Path}", 108var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 115var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 132var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 149var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 160var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 177var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 178var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 188var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 204var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 213var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 228var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 237var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 253var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 265var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 282var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 295var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 315var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 328var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 343var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 353var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 367var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 380var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 393var ingressDir = Path.Combine(workspace.Path, "templates", "empty"); 406var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 439var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 459var ingressDir = Path.Combine(workspace.Path, "templates", "public"); 481var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 514var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 544var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 556var ingressDir = Path.Combine(workspace.Path, "templates", "empty"); 564var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 576var templatesDir = Path.Combine(workspace.Path, "templates", "myapi"); 587var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 612var publicPath = Path.Combine(workspace.Path, "templates", "public-ingress", "public-ingress.yaml"); 613var internalPath = Path.Combine(workspace.Path, "templates", "internal-ingress", "internal-ingress.yaml"); 629var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 647var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 664var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 682var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 733var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 758var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 781var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 798var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
KubernetesPublisherTests.cs (150)
33using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 55using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 80await HelmDeploymentEngine.ResolveAndWriteDeployValuesAsync(workspace.Path, environment.Resource, TestContext.Current.CancellationToken); 83var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 89var exitCode = await new DefaultHelmRunner().RunAsync(arguments, workspace.Path, 118using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 156using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 191using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 215await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 226using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 259await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml").UseParameters(gateway, tls); 270using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 310using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 323await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 340using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 371using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 388await HelmDeploymentEngine.ResolveAndWriteDeployValuesAsync(workspace.Path, environment.Resource, cts.Token); 390await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates/backend/config.yaml")), "yaml") 391.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 392.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"))), "yaml"); 402var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 437await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates/myapp/deployment.yaml")), "yaml") 445var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 494var filePath = Path.Combine(workspace.Path, expectedFile); 514var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 533var deploymentPath = Path.Combine(workspace.Path, "templates/service/deployment.yaml"); 545var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 591var filePath = Path.Combine(workspace.Path, expectedFile); 611var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 635var manifestPath = Path.Combine(workspace.Path, "templates/myapp/scaler.yaml"); 666var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 683var templatesFolder = Path.Combine(workspace.Path, "templates", "myapp"); 739var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 780var filePath = Path.Combine(workspace.Path, expectedFile); 800var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 834var filePath = Path.Combine(workspace.Path, expectedFile); 854var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 866var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 877var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 941var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 951var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 990var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1000var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1025var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1035var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1118var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1178var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1214var filePath = Path.Combine(workspace.Path, expectedFile); 1237var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1268await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1269.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "api", "deployment.yaml")), "yaml") 1277var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1288await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 1299var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1315var publishedValues = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")); 1316await HelmDeploymentEngine.ResolveAndWriteDeployValuesAsync(workspace.Path, environment.Resource, CancellationToken.None); 1319.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"))), "yaml") 1327var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1337await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 1346var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1360await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1370var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1384await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1392var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1404await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1405.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "worker", "deployment.yaml")), "yaml") 1406.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "cache", "deployment.yaml")), "yaml"); 1413var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1421await Verify(File.ReadAllText(Path.Combine(workspace.Path, "Chart.yaml")), "yaml") 1422.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1423.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "deployment.yaml")), "yaml") 1424.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "service.yaml")), "yaml") 1425.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "config.yaml")), "yaml"); 1432var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1458var filePath = Path.Combine(workspace.Path, expectedFile); 1476var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1502var filePath = Path.Combine(workspace.Path, expectedFile); 1520var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1528var servicePath = Path.Combine(workspace.Path, "templates/database/service.yaml"); 1541var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1564var filePath = Path.Combine(workspace.Path, expectedFile); 1591var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1616var filePath = Path.Combine(workspace.Path, expectedFile); 1639var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1659var filePath = Path.Combine(workspace.Path, expectedFile); 1677var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1704var filePath = Path.Combine(workspace.Path, expectedFile); 1724var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1750var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1776var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1800var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1836var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1859var filePath = Path.Combine(workspace.Path, expectedFile); 1879var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1905var filePath = Path.Combine(workspace.Path, expectedFile); 1925var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 1966var filePath = Path.Combine(workspace.Path, expectedFile); 1986var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2017var filePath = Path.Combine(workspace.Path, expectedFile); 2037var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2079var filePath = Path.Combine(workspace.Path, expectedFile); 2099var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2115var valuesContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")); 2125var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2164var filePath = Path.Combine(workspace.Path, expectedFile); 2184var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2218var filePath = Path.Combine(workspace.Path, expectedFile); 2248var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2275var filePath = Path.Combine(workspace.Path, expectedFile); 2294var legacyPv = Path.Combine(workspace.Path, "templates", "service", "data-pv.yaml"); 2309var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2324var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 2342var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2369var filePath = Path.Combine(workspace.Path, expectedFile); 2382var legacyPvc = Path.Combine(workspace.Path, "templates", "service", "data-pvc.yaml"); 2386var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 2399var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2424var filePath = Path.Combine(workspace.Path, expectedFile); 2442var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2464var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 2474var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2491var omittedClaimPath = Path.Combine(workspace.Path, "templates", "omitted", "omitted.yaml"); 2492var emptyClaimPath = Path.Combine(workspace.Path, "templates", "empty", "empty.yaml"); 2507using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2533var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml")); 2546using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2571var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml")); 2584using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2607var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "data", "data.yaml")); 2615var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2633var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 2643var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2660var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 2680var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2711var filePath = Path.Combine(workspace.Path, expectedFile); 2729var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2750Assert.Equal("default-class", ReadStorageClassName(workspace.Path, "default")); 2751Assert.Equal("explicit-class", ReadStorageClassName(workspace.Path, "explicit")); 2752Assert.Null(ReadStorageClassName(workspace.Path, "omitted")); 2759var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2791var filePath = Path.Combine(workspace.Path, expectedFile); 2813var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2829var statefulSetPath = Path.Combine(workspace.Path, "templates", "service", "statefulset.yaml"); 2835var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 2853var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2884var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2899var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 2946var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 2973var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 2985var valuesPath = Path.Combine(workspace.Path, "values.yaml");
Aspire.Hosting.Maui.Tests (65)
MauiiOSValidationTests.cs (6)
24var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 50var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 76var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 97var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 116var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 135var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiOtlpTemplateTests.cs (4)
26var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 53var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 80var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 107var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiPlatformExtensionsTests.cs (38)
97var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 120var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 140var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 159var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 188var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 236var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 255var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 279var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 308var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 334var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 357var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 380var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 403var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 431var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 456var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 485var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 510var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 537var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 564var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 631var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 661var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 685var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 708var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 746var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 799var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 864var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 903var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 956var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1022var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1059var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1076var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1098var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1129var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1156var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1186var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1268var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1304var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1367var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiUnsupportedPlatformTests.cs (6)
17var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 41var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 65var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 89var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 114var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 129var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiWithArgsTests.cs (11)
21var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 39var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 58var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 78var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 95var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 115var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 132var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 151var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 168var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 188var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 210var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (2)
278builder.Configuration["Aspire:Store:Path"] = workspace.Path; 313builder.Configuration["Aspire:Store:Path"] = workspace.Path;
MySqlFunctionalTests.cs (1)
572.WithTempAspireStore(workspace.Path)
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (2)
503builder.Configuration["Aspire:Store:Path"] = workspace.Path; 565builder.Configuration["Aspire:Store:Path"] = workspace.Path;
PostgresFunctionalTests.cs (1)
559.WithTempAspireStore(workspace.Path)
Aspire.Hosting.Python.Tests (123)
AddPythonAppTests.cs (123)
431builder.AddPythonApp("pythonProject", workspace.Path, "main.py")); 444builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 453var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 477builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 517var resourceBuilder = builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 536var resourceBuilder = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 591options.ProjectDirectory = workspace.Path; 637options.ProjectDirectory = workspace.Path; 711options.ProjectDirectory = workspace.Path; 766var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 776var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 797var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 817builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 855var pythonBuilder = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 875var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 899var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 930var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 957var pythonBuilder = builder.AddPythonApp("python-script", workspace.Path, "main.py"); 976var pythonBuilder = builder.AddPythonModule("flask-app", workspace.Path, "flask"); 995var pythonBuilder = builder.AddPythonExecutable("pytest", workspace.Path, "pytest"); 1016builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 1026var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1052builder.AddPythonModule("pythonProject", workspace.Path, moduleName); 1060var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1086builder.AddPythonExecutable("pythonProject", workspace.Path, executableName); 1094var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1117var pythonBuilder = builder.AddPythonModule("flask-app", workspace.Path, "flask") 1141var pythonBuilder = builder.AddPythonApp("python-app", workspace.Path, "main.py") 1163var pythonBuilder = builder.AddPythonExecutable("pytest", workspace.Path, "pytest") 1185var pythonBuilder = builder.AddPythonApp("python-app", workspace.Path, "main.py") 1215var pythonBuilder = builder.AddPythonApp("python-app", workspace.Path, "main.py"); 1262var resourceBuilder = builder.AddPythonApp("pythonProject", workspace.Path, "main.py"); 1281using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1287var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifest(app.Resource, workspace.Path)); 1300using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1307var exception = await Assert.ThrowsAsync<DistributedApplicationException>(() => ManifestUtils.GetManifestForModel(appModel, workspace.Path)); 1339using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1352var manifest = await ManifestUtils.GetManifest(resource, workspace.Path); 1362using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1367var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1376using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1382var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1391using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1397var manifest = await ManifestUtils.GetManifest(app.Resource, workspace.Path); 1541using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 1552var manifest = await ManifestUtils.GetManifestForModel(appModel, workspace.Path); 1715var appDirectory = Path.Combine(workspace.Path, "myapp"); 1717var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1759var appDirectory = Path.Combine(workspace.Path, "myapp"); 1761var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1799var appDirectory = Path.Combine(workspace.Path, "myapp"); 1801var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1834var appDirectory = Path.Combine(workspace.Path, "myapp"); 1836var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1855var appDirectory = Path.Combine(workspace.Path, "myapp"); 1857var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1879var appDirectory = Path.Combine(workspace.Path, "myapp"); 1881var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1903var appDirectory = Path.Combine(workspace.Path, "myapp"); 1905var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1907var customWorkingDirectory = Path.Combine(workspace.Path, "custom"); 1930var appDirectory = Path.Combine(workspace.Path, "myapp"); 1932var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1934var customWorkingDirectory = Path.Combine(workspace.Path, "custom"); 1971var appDirectory = Path.Combine(workspace.Path, "myapp"); 1973var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 2004var appDirectory = Path.Combine(workspace.Path, "myapp"); 2006var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 2033var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py"); 2055var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py"); 2073var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py"); 2326var scriptPath = Path.Combine(workspace.Path, scriptName); 2330var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml"); 2333var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 2360var scriptPath = Path.Combine(workspace.Path, scriptName); 2364var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2367var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 2395var scriptPath = Path.Combine(workspace.Path, scriptName); 2399var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml"); 2401var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2404var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 2425var scriptPath = Path.Combine(workspace.Path, scriptName); 2428var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, scriptName); 2449var scriptPath = Path.Combine(workspace.Path, scriptName); 2453builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 2472var scriptPath = Path.Combine(workspace.Path, scriptName); 2476var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2480builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 2500var scriptPath = Path.Combine(workspace.Path, scriptName); 2504var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2508builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 2529var scriptPath = Path.Combine(workspace.Path, "main.py"); 2532var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2557var scriptPath = Path.Combine(workspace.Path, "main.py"); 2561var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2564var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2600var scriptPath = Path.Combine(workspace.Path, "main.py"); 2603var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2606var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2630var scriptPath = Path.Combine(workspace.Path, "main.py"); 2633var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2636var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2664var scriptPath = Path.Combine(workspace.Path, "main.py"); 2667var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2671var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2700var scriptPath = Path.Combine(workspace.Path, "main.py"); 2703var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2707var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2730var scriptPath = Path.Combine(workspace.Path, "main.py"); 2733var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2737var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2762var scriptPath = Path.Combine(workspace.Path, "main.py"); 2765var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2769var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2794var scriptPath = Path.Combine(workspace.Path, "main.py"); 2797var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2800var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2830var scriptPath = Path.Combine(workspace.Path, "main.py"); 2833var pythonApp = builder.AddPythonApp("pythonProject", workspace.Path, "main.py") 2865builder.AddPythonApp("pythonProject", workspace.Path, scriptName) 2884var scriptPath = Path.Combine(workspace.Path, scriptName); 2887var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2890builder.AddPythonApp("pythonProject", workspace.Path, scriptName)
Aspire.Hosting.Tests (440)
ConditionalReferenceExpressionTests.cs (4)
128using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 138app.Services.GetRequiredService<DistributedApplicationModel>(), workspace.Path).DefaultTimeout(); 147using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 157app.Services.GetRequiredService<DistributedApplicationModel>(), workspace.Path);
Dashboard\DashboardEventHandlersTests.cs (1)
361["Aspire:Store:Path"] = workspace.Path,
Dcp\ProcessCaptureTests.cs (14)
23var app = DotnetFileAppProcess.WriteApp(workspace.Path, "echo.cs", """ 35DotnetFileAppProcess.CreateArguments(app), workspace.Path, standardInput: Encoding.UTF8.GetBytes(input), 47var app = DotnetFileAppProcess.WriteApp(workspace.Path, "environment.cs", """ 54DotnetFileAppProcess.CreateArguments(app, arguments), workspace.Path, 58Assert.Equal(new ProcessCaptureResult(0, "overridden|" + inheritedPath + "|ü|" + workspace.Path + "|" + string.Join("|", arguments), ""), result); 67var app = DotnetFileAppProcess.WriteApp(workspace.Path, "pressure.cs", """ 88DotnetFileAppProcess.CreateArguments(app, [errorFirst.ToString()]), workspace.Path, 100var app = DotnetFileAppProcess.WriteApp(workspace.Path, "reject.cs", """ 112DotnetFileAppProcess.CreateArguments(app), workspace.Path, standardInput: new byte[inputSize], cancellationToken: cancellation.Token); 121var missing = Path.Combine(workspace.Path, "missing-executable"); 124await Assert.ThrowsAsync<Win32Exception>(() => runner.RunAndCaptureTextAsync(missing, [], workspace.Path)); 127await Assert.ThrowsAnyAsync<OperationCanceledException>(() => runner.RunAndCaptureTextAsync(missing, [], workspace.Path, cancellationToken: cancellation.Token)); 137var app = DotnetFileAppProcess.WriteApp(workspace.Path, "cancel.cs", """ 164DotnetFileAppProcess.CreateArguments(app, [name]), workspace.Path, standardInput: new byte[2000000], cancellationToken: cancellation.Token);
Dcp\ProcessUtilTests.cs (1)
221var app = DotnetFileAppProcess.WriteApp(workspace.Path, "legacy-lines.cs", """
ManifestExpressionTests.cs (4)
97var manifest = await ManifestUtils.GetManifestForModel(app.Services.GetRequiredService<DistributedApplicationModel>(), workspace.Path) 443var manifest = await ManifestUtils.GetManifestForModel(app.Services.GetRequiredService<DistributedApplicationModel>(), workspace.Path) 514using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 524app.Services.GetRequiredService<DistributedApplicationModel>(), workspace.Path);
Pipelines\PipelineOutputDiffingLifetimeTests.cs (2)
33outputPath: workspace.Path, step: "publish-and-diff"); 144outputPath: workspace.Path, step: "publish-and-diff");
Pipelines\PipelineOutputDiffingTests.cs (103)
26using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 62using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 94using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 166var artifact = Path.Combine(workspace.Path, "artifact.bin"); 167var control = Path.Combine(workspace.Path, "control.bin"); 189using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 222var artifact = Path.Combine(workspace.Path, "early.txt"); 223using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 250var artifact = Path.Combine(workspace.Path, "factory.txt"); 251using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "check-alias"); 306using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 328var artifact = Path.Combine(workspace.Path, "late.txt"); 329using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 365using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 372var artifact = Path.Combine(workspace.Path, "ordinary.txt"); 388var artifact = Path.Combine(workspace.Path, "tracked.tmp"); 389await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "**/bin/\n**/obj/\n*.tmp\n", TestContext.Current.CancellationToken); 391await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 392await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 393await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "-f", "--", ".gitignore", "tracked.tmp"); 395Assert.Contains("tracked.tmp", await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "diff", "--name-only")); 396using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 401Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src", "Api", "bin"))); 402Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src", "Api", "obj"))); 413Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src"))); 418Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 426Assert.True(File.Exists(Path.Combine(workspace.Path, "src", "Api", "bin", "Release", "Api.dll"))); 427Assert.True(File.Exists(Path.Combine(workspace.Path, "src", "Api", "obj", "project.assets.json"))); 443await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "**/bin/\n**/obj/\n", TestContext.Current.CancellationToken); 444await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 445await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 446await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", ".gitignore", "src", "generated"); 447using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 466Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 498using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 547Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 568await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "generated/\n", TestContext.Current.CancellationToken); 569await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 570await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 571Assert.Equal("generated/deployment.yaml", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "check-ignore", "--", "generated/deployment.yaml")).Trim()); 572using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 592Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 608await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitattributes"), "*.yaml text eol=lf\n", TestContext.Current.CancellationToken); 609await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "generated/\n", TestContext.Current.CancellationToken); 610await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 611await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.autocrlf", "false"); 612await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.safecrlf", "false"); 613await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 614await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", ".gitattributes", ".gitignore"); 615Assert.Equal("generated/deployment.yaml", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "check-ignore", "--", "generated/deployment.yaml")).Trim()); 616var beforeObject = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "hash-object", "--", artifact); 617using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 632Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 635var afterObject = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "hash-object", "--", artifact); 643var artifact = Path.Combine(workspace.Path, "stable.txt"); 645using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 658Assert.False(Directory.Exists(Path.Combine(workspace.Path, ".git"))); 662Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 696var changed = Path.Combine(workspace.Path, "changed.txt"); 697var removed = Path.Combine(workspace.Path, "removed.txt"); 698var added = Path.Combine(workspace.Path, "added.txt"); 701using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 718Added: {Path.GetRelativePath(workspace.Path, added)} 719Changed: {Path.GetRelativePath(workspace.Path, changed)} 720Removed: {Path.GetRelativePath(workspace.Path, removed)} 733var artifact = Path.Combine(workspace.Path, "unchanged.txt"); 735using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 752Assert.Contains("Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.ToString()); 774var artifact = Path.Combine(workspace.Path, "stable.txt"); 776using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: selectBoth ? "both-checks" : "first-check"); 836var artifact = Path.Combine(workspace.Path, "result.txt"); 837using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 867var artifact = Path.Combine(workspace.Path, "custom.txt"); 868using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "custom-check"); 891var artifact = Path.Combine(workspace.Path, "cancelled.txt"); 892using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 918var included = Path.Combine(workspace.Path, "included.txt"); 919var excluded = Path.Combine(workspace.Path, "excluded.tmp"); 922using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 958Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Removed: " + Path.GetRelativePath(workspace.Path, included), failure.Message); 967var artifact = Path.Combine(workspace.Path, "tracked.txt"); 968var added = Path.Combine(workspace.Path, "untracked.txt"); 969var excluded = Path.Combine(workspace.Path, "excluded.tmp"); 971await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 972await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "tracked.txt"); 973Assert.Empty(await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "diff", "--name-only")); 974using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "publish-and-diff"); 976builder.Services.AddTransient<IPipelineOutputSnapshotter<GitSnapshot>>(_ => new GitSnapshotter(workspace.Path)); 991Changed: {Path.GetRelativePath(workspace.Path, artifact)} 992Added: {Path.GetRelativePath(workspace.Path, added)} 997Assert.Equal("old", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "show", ":tracked.txt")).Trim()); 1005var artifact = Path.Combine(workspace.Path, "stable.txt"); 1007using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path, step: "both-checks"); 1010var comparer = new DirectoryComparer(workspace.Path, relocated); 1011var provider = new CountingOutputService(workspace.Path, relocated); 1023Assert.Equal(new[] { workspace.Path }, directories.Directories); 1033Assert.Equal(new[] { workspace.Path }, directories.Directories); 1043Assert.NotEqual(workspace.Path, relocated); 1048Assert.Equal(new[] { workspace.Path, relocated }, directories.Directories);
Pipelines\PipelineOutputGitFingerprintTests.cs (107)
32await InitializeAsync(workspace.Path, "sha1"); 33File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt " + attributes + "\n"); 37await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", ".gitattributes", "output/model.txt"); 38var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 39var objects = ReadObjects(workspace.Path); 40var beforeOid = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "hash-object", "--", "output/model.txt"); 45var afterOid = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "hash-object", "--", "output/model.txt"); 51Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 52AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 71await InitializeAsync(workspace.Path, "sha1"); 73File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "output*/**/*.txt filter=stripspace -text\n"); 74await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.stripspace.clean", "git stripspace"); 75await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.stripspace.required", "true"); 82await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", gitPath); 90var beforeOid = (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "hash-object", "--", gitPath)).TrimEnd('\r', '\n'); 98var afterOid = (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "hash-object", "--", gitPath)).TrimEnd('\r', '\n'); 113var indexed = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--cached", "--full-name", "-z", "--", gitPath); 114var untracked = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--others", "--exclude-standard", "--full-name", "-z", "--", gitPath); 117var status = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "status", 147await InitializeAsync(workspace.Path, "sha1"); 153await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 157var indexPath = Path.Combine(workspace.Path, ".git", "index"); 159var objects = ReadObjects(workspace.Path); 172AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 201await InitializeAsync(workspace.Path, "sha1"); 202await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.filemode", "false"); 205await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 206var beforeEntry = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/model.txt"); 208var indexPath = Path.Combine(workspace.Path, ".git", "index"); 214await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--chmod=+x", "--", "output/model.txt"); 215var afterEntry = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/model.txt"); 231await InitializeAsync(workspace.Path, "sha1"); 239await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/link"); 240var entries = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/link"); 242var indexPath = Path.Combine(workspace.Path, ".git", "index"); 244var objects = ReadObjects(workspace.Path); 254var status = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "status", 264AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 292await InitializeAsync(workspace.Path, objectFormat); 293await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.symlinks", "true"); 295var target = Path.Combine(workspace.Path, "target.txt"); 311await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/link"); 312var entry = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/link"); 316var linkBlob = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "cat-file", "blob", oid); 318var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 319var objects = ReadObjects(workspace.Path); 323Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 324AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 333var other = directoryLink ? workspace.CreateDirectory("other-target").FullName : Path.Combine(workspace.Path, "other-target.txt"); 352Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 353AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 362await InitializeAsync(workspace.Path, objectFormat); 371await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 372var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 373var objects = ReadObjects(workspace.Path); 384Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 385AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 392await InitializeAsync(workspace.Path, "sha1"); 399await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 400Assert.True(File.GetLastWriteTimeUtc(path) < File.GetLastWriteTimeUtc(Path.Combine(workspace.Path, ".git", "index"))); 401File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n"); 402await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.clean", "git pipeline-output-filter-must-fail"); 403await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.required", "true"); 404var status = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "status", 407var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 408var objects = ReadObjects(workspace.Path); 415Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 416AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 423await InitializeAsync(workspace.Path, "sha1"); 433await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/clean.keep"); 434Assert.True(File.GetLastWriteTimeUtc(clean) < File.GetLastWriteTimeUtc(Path.Combine(workspace.Path, ".git", "index"))); 435var log = Path.Combine(workspace.Path, "filter-pids"); 436File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=record\n*.keep filter=reject\n"); 437await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.clean", "git pipeline-output-filter-must-fail"); 438await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.required", "true"); 445await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.record.clean", 447await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.record.required", "true"); 471await InitializeAsync(workspace.Path, "sha1"); 482await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.filemode", "false"); 484await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 487await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--chmod=+x", "--", "output/model.txt"); 488Assert.StartsWith("100755 ", await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/model.txt")); 490await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", hint, "--", "output/model.txt"); 491var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 498await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--chmod=-x", "--", "output/model.txt"); 499Assert.StartsWith("100644 ", await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/model.txt")); 500index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 506var status = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "--no-optional-locks", "status", 515Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 526await InitializeAsync(workspace.Path, objectFormat); 527await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.symlinks", "true"); 529var target = Path.Combine(workspace.Path, "target.txt"); 533await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 534var entry = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--stage", "--", "output/model.txt"); 537Assert.Equal(canonicalTarget, await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "cat-file", "blob", entry.Split(' ')[1])); 540await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.symlinks", "false"); 543await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", hint, "--", "output/model.txt"); 545var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 546var objects = ReadObjects(workspace.Path); 565Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 566AssertObjectsEqual(objects, ReadObjects(workspace.Path)); 573await InitializeAsync(workspace.Path, "sha1"); 577await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/model.txt"); 595await InitializeAsync(workspace.Path, "sha1"); 601File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n"); 602await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.clean", "git pipeline-output-filter-must-fail"); 603await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.required", "true");
Pipelines\PipelineOutputResolutionTests.cs (11)
24var artifact = Path.Combine(workspace.Path, "artifact.txt"); 27outputPath: workspace.Path, step: "publish-and-diff"); 62Assert.Equal(new(workspace.Path, "before"), comparison.Before); 63Assert.Equal(new(workspace.Path, "after"), comparison.After); 79outputPath: workspace.Path, step: "publish-and-diff"); 117await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 119var administration = Path.Combine(workspace.Path, ".git"); 130Directory.Move(administration, Path.Combine(workspace.Path, "saved-git")); 134await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init"); 188snapshotter.CaptureAsync(workspace.Path, cancellation.Token)); 194snapshotter.CaptureAsync(workspace.Path, cancellation.Token));
Pipelines\PipelineOutputSelectionTests.cs (93)
25await InitializeGitAsync(workspace.Path); 61await InitializeGitAsync(workspace.Path); 62await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 103await InitializeGitAsync(workspace.Path); 123await InitializeGitAsync(workspace.Path); 124var artifact = Write(workspace.Path, "artifact.txt"); 125Assert.True(File.Exists(Path.Combine(workspace.Path, ".git", "HEAD"))); 127var selected = await SelectAsync(new() { Mode = mode }, workspace.Path); 139await InitializeGitAsync(workspace.Path); 140Write(workspace.Path, ".gitignore", "*.tmp\n"); 146await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "-f", "--", "output/tracked.tmp"); 163await InitializeGitAsync(workspace.Path); 164Write(workspace.Path, ".gitignore", "output/ignored/\n"); 167await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "-f", "--", "output/ignored/child/model.json"); 195await InitializeGitAsync(workspace.Path); 196Write(workspace.Path, ".gitignore", "output/ignored*\n"); 200await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "-f", "--", "output/ignored/model.json"); 202var first = fileLink ? Write(workspace.Path, "first.txt", "same content") : workspace.CreateDirectory("first").FullName; 203var second = fileLink ? Write(workspace.Path, "second.txt", "same content") : workspace.CreateDirectory("second").FullName; 214Assert.Equal("output/ignored\n", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 216Assert.Equal("output/ignored/model.json\0", await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 218Assert.Empty(await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 275await InitializeGitAsync(workspace.Path); 276await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 306await InitializeGitAsync(workspace.Path); 307await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 366await InitializeGitAsync(workspace.Path); 367await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 368var root = Path.Combine(workspace.Path, "output", "new"); 384await InitializeGitAsync(workspace.Path); 399Directory.Move(Path.Combine(workspace.Path, ".git"), Path.Combine(workspace.Path, "saved-git")); 400Assert.False(Directory.Exists(Path.Combine(workspace.Path, ".git"))); 416var artifact = Write(workspace.Path, "src/artifacts/model.json"); 417Write(workspace.Path, "src/artifacts/cache.tmp"); 418Write(workspace.Path, "src/Program.cs"); 419Write(workspace.Path, "README.md"); 420var special = Write(workspace.Path, "special.txt"); 421using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 439var selected = await SelectAsync(options, workspace.Path); 456using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 494using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: workspace.Path); 508var path = Write(workspace.Path, "artifact.TMP"); 514var selected = await SelectAsync(options, workspace.Path); 546await InitializeGitAsync(workspace.Path); 565await InitializeGitAsync(workspace.Path); 592await InitializeGitAsync(workspace.Path); 593Write(workspace.Path, ".gitignore", "*.tmp\n"); 597await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "-f", "--", "output/artifact.tmp", "output/visible.json"); 605var target = Write(workspace.Path, "external-target.json"); 624await InitializeGitAsync(workspace.Path); 626var sibling = Write(workspace.Path, "output-sibling/outside.json"); 627var outer = Write(workspace.Path, "outside.json"); 629await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "."); 641await InitializeGitAsync(workspace.Path); 673await InitializeGitAsync(workspace.Path); 679await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/child/model.txt"); 704await InitializeGitAsync(workspace.Path); 706await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/*.tmp\noutput/ignored/\n", TestContext.Current.CancellationToken); 713await PipelineOutputGitTestHelper.RunAsync(workspace.Path, ["add", "-f", "--", .. trackedPaths]); 717await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--split-index"); 718Assert.NotEmpty(Directory.GetFiles(Path.Combine(workspace.Path, ".git"), "sharedindex.*")); 721await PipelineOutputGitTestHelper.RunAsync(workspace.Path, ["update-index", "--skip-worktree", "--", .. trackedPaths]); 723(await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "-t", "-z")).Split('\0', StringSplitOptions.RemoveEmptyEntries).Order()); 726Write(workspace.Path, "excluded/model.json"); 727await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "excluded/model.json"); 728await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 730"-c", "core.hooksPath=" + Path.Combine(workspace.Path, ".git", "no-hooks"), 732await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "sparse-checkout", "set", "--cone", "--sparse-index", "output"); 733Assert.False(Directory.Exists(Path.Combine(workspace.Path, "excluded"))); 734Assert.Equal("040000", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 743await PipelineOutputGitTestHelper.RunAsync(workspace.Path, ["add", "-f", "--", .. trackedPaths]); 744trees.Add((await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "write-tree")).Trim()); 747await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "read-tree", trees[1]); 748await PipelineOutputGitTestHelper.RunAsync(workspace.Path, ["read-tree", "-i", "-m", .. trees]); 750(await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "--unmerged", "--format=%(stage)", "-z")) 774await InitializeGitAsync(workspace.Path); 776var ignore = Write(workspace.Path, ignorePath, "*.tmp\n"); 777await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", ignorePath); 780Write(workspace.Path, "keep/model.json"); 781await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "keep/model.json"); 782await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 784"-c", "core.hooksPath=" + Path.Combine(workspace.Path, ".git", "no-hooks"), 786await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "sparse-checkout", "set", "--cone", "--sparse-index", "keep"); 791await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.sparseCheckout", "false"); 792await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--skip-worktree", "--", ignorePath); 794Assert.Equal("false", (await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "--bool", "core.sparseCheckout")).Trim()); 797Assert.Equal("S " + ignorePath + '\0', await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "ls-files", "-t", "-z", "--", ignorePath)); 827await InitializeGitAsync(workspace.Path); 833await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/nested/model.json"); 846var ordinaryGitSelection = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 876await InitializeGitAsync(workspace.Path); 880await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "update-index", "--add", "--cacheinfo",
Pipelines\PipelineOutputSnapshotterTests.cs (4)
335var first = Write(workspace.Path, "first.txt", "alpha"); 336var second = Write(workspace.Path, "second.txt", "beta"); 355var capture = await snapshotter.CaptureAsync(workspace.Path); 564var missingTarget = Path.Combine(workspace.Path, "missing.txt");
Pipelines\PipelineOutputStrategyTests.cs (45)
23var path = Path.Combine(workspace.Path, "artifact.txt"); 27var beforeSnapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 29var afterSnapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 41var artifact = Path.Combine(workspace.Path, "artifact.txt"); 43var metadata = Path.Combine(workspace.Path, metadataPath.Replace('/', Path.DirectorySeparatorChar)); 52var snapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 60snapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 65snapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 81var failure = await Assert.ThrowsAsync<DistributedApplicationException>(() => nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken)); 92var path = Path.Combine(workspace.Path, "artifact.txt"); 96var beforeSnapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 99var afterSnapshot = await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 112var missing = Path.Combine(workspace.Path, "missing"); 129var directory = Path.Combine(workspace.Path, "missing"); 160workspace.Path, runner, TestContext.Current.CancellationToken)); 181var failure = await Assert.ThrowsAsync<DistributedApplicationException>(() => nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken)); 191var path = Path.Combine(workspace.Path, "bad" + delimiter + "name.txt"); 208var target = directoryLink ? workspace.CreateDirectory("target").FullName : Path.Combine(workspace.Path, "target.txt"); 254var git = Assert.IsType<GitPipelineOutputReader>(await GitPipelineOutputReader.TryCreateAsync(workspace.Path, runner, TestContext.Current.CancellationToken)); 255var failure = await Assert.ThrowsAsync<DistributedApplicationException>(() => git.SelectFilesAsync(workspace.Path, PipelineOutputGitTestHelper.AllFilesMatcher(), TestContext.Current.CancellationToken)); 267var path = Path.Combine(workspace.Path, gitPath.Replace('/', Path.DirectorySeparatorChar)); 273await nativeSnapshotter.CaptureAsync(workspace.Path, TestContext.Current.CancellationToken); 294parents.Length == 0 ? workspace.Path : directory, runner, TestContext.Current.CancellationToken)); 416var git = new GitPipelineOutputReader(workspace.Path, runner); 425Assert.Empty(await git.SelectFilesAsync(workspace.Path, PipelineOutputGitTestHelper.AllFilesMatcher(), TestContext.Current.CancellationToken)); 452var git = new GitPipelineOutputReader(workspace.Path, runner); 455var fileHashes = await git.HashFilesAsync([new FileInfo(Path.Combine(workspace.Path, "artifact.txt"))], TestContext.Current.CancellationToken); 481var git = new GitPipelineOutputReader(workspace.Path, runner); 491await git.HashFilesAsync([new FileInfo(Path.Combine(workspace.Path, "artifact.txt"))], TestContext.Current.CancellationToken); 540var first = Path.Combine(workspace.Path, "first.txt"); 541var second = Path.Combine(workspace.Path, "second.txt"); 547var git = new GitPipelineOutputReader(workspace.Path, runner); 551var snapshot = await snapshotter.CaptureAsync(workspace.Path, PipelineOutputGitTestHelper.AllFilesMatcher(), git, TestContext.Current.CancellationToken); 559workspace.Path, PipelineOutputGitTestHelper.AllFilesMatcher(), git, TestContext.Current.CancellationToken)); 571await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init", "--object-format=sha1"); 576await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output/ignored-child/model.txt"); 577File.WriteAllText(Path.Combine(workspace.Path, ".gitignore"), "output/ignored-child*\n"); 584Assert.Equal("output/ignored-child/model.txt\0", await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 586Assert.Empty(await PipelineOutputGitTestHelper.RunAsync(workspace.Path, 588var status = await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "status", "--porcelain=v2", "-z", "--untracked-files=no", "--no-renames"); 630await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "init", "--object-format=sha1"); 635await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "add", "--", "output"); 638File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n"); 639await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.clean", "git pipeline-output-filter-must-fail"); 640await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "filter.reject.required", "true");
PublishAsDockerfileTests.cs (1)
527File.WriteAllText(Path.Join(workspace.Path, "Dockerfile"), "this does not matter");
Publishing\ContainerImageArchiveRewriterTests.cs (22)
20var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 21var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 105var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 106var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 181var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 182var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 217var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 218var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 290var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 291var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 311var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 312var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 333var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 334var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 357var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 358var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 390var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 391var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 412var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 413var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 436var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 437var compressedArchive = Path.Combine(workspace.Path, "custom-extension.archive");
Utils\DotnetSdkVersionProviderTests.cs (27)
75workspace.Path, 81Assert.Equal(workspace.Path, processSpec.WorkingDirectory); 98workspace.Path, 120workspace.Path, 145workspace.Path, 170workspace.Path, 195workspace.Path, 231workspace.Path, 235workspace.Path, 239workspace.Path, 267workspace.Path, 271workspace.Path, 287File.WriteAllText(Path.Combine(workspace.Path, "global.json"), "{}"); 288var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "First")).FullName; 289var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "Second")).FullName; 309var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "First")).FullName; 310var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "Second")).FullName; 334var globalJsonPath = Path.Combine(workspace.Path, "global.json"); 342workspace.Path, 346workspace.Path, 364workspace.Path, 367workspace.Path, 384workspace.Path, 402workspace.Path, 406workspace.Path, 417workspace.Path, 436workspace.Path,
WithVolumeTests.cs (1)
114builder.Configuration[AspireStore.AspireStorePathKeyName] = workspace.Path;
Aspire.Hosting.TestUtilities (1)
tests\Shared\TemporaryWorkspace.cs (1)
218var aspireDir = IOPath.Combine(workspace.Path, ".aspire");
Aspire.Hosting.Yarp.Tests (8)
AddYarpTests.cs (6)
171var yarp = builder.AddYarp("yarp").WithStaticFiles(workspace.Path); 186var yarp = builder.AddYarp("yarp").WithStaticFiles(workspace.Path); 200var yarp = builder.AddYarp("yarp").WithStaticFiles(workspace.Path); 212var yarp = builder.AddYarp("yarp").WithStaticFiles(workspace.Path); 216Assert.Contains(workspace.Path, annotation.ContextPath); 225var yarp = builder.AddYarp("yarp").WithStaticFiles(workspace.Path);
YarpConfigGeneratorTests.cs (2)
267using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, workspace.Path); 292var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml");