-
Notifications
You must be signed in to change notification settings - Fork 556
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
Refactor functional tests #2037
Conversation
- Split the functional Components Integration tests out of Aspire.Hosting.Tests into a new EndToEnd project. - Start the test AppHost project using `dotnet run` instead of running the DistributedAppBuilder inline in the tests. This allows for the tests to run on a separate machine than where the tests are built. - Along with this, we need to pass information from the test AppHost to the test about its endpoints, and give it a signal to "stop". Instead of trying to find a way to CTRL+C cross-platform, read from stdin for a "Stop" command.
b8d0c21
to
6f765b0
Compare
The tests will run for as long as they need to. The larger timeout will handle any real hangs. Also handle retries in Cosmos.
Also set up resilience handler for the HttpClient.
Also set EnableRaisingEvents so Exited fires.
Until they can be run in Helix
2f42509
to
e4bf95c
Compare
Over the weekend I was playing with the idea of disabling certain components/routes in the test project depending on what connection strings were populated and then using the AppHost to selectively enable the various dependent services. The idea being that for any given integration test you could narrow the scope of the containers that you were launching and improve performance. I think it would be good to tackle this at the same time or as a fast follow on this PR. |
This is tracked by #1704. (cc @ReubenBond @DamianEdwards). |
* Refactor functional tests - Split the functional Components Integration tests out of Aspire.Hosting.Tests into a new EndToEnd project. - Start the test AppHost project using `dotnet run` instead of running the DistributedAppBuilder inline in the tests. This allows for the tests to run on a separate machine than where the tests are built. - Along with this, we need to pass information from the test AppHost to the test about its endpoints, and give it a signal to "stop". Instead of trying to find a way to CTRL+C cross-platform, read from stdin for a "Stop" command. * Collapse integration tests into one class. * Make common tests into a theory * Remove timeouts from tests. The tests will run for as long as they need to. The larger timeout will handle any real hangs. Also handle retries in Cosmos. * Write output when running the AppHost times out. * Disable the TestProject's dashboard during test run. Also set up resilience handler for the HttpClient. * Log stderr and handle waiting better. Also set EnableRaisingEvents so Exited fires. * Make EndToEnd tests local-only Until they can be run in Helix
dotnet run
instead of running the DistributedAppBuilder inline in the tests. This allows for the tests to run on a separate machine than where the tests are built. - Along with this, we need to pass information from the test AppHost to the test about its endpoints, and give it a signal to "stop". Instead of trying to find a way to CTRL+C cross-platform, read from stdin for a "Stop" command.The main new code is in EndToEnd.Tests TestProgramFixture.cs.
Microsoft Reviewers: Open in CodeFlow