436 references to Path
Aspire.Hosting.Azure.Kusto.Tests (2)
KustoFunctionalTests.cs (2)
247container.WithBindMount(temp.Path, dbPath); 271return Directory.GetFileSystemEntries(temp.Path, searchPattern, enumerationOptions);
Aspire.Hosting.Azure.Tests (29)
AzureAppServiceTests.cs (5)
83var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "validate-appservice-config-env"); 124var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "validate-appservice-config-env"); 419var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "publish-manifest"); 440Path.Combine(tempDir.Path, "aspire-manifest.json"), 449var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path);
AzureBicepResourceTests.cs (4)
261var bicepFilePath = Path.Combine(tempDir.Path, bicepFileName); 268var outputDir = Path.Combine(tempDir.Path, "output"); 286var bicepFilePath = Path.Combine(tempDir.Path, bicepFileName); 310var outputDir = Path.Combine(tempDir.Path, "output");
AzureContainerAppsTests.cs (5)
1749var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "publish-manifest"); 1765await VerifyFile(Path.Combine(tempDir.Path, "aspire-manifest.json")); 2139File.WriteAllText(Path.Combine(tempDirectory.Path, "Dockerfile"), "FROM alpine"); 2141builder.AddDockerfile("with-bind-mount", tempDirectory.Path) 2142.WithBindMount(tempDirectory.Path, "/app/data");
AzureEnvironmentResourceTests.cs (8)
190tempDir.Path); 204var mainBicepPath = Path.Combine(tempDir.Path, "main.bicep"); 209var includedStorageBicepPath = Path.Combine(tempDir.Path, "included-storage", "included-storage.bicep"); 213var excludedStorageBicepPath = Path.Combine(tempDir.Path, "excluded-storage", "excluded-storage.bicep"); 223var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 235var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile"); 248remoteInvokeOptions.StartInfo.WorkingDirectory = testTempDir.Path; 249RemoteExecutor.Invoke(RunTest, testTempDir.Path, remoteInvokeOptions).Dispose();
AzureFunctionsTests.cs (7)
650var projectPath = Path.Combine(tempDir.Path, "TestFunctions.csproj"); 675var projectPath = Path.Combine(tempDir.Path, "MyFunctions.csproj"); 697var projectPath = Path.Combine(tempDir.Path, "TestFunctions.csproj"); 727var projectPath1 = Path.Combine(tempDir.Path, "Functions1.csproj"); 728var projectPath2 = Path.Combine(tempDir.Path, "Functions2.csproj"); 750var projectPath = Path.Combine(tempDir.Path, "Functions.csproj"); 782var projectPath = Path.Combine(tempDir.Path, "Functions.csproj");
Aspire.Hosting.Containers.Tests (4)
DockerSocketBindMountTests.cs (4)
23var dockerFilePath = Path.Combine(dir.Path, "Dockerfile"); 28appBuilder.AddDockerfile("docker-client", contextPath: dir.Path) 30.WithBindMount(outDir.Path, "/out"); 47var infoFile = Path.Combine(outDir.Path, "docker-info.txt");
Aspire.Hosting.Docker.Tests (86)
DockerComposePublisherTests.cs (66)
22var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 97var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 98var envPath = Path.Combine(tempDir.Path, ".env"); 112var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 134var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 135var envPath = Path.Combine(tempDir.Path, ".env"); 147using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path) 162var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 172using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "publish-docker-compose") 191var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 200var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 240var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 242var envPath = Path.Combine(tempDir.Path, ".env"); 253var envFilePath = Path.Combine(tempDir.Path, ".env"); 257var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 284var envFilePath = Path.Combine(tempDir.Path, ".env"); 288var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 325var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 339var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 351var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 365var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 380var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 397var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 413var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 426var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 439var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 452var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 465var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 480var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 493var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 512var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 524var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 537var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile"); 549var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Run, tempDir.Path); 561var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 570var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "prepare-docker-compose"); 588var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production")); 598var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "prepare-docker-compose"); 617var envFilePath = Path.Combine(tempDir.Path, ".env.Staging"); 630var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "prepare-docker-compose"); 651var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production")); 661var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "prepare-docker-compose"); 673var envFilePath = Path.Combine(tempDir.Path, ".env.Production"); 694var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "prepare-docker-compose"); 707var envFilePath = Path.Combine(tempDir.Path, ".env.Staging"); 724var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 738var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 739var envPath = Path.Combine(tempDir.Path, ".env"); 752var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 765var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 781var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 796var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 797var envPath = Path.Combine(tempDir.Path, ".env"); 810var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 835var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 836var envPath = Path.Combine(tempDir.Path, ".env"); 849var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 883var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 884var envPath = Path.Combine(tempDir.Path, ".env"); 903var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 917var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 918var envPath = Path.Combine(tempDir.Path, ".env"); 930var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 961var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 971var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 995var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
DockerComposeTests.cs (14)
133var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 150await VerifyDirectory(tempDir.Path); 158var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 170var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml"); 182var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 204var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml"); 266var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: step); 293var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 320var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: WellKnownPipelineSteps.Diagnostics); 368var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: step); 631var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "push-servicea"); 661var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: "push-servicea"); 697var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: WellKnownPipelineSteps.Diagnostics); 745var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path, step: WellKnownPipelineSteps.Diagnostics);
EnvFileTests.cs (6)
12var envFilePath = Path.Combine(tempDir.Path, ".env"); 38var envFilePath = Path.Combine(tempDir.Path, ".env"); 64var envFilePath = Path.Combine(tempDir.Path, ".env"); 104var envFilePath = Path.Combine(tempDir.Path, ".env"); 129var envFilePath = Path.Combine(tempDir.Path, ".env"); 146var envFilePath = Path.Combine(tempDir.Path, ".env");
Aspire.Hosting.JavaScript.Tests (109)
AddJavaScriptAppTests.cs (12)
17using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 20var appDir = Path.Combine(tempDir.Path, "js"); 27await ManifestUtils.GetManifest(yarnApp.Resource, tempDir.Path); 29var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile"); 55using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 58var appDir = Path.Combine(tempDir.Path, "js"); 70await ManifestUtils.GetManifest(pnpmApp.Resource, tempDir.Path); 72var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile"); 84using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 87var appDir = Path.Combine(tempDir.Path, "pnpm-app"); 106await ManifestUtils.GetManifest(pnpmApp.Resource, tempDir.Path); 108var dockerfilePath = Path.Combine(tempDir.Path, "pnpm-app.Dockerfile");
AddNodeAppTests.cs (31)
99using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 101var appDir = Path.Combine(tempDir.Path, "js"); 112await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 114var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile"); 167using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 169var appDir = Path.Combine(tempDir.Path, "js"); 181await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 183var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile"); 214using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 216var appDir = Path.Combine(tempDir.Path, "js"); 226await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 229var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "js.Dockerfile")); 238File.WriteAllText(Path.Combine(tempDir.Path, "app.js"), "{}"); 242builder.AddNodeApp("nodeapp", tempDir.Path, "app.js"); 265File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), "{}"); 269builder.AddNodeApp("nodeapp", tempDir.Path, "app.js"); 321var appDirectory = sourceDir.Path; 341using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 364var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile"); 377var appDirectory = sourceDir.Path; 397using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 420var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile"); 439var nodeApp = builder.AddNodeApp("nodeapp", tempDir.Path, "app.js"); 452var nodeApp = builder.AddNodeApp("nodeapp", tempDir.Path, "app.js"); 464var viteApp = builder.AddViteApp("viteapp", tempDir.Path); 477var viteApp = builder.AddViteApp("viteapp", tempDir.Path) 504var viteApp = builder.AddViteApp("viteapp", tempDir.Path) 521var viteApp = builder.AddViteApp("viteapp", tempDir.Path) 538var resource = new JavaScriptAppResource("jsapp", "npm", tempDir.Path); 559File.WriteAllText(Path.Combine(tempDir.Path, "app.js"), "console.log('hello');"); 561var nodeApp = builder.AddNodeApp("nodeapp", tempDir.Path, "app.js")
AddViteAppTests.cs (51)
19using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 22var viteDir = Path.Combine(tempDir.Path, "vite"); 31var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 57var dockerfilePath = Path.Combine(tempDir.Path, "vite.Dockerfile"); 91File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), packageJson); 93using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 94var nodeApp = builder.AddViteApp("vite", tempDir.Path) 97var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 99var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 111File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), "18.20.0"); 113using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 114var nodeApp = builder.AddViteApp("vite", tempDir.Path) 117var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 119var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 131File.WriteAllText(Path.Combine(tempDir.Path, ".node-version"), "v21.5.0"); 133using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 134var nodeApp = builder.AddViteApp("vite", tempDir.Path) 137var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 139var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 156File.WriteAllText(Path.Combine(tempDir.Path, ".tool-versions"), toolVersions); 158using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 159var nodeApp = builder.AddViteApp("vite", tempDir.Path) 162var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 164var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 176using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 177var nodeApp = builder.AddViteApp("vite", tempDir.Path) 180var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 182var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 198File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), versionString); 200using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 201var nodeApp = builder.AddViteApp("vite", tempDir.Path) 204var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 206var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 215using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.Path).WithResourceCleanUp(true); 218var nodeApp = builder.AddViteApp("vite", tempDir.Path) 222var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.Path); 228var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 286var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin"); 290var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js"); 294var viteApp = builder.AddViteApp("test-app", tempDir.Path) 347var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin"); 351var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js"); 355var viteApp = builder.AddViteApp("test-app", tempDir.Path); 406var viteApp = builder.AddViteApp("test-app", tempDir.Path); 451var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin"); 455var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js"); 459var viteApp = builder.AddViteApp("test-app", tempDir.Path); 506var subDir = Path.Combine(tempDir.Path, "my-app", "frontend"); 585var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin"); 589var viteConfigPath = Path.Combine(tempDir.Path, configFileName); 593var viteApp = builder.AddViteApp("test-app", tempDir.Path);
PackageInstallationTests.cs (15)
458File.WriteAllText(Path.Combine(tempDir.Path, "package-lock.json"), "empty"); 462var app = builder.AddViteApp("test-app", tempDir.Path) 485File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty"); 489var app = builder.AddViteApp("test-app", tempDir.Path) 495var app2 = builder.AddViteApp("test-app2", tempDir.Path) 506File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty"); 507File.WriteAllText(Path.Combine(tempDir.Path, ".yarnrc.yml"), "empty"); 511var app = builder.AddViteApp("test-app", tempDir.Path) 522File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty"); 523Directory.CreateDirectory(Path.Combine(tempDir.Path, ".yarn", "releases")); 527var app = builder.AddViteApp("test-app", tempDir.Path) 538File.WriteAllText(Path.Combine(tempDir.Path, "pnpm-lock.yaml"), "empty"); 542var app = builder.AddViteApp("test-app", tempDir.Path) 553File.WriteAllText(Path.Combine(tempDir.Path, "bun.lock"), "empty"); 557var app = builder.AddViteApp("test-app", tempDir.Path)
Aspire.Hosting.Kubernetes.Tests (24)
KubernetesEnvironmentResourceTests.cs (2)
78var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 94await VerifyDirectory(tempDir.Path);
KubernetesPublisherTests.cs (22)
17var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 63var filePath = Path.Combine(tempDir.Path, expectedFile); 83var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 102var deploymentPath = Path.Combine(tempDir.Path, "templates/service/deployment.yaml"); 114var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 158var filePath = Path.Combine(tempDir.Path, expectedFile); 178var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 212var filePath = Path.Combine(tempDir.Path, expectedFile); 232var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 267var filePath = Path.Combine(tempDir.Path, expectedFile); 287var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 299var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile"); 360var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 394var filePath = Path.Combine(tempDir.Path, expectedFile); 414var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 438var filePath = Path.Combine(tempDir.Path, expectedFile); 456var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 495var filePath = Path.Combine(tempDir.Path, expectedFile); 515var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 549var filePath = Path.Combine(tempDir.Path, expectedFile); 569var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 606var filePath = Path.Combine(tempDir.Path, expectedFile);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (1)
262builder.Configuration["Aspire:Store:Path"] = tempStore.Path;
MySqlFunctionalTests.cs (1)
564.WithTempAspireStore(aspireStore.Path)
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (2)
481builder.Configuration["Aspire:Store:Path"] = tempStore.Path; 543builder.Configuration["Aspire:Store:Path"] = tempStore.Path;
PostgresFunctionalTests.cs (1)
551.WithTempAspireStore(aspireStore.Path)
Aspire.Hosting.Python.Tests (138)
AddPythonAppTests.cs (135)
397builder.AddPythonApp("pythonProject", tempDir.Path, "main.py")); 410builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 419var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 443builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 444.WithVirtualEnvironment(tempVenvDir.Path); 454Assert.Equal(Path.Join(tempVenvDir.Path, "Scripts", "python.exe"), pythonProjectResource.Command); 458Assert.Equal(Path.Join(tempVenvDir.Path, "bin", "python"), pythonProjectResource.Command); 483var resourceBuilder = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 502var resourceBuilder = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 531var appVenvPath = Path.Combine(tempAppDir.Path, ".venv"); 535var resourceBuilder = builder.AddPythonApp("pythonProject", tempAppDir.Path, scriptName); 544var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempAppDir.Path)); 556options.ProjectDirectory = tempProjectDir.Path; 602options.ProjectDirectory = tempProjectDir.Path; 654var resourceBuilder = builder.AddPythonApp("pythonProject", tempAppDir.Path, scriptName); 663var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempAppDir.Path)); 675options.ProjectDirectory = tempProjectDir.Path; 730var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 740var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 761var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 781builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 819var pythonBuilder = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 839var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 863var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 894var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 921var pythonBuilder = builder.AddPythonApp("python-script", tempDir.Path, "main.py"); 940var pythonBuilder = builder.AddPythonModule("flask-app", tempDir.Path, "flask"); 959var pythonBuilder = builder.AddPythonExecutable("pytest", tempDir.Path, "pytest"); 980builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 990var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 1016builder.AddPythonModule("pythonProject", tempDir.Path, moduleName); 1024var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 1050builder.AddPythonExecutable("pythonProject", tempDir.Path, executableName); 1058var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 1081var pythonBuilder = builder.AddPythonModule("flask-app", tempDir.Path, "flask") 1105var pythonBuilder = builder.AddPythonApp("python-app", tempDir.Path, "main.py") 1127var pythonBuilder = builder.AddPythonExecutable("pytest", tempDir.Path, "pytest") 1149var pythonBuilder = builder.AddPythonApp("python-app", tempDir.Path, "main.py") 1183var pythonBuilder = builder.AddPythonApp("python-app", tempDir.Path, "main.py"); 1230var resourceBuilder = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py"); 1246var projectDirectory = sourceDir.Path; 1276using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1293var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1296var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile"); 1299var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile"); 1316var projectDirectory = sourceDir.Path; 1341using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1358var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1361var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile"); 1364var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile"); 1397var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1399var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1435var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1437var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1475var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1477var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1512var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1514var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1545var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1547var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1574var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py"); 1596var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py"); 1614var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py"); 1629var projectDirectory = sourceDir.Path; 1657using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1670var dockerfilePath = Path.Combine(outputDir.Path, "custom-images-app.Dockerfile"); 1687var projectDirectory = sourceDir.Path; 1702using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1711var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1734var projectDirectory = sourceDir.Path; 1751using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1760var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1773var projectDirectory = sourceDir.Path; 1782using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1791var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1804var projectDirectory = sourceDir.Path; 1816using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 1827var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1830var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile"); 1833var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile"); 1862var scriptPath = Path.Combine(tempDir.Path, scriptName); 1866var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml"); 1869var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 1896var scriptPath = Path.Combine(tempDir.Path, scriptName); 1900var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 1903var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 1931var scriptPath = Path.Combine(tempDir.Path, scriptName); 1935var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml"); 1937var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 1940var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 1961var scriptPath = Path.Combine(tempDir.Path, scriptName); 1964var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, scriptName); 1985var scriptPath = Path.Combine(tempDir.Path, scriptName); 1989builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 1990.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: false); 2008var scriptPath = Path.Combine(tempDir.Path, scriptName); 2012var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2016builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 2017.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: true); 2036var scriptPath = Path.Combine(tempDir.Path, scriptName); 2040var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2044builder.AddPythonApp("pythonProject", tempDir.Path, scriptName) 2045.WithVirtualEnvironment(tempVenvDir.Path); 2065var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2068var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2093var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2097var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2100var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2136var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2139var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2142var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2144.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: true); 2166var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2169var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2172var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2174.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: false); 2200var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2203var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2207var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2209.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: true) 2236var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2239var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2243var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2245.WithVirtualEnvironment(tempVenvDir.Path, createIfNotExists: false) 2266var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2269var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2273var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2298var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2301var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2305var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2330var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2333var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt"); 2336var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py") 2366var scriptPath = Path.Combine(tempDir.Path, "main.py"); 2369var pythonApp = builder.AddPythonApp("pythonProject", tempDir.Path, "main.py")
AddUvicornAppTests.cs (3)
33var projectDirectory = sourceDir.Path; 63using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.Path, step: "publish-manifest"); 87var appDockerfilePath = Path.Combine(outputDir.Path, "main.Dockerfile");
Aspire.Hosting.Tests (31)
MSBuildTests.cs (12)
21CreateLibraryProject(tempDirectory.Path, "Library"); 23var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 78CreateAppProject(tempDirectory.Path, "App"); 80var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 131var temp = tempDirectory?.Path; 267CreateLibraryProject(tempDirectory.Path, "Library"); 269var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 326CreateLibraryProject(tempDirectory.Path, "Library"); 328var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 381var projectDirectory = Path.Combine(tempDirectory.Path, "MyHostingExtension"); 430var projectDirectory = Path.Combine(tempDirectory.Path, "MyHostingExtension"); 511var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
PublishAsDockerfileTests.cs (14)
21var path = tempDir.Path; 59var path = tempDir.Path; 112var path = tempDir.Path; 157var path = tempDir.Path; 219var path = tempDir.Path; 274var path = tempDir.Path; 291var path = tempDir.Path; 311var path = tempDir.Path; 334var path = tempDir.Path; 364var path = tempDir.Path; 381var path = tempDir.Path; 410var path = tempDir.Path; 427var path = tempDir.Path; 454File.WriteAllText(Path.Join(tempDir.Path, "Dockerfile"), "this does not matter");
Publishing\ResourceContainerImageManagerTests.cs (4)
270ctx.OutputPath = Path.Combine(tempDir.Path, "NewFolder"); // tests that the folder is created if it doesn't exist 860var tempSecretFile = System.IO.Path.Combine(tempDir.Path, ".npmrc"); 1210ctx.OutputPath = Path.Combine(tempDir.Path, "archives"); 1332ctx.OutputPath = Path.Combine(tempDir.Path, "archives");
tests\Shared\TempDirectory.cs (1)
12Directory.Delete(Path, recursive: true);
Aspire.Hosting.Yarp.Tests (8)
AddYarpTests.cs (6)
148var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.Path); 163var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.Path); 177var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.Path); 189var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.Path); 193Assert.Contains(tempDir.Path, annotation.ContextPath); 202var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.Path);
YarpConfigGeneratorTests.cs (2)
267using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.Path); 292var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml");