Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create functional tests #1217

Merged
merged 22 commits into from
Dec 14, 2023
Merged

Create functional tests #1217

merged 22 commits into from
Dec 14, 2023

Conversation

sebastienros
Copy link
Member

@sebastienros sebastienros commented Dec 6, 2023

Added functional tests for

  • PostgreSQL
  • MongoDB
  • MS SQL
  • Redis
  • RabbitMQ
  • MySql

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Dec 6, 2023
@sebastienros
Copy link
Member Author

After some feedback I am going to change the tests to use a Fixture representing this AppHost such that each test can use the same app instance and shut it down when the tests are done.

@sebastienros sebastienros changed the title Add smoke tests for mongodb Create functional tests Dec 7, 2023
sebastienros and others added 5 commits December 7, 2023 09:08
[ci-skip]

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
[ci-skip]

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
# Conflicts:
#	tests/testproject/TestProject.AppHost/TestProgram.cs
#	tests/testproject/TestProject.IntegrationServiceA/Program.cs
app.MapGet("/mongodb/movies", GetMoviesAsync);
}

private static async Task<List<string>> GetDatabaseNamesAsync(IMongoClient client, IMongoDatabase db)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These handlers should probably take the abstract version of the resource as a dependency as a well via keyed DI. That way you can test both flavors.

var mongodbContainer = AppBuilder.AddMongoDBContainer("mongodbcontainer");
var mongodbContainer = AppBuilder.AddMongoDBContainer("mongodbcontainer")
.AddDatabase(mongoDbName);

var sqlserverAbstract = AppBuilder.AddSqlServerContainer("sqlserverabstract");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchdenny - what are these "Abstract" containers? It looks to be doing the same thing as above - AppBuilder.AddSqlServerContainer, just with a different name.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for this great work.

It might be good to get @mitchdenny to sign off on the changes as well.

@sebastienros sebastienros merged commit 1373e14 into main Dec 14, 2023
@sebastienros sebastienros deleted the sebros/functionalmongo branch December 14, 2023 22:22
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants