Avoid unnecessary containers in Aspire.Hosting.Testing.Tests#7666
Merged
ReubenBond merged 1 commit intomainfrom Feb 19, 2025
Merged
Avoid unnecessary containers in Aspire.Hosting.Testing.Tests#7666ReubenBond merged 1 commit intomainfrom
ReubenBond merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (4)
tests/Aspire.Hosting.Testing.Tests/TestingBuilderTests.cs:129
- [nitpick] Ensure that the new connection string check covers all necessary cases and does not introduce any unintended side effects.
var connectionString = await app.GetConnectionStringAsync("cs");
tests/Aspire.Hosting.Testing.Tests/TestingBuilderTests.cs:149
- The removal of the Redis container check might affect tests that rely on it. Ensure that all affected tests are updated accordingly.
Assert.Contains(appModel.GetContainerResources(), c => c.Name == "redis1");
tests/TestingAppHost1/TestingAppHost1.AppHost/Program.cs:28
- The removal of AddPostgres("postgres1") could cause issues if the PostgreSQL container is still required.
builder.AddPostgres("postgres1");
tests/Aspire.Hosting.Testing.Tests/TestingFactoryTests.cs:20
- The change from async to sync in
HasEndPointsmight affect the test's correctness. Verify that the test does not require async operations.
public void HasEndPoints()
ReubenBond
commented
Feb 19, 2025
| // Get a connection string from a resource | ||
| var pgConnectionString = await _app.GetConnectionStringAsync("postgres1"); | ||
| Assert.NotNull(pgConnectionString); | ||
| Assert.True(pgConnectionString.Length > 0); |
Member
Author
There was a problem hiding this comment.
Note that the next test already exercises the GetConnectionStringAsync method
karolz-ms
approved these changes
Feb 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR removes unnecessary containers from the Aspire.Hosting.Testing.Tests suite.
Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):