dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
2.99k stars 283 forks source link

Fixes unit test templates for spaces in names #3959

Closed timheuer closed 2 weeks ago

timheuer commented 2 weeks ago

Fix #3957 and #3974

image

Microsoft Reviewers: Open in CodeFlow
radical commented 2 weeks ago

/private/tmp/test/asp-starter-with-redis-with-xunit0/asp-starter-with-redis-with-xunit0.Tests/WebTests.cs(11,131): error CS1525: Invalid expression term ')' [/private/tmp/test/asp-starter-with-redis-with-xunit0/asp-starter-with-redis-with-xunit0.Tests/asp-starter-with-redis-with-xunit0.Tests.csproj]

line 11: var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.asp-starter-with-redis-with-xunit0_AppHost>();

radical commented 2 weeks ago

This works;

diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
index 26eb9fb66..a0a114dde 100644
--- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
+++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
@@ -17,7 +17,7 @@ public class WebTests
     public async Task GetWebResourceRootReturnsOkStatusCode()
     {
         // Arrange
-        var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireStarterApplication.1_AppHost>();
+        var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireStarterApplication._1_AppHost>();
         await using var app = await appHost.BuildAsync();
         await app.StartAsync();
timheuer commented 2 weeks ago

@radical I implemented the last one you found...did your local tests find anything else in the template tests?

timheuer commented 2 weeks ago

/backport to release/8.0

github-actions[bot] commented 2 weeks ago

Started backporting to release/8.0: https://github.com/dotnet/aspire/actions/runs/8853529459

github-actions[bot] commented 2 weeks ago

@timheuer an error occurred while backporting to release/8.0, please check the run log for details!

Error: @timheuer is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=timheuer

DamianEdwards commented 2 weeks ago

/backport to release/8.0

github-actions[bot] commented 2 weeks ago

Started backporting to release/8.0: https://github.com/dotnet/aspire/actions/runs/8854015349

github-actions[bot] commented 2 weeks ago

@DamianEdwards backporting to release/8.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fixes unit test templates for spaces in names Fix #3957
error: mode change for src/Aspire.ProjectTemplates/templates/aspire-mstest/Aspire.Tests1.csproj, which is not in current HEAD
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fixes unit test templates for spaces in names Fix #3957
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

github-actions[bot] commented 2 weeks ago

@DamianEdwards an error occurred while backporting to release/8.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

DamianEdwards commented 2 weeks ago

@timheuer looks like you'll need to manually backport