Skip to content

Commit c325772

Browse files
committed
Fix failing test
This test used to pass with VSTest and xunit v2 because the tests were run under testhost.exe. So, DistributedApplicationOptions.Assembly was pointing to testhost. Then ResolveProjectDirectory wouldn't correctly find AppHostProjectPath. In DistributedApplicationBuilder constructor, we were falling back to _innerBuilder.Environment.ContentRootPath because ProjectDirectory is null. With xunit.v3 *or* MTP, generally when the test app is executed as normal executable, we have the right assembly and we are able to resolve project directory correctly
1 parent e15a2b6 commit c325772

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/Aspire.Hosting.Tests/ExecutableResourceTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ public async Task AddExecutableWithArgs()
4949
);
5050

5151
var manifest = await ManifestUtils.GetManifest(exe2.Resource).DefaultTimeout();
52-
52+
// Note: resource working directory is <repo-root>\tests\Aspire.Hosting.Tests
53+
// Manifest directory is <repo-root>\artifacts\bin\Aspire.Hosting.Tests\Debug\net8.0
5354
var expectedManifest =
5455
"""
5556
{
5657
"type": "executable.v0",
57-
"workingDirectory": ".",
58+
"workingDirectory": "../../../../../tests/Aspire.Hosting.Tests",
5859
"command": "python",
5960
"args": [
6061
"app.py",

0 commit comments

Comments
 (0)