214 references to Path
Aspire.Hosting.Azure.Kusto.Tests (2)
KustoFunctionalTests.cs (2)
241
container.WithBindMount(temp.
Path
, dbPath);
265
return Directory.GetFileSystemEntries(temp.
Path
, searchPattern, enumerationOptions);
Aspire.Hosting.Azure.Tests (14)
AzureAppServiceTests.cs (3)
343
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
, step: "publish-manifest");
364
Path.Combine(tempDir.
Path
, "aspire-manifest.json"),
373
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
AzureContainerAppsTests.cs (5)
1619
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
, step: "publish-manifest");
1635
await VerifyFile(Path.Combine(tempDir.
Path
, "aspire-manifest.json"));
2009
File.WriteAllText(Path.Combine(tempDirectory.
Path
, "Dockerfile"), "FROM alpine");
2011
builder.AddDockerfile("with-bind-mount", tempDirectory.
Path
)
2012
.WithBindMount(tempDirectory.
Path
, "/app/data");
AzureEnvironmentResourceTests.cs (6)
189
tempDir.
Path
);
203
var mainBicepPath = Path.Combine(tempDir.
Path
, "main.bicep");
208
var includedStorageBicepPath = Path.Combine(tempDir.
Path
, "included-storage", "included-storage.bicep");
212
var excludedStorageBicepPath = Path.Combine(tempDir.
Path
, "excluded-storage", "excluded-storage.bicep");
222
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
234
var dockerfilePath = Path.Combine(tempDir.
Path
, "testcontainer.Dockerfile");
Aspire.Hosting.Containers.Tests (4)
DockerSocketBindMountTests.cs (4)
24
var dockerFilePath = Path.Combine(dir.
Path
, "Dockerfile");
29
appBuilder.AddDockerfile("docker-client", contextPath: dir.
Path
)
31
.WithBindMount(outDir.
Path
, "/out");
48
var infoFile = Path.Combine(outDir.
Path
, "docker-info.txt");
Aspire.Hosting.Docker.Tests (43)
DockerComposePublisherTests.cs (31)
22
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
97
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
98
var envPath = Path.Combine(tempDir.
Path
, ".env");
112
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
130
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
131
var envPath = Path.Combine(tempDir.
Path
, ".env");
143
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
)
158
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
170
using var builder = TestDistributedApplicationBuilder.Create(["--operation", "publish", "--publisher", "default", "--output-path", tempDir.
Path
])
193
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
202
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
242
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
244
var envPath = Path.Combine(tempDir.
Path
, ".env");
255
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
259
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
286
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
290
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
327
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
341
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
354
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
367
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
380
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
393
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
406
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
421
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
434
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
453
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
465
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
478
var dockerfilePath = Path.Combine(tempDir.
Path
, "testcontainer.Dockerfile");
490
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Run, tempDir.
Path
);
502
var composePath = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
DockerComposeTests.cs (6)
125
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
142
await VerifyDirectory(tempDir.
Path
);
150
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
162
var composeFile = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
174
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
196
var composeFile = Path.Combine(tempDir.
Path
, "docker-compose.yaml");
EnvFileTests.cs (6)
12
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
38
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
64
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
104
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
129
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
146
var envFilePath = Path.Combine(tempDir.
Path
, ".env");
Aspire.Hosting.Kubernetes.Tests (14)
KubernetesEnvironmentResourceTests.cs (2)
77
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
93
await VerifyDirectory(tempDir.
Path
);
KubernetesPublisherTests.cs (12)
17
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
63
var filePath = Path.Combine(tempDir.
Path
, expectedFile);
83
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
102
var deploymentPath = Path.Combine(tempDir.
Path
, "templates/service/deployment.yaml");
114
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
158
var filePath = Path.Combine(tempDir.
Path
, expectedFile);
178
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
212
var filePath = Path.Combine(tempDir.
Path
, expectedFile);
232
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
267
var filePath = Path.Combine(tempDir.
Path
, expectedFile);
287
var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
299
var dockerfilePath = Path.Combine(tempDir.
Path
, "testcontainer.Dockerfile");
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (1)
261
builder.Configuration["Aspire:Store:Path"] = tempStore.
Path
;
MySqlFunctionalTests.cs (1)
560
.WithTempAspireStore(aspireStore.
Path
)
Aspire.Hosting.NodeJs.Tests (48)
AddJavaScriptAppTests.cs (8)
15
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
18
var appDir = Path.Combine(tempDir.
Path
, "js");
25
await ManifestUtils.GetManifest(yarnApp.Resource, tempDir.
Path
);
27
var dockerfilePath = Path.Combine(tempDir.
Path
, "js.Dockerfile");
50
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
53
var appDir = Path.Combine(tempDir.
Path
, "js");
60
await ManifestUtils.GetManifest(pnpmApp.Resource, tempDir.
Path
);
62
var dockerfilePath = Path.Combine(tempDir.
Path
, "js.Dockerfile");
AddViteAppTests.cs (33)
15
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
18
var viteDir = Path.Combine(tempDir.
Path
, "vite");
27
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
52
var dockerfilePath = Path.Combine(tempDir.
Path
, "vite.Dockerfile");
85
File.WriteAllText(Path.Combine(tempDir.
Path
, "package.json"), packageJson);
87
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
88
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
91
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
93
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
105
File.WriteAllText(Path.Combine(tempDir.
Path
, ".nvmrc"), "18.20.0");
107
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
108
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
111
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
113
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
125
File.WriteAllText(Path.Combine(tempDir.
Path
, ".node-version"), "v21.5.0");
127
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
128
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
131
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
133
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
150
File.WriteAllText(Path.Combine(tempDir.
Path
, ".tool-versions"), toolVersions);
152
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
153
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
156
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
158
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
170
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
171
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
174
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
176
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
192
File.WriteAllText(Path.Combine(tempDir.
Path
, ".nvmrc"), versionString);
194
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: tempDir.
Path
).WithResourceCleanUp(true);
195
var nodeApp = builder.AddViteApp("vite", tempDir.
Path
)
198
var manifest = await ManifestUtils.GetManifest(nodeApp.Resource, tempDir.
Path
);
200
var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.
Path
, "vite.Dockerfile"));
PackageInstallationTests.cs (7)
420
File.WriteAllText(Path.Combine(tempDir.
Path
, "package-lock.json"), "empty");
424
var app = builder.AddViteApp("test-app", tempDir.
Path
)
447
File.WriteAllText(Path.Combine(tempDir.
Path
, "yarn.lock"), "empty");
451
var app = builder.AddViteApp("test-app", tempDir.
Path
)
457
var app2 = builder.AddViteApp("test-app2", tempDir.
Path
)
468
File.WriteAllText(Path.Combine(tempDir.
Path
, "pnpm-lock.yaml"), "empty");
472
var app = builder.AddViteApp("test-app", tempDir.
Path
)
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (2)
457
builder.Configuration["Aspire:Store:Path"] = tempStore.
Path
;
519
builder.Configuration["Aspire:Store:Path"] = tempStore.
Path
;
PostgresFunctionalTests.cs (1)
549
.WithTempAspireStore(aspireStore.
Path
)
Aspire.Hosting.Python.Tests (55)
AddPythonAppTests.cs (52)
383
builder.AddPythonScript("pythonProject", tempDir.
Path
, "main.py"));
396
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
405
var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.
Path
));
429
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
430
.WithVirtualEnvironment(tempVenvDir.
Path
);
440
Assert.Equal(Path.Join(tempVenvDir.
Path
, "Scripts", "python.exe"), pythonProjectResource.Command);
444
Assert.Equal(Path.Join(tempVenvDir.
Path
, "bin", "python"), pythonProjectResource.Command);
469
var resourceBuilder = builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName);
488
var resourceBuilder = builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
518
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
528
var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.
Path
));
540
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
561
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
596
var pythonBuilder = builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName)
614
var pythonBuilder = builder.AddPythonScript("python-script", tempDir.
Path
, "main.py");
633
var pythonBuilder = builder.AddPythonModule("flask-app", tempDir.
Path
, "flask");
652
var pythonBuilder = builder.AddPythonExecutable("pytest", tempDir.
Path
, "pytest");
673
builder.AddPythonScript("pythonProject", tempDir.
Path
, scriptName);
683
var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.
Path
));
709
builder.AddPythonModule("pythonProject", tempDir.
Path
, moduleName);
717
var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.
Path
));
743
builder.AddPythonExecutable("pythonProject", tempDir.
Path
, executableName);
751
var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.
Path
));
774
var pythonBuilder = builder.AddPythonModule("flask-app", tempDir.
Path
, "flask")
798
var pythonBuilder = builder.AddPythonScript("python-app", tempDir.
Path
, "main.py")
820
var pythonBuilder = builder.AddPythonExecutable("pytest", tempDir.
Path
, "pytest")
842
var pythonBuilder = builder.AddPythonScript("python-app", tempDir.
Path
, "main.py")
876
var pythonBuilder = builder.AddPythonScript("python-app", tempDir.
Path
, "main.py");
923
var resourceBuilder = builder.AddPythonScript("pythonProject", tempDir.
Path
, "main.py");
939
var projectDirectory = sourceDir.
Path
;
969
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.
Path
, step: "publish-manifest");
986
var scriptDockerfilePath = Path.Combine(outputDir.
Path
, "script-app.Dockerfile");
989
var moduleDockerfilePath = Path.Combine(outputDir.
Path
, "module-app.Dockerfile");
992
var executableDockerfilePath = Path.Combine(outputDir.
Path
, "executable-app.Dockerfile");
1009
var projectDirectory = sourceDir.
Path
;
1034
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.
Path
, step: "publish-manifest");
1051
var scriptDockerfilePath = Path.Combine(outputDir.
Path
, "script-app.Dockerfile");
1054
var moduleDockerfilePath = Path.Combine(outputDir.
Path
, "module-app.Dockerfile");
1057
var executableDockerfilePath = Path.Combine(outputDir.
Path
, "executable-app.Dockerfile");
1090
var appDirectory = Path.Combine(tempDir.
Path
, "myapp");
1092
var virtualEnvironmentPath = Path.Combine(tempDir.
Path
, ".venv");
1128
var appDirectory = Path.Combine(tempDir.
Path
, "myapp");
1130
var virtualEnvironmentPath = Path.Combine(tempDir.
Path
, ".venv");
1168
var appDirectory = Path.Combine(tempDir.
Path
, "myapp");
1170
var virtualEnvironmentPath = Path.Combine(tempDir.
Path
, ".venv");
1205
var appDirectory = Path.Combine(tempDir.
Path
, "myapp");
1207
var virtualEnvironmentPath = Path.Combine(tempDir.
Path
, ".venv");
1238
var appDirectory = Path.Combine(tempDir.
Path
, "myapp");
1240
var virtualEnvironmentPath = Path.Combine(tempDir.
Path
, ".venv");
1267
var pythonApp = builder.AddPythonScript("pythonProject", tempDir.
Path
, "main.py");
1289
var pythonApp = builder.AddPythonScript("pythonProject", tempDir.
Path
, "main.py");
1307
var pythonApp = builder.AddPythonScript("pythonProject", tempDir.
Path
, "main.py");
AddUvicornAppTests.cs (3)
33
var projectDirectory = sourceDir.
Path
;
63
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputDir.
Path
, step: "publish-manifest");
87
var appDockerfilePath = Path.Combine(outputDir.
Path
, "main.Dockerfile");
Aspire.Hosting.Tests (21)
MSBuildTests.cs (5)
20
CreateLibraryProject(tempDirectory.
Path
, "Library");
22
var appHostDirectory = Path.Combine(tempDirectory.
Path
, "AppHost");
76
CreateAppProject(tempDirectory.
Path
, "App");
78
var appHostDirectory = Path.Combine(tempDirectory.
Path
, "AppHost");
128
var temp = tempDirectory?.
Path
;
PublishAsDockerfileTests.cs (14)
18
var path = tempDir.
Path
;
56
var path = tempDir.
Path
;
109
var path = tempDir.
Path
;
154
var path = tempDir.
Path
;
216
var path = tempDir.
Path
;
273
var path = tempDir.
Path
;
290
var path = tempDir.
Path
;
310
var path = tempDir.
Path
;
333
var path = tempDir.
Path
;
363
var path = tempDir.
Path
;
380
var path = tempDir.
Path
;
409
var path = tempDir.
Path
;
426
var path = tempDir.
Path
;
453
File.WriteAllText(Path.Join(tempDir.
Path
, "Dockerfile"), "this does not matter");
Publishing\ResourceContainerImageBuilderTests.cs (1)
250
OutputPath = Path.Combine(tempDir.
Path
, "NewFolder"), // tests that the folder is created if it doesn't exist
tests\Shared\TempDirectory.cs (1)
12
Directory.Delete(
Path
, recursive: true);
Aspire.Hosting.Yarp.Tests (8)
AddYarpTests.cs (6)
134
var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.
Path
);
149
var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.
Path
);
163
var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.
Path
);
175
var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.
Path
);
179
Assert.Contains(tempDir.
Path
, annotation.ContextPath);
188
var yarp = builder.AddYarp("yarp").WithStaticFiles(tempDir.
Path
);
YarpConfigGeneratorTests.cs (2)
268
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.
Path
);
293
var composeFile = Path.Combine(tempDir.
Path
, "docker-compose.yaml");