- For switching to
outside-of-repo
set<_BuildForTestsRunningOutsideOfRepo>true</_BuildForTestsRunningOutsideOfRepo>
in the project file.- tests cannot be run at this point as they will fail complaining about
artifacts/bin/dotnet-latest
being missing - Install the sdk+workload following the steps above
- Run/debug the tests normally now, and they will be using the sdk
- Also note that in this case the testproject is run from the bindir for
Aspire.EndToEnd.Tests
, so a path likeartifacts/bin/Aspire.EndToEnd.Tests/Debug/net8.0/testassets/testproject/
- tests cannot be run at this point as they will fail complaining about
- When running the tests you can either:
- set
<TestsRunningOutsideOfRepo>true</TestsRunningOutsideOfRepo>
totests/Aspire.EndToEnd.Tests/Directory.props
before any imports - or set the environment variable
TestsRunningOutsideOfRepo=true
- set
The following changes need to be made to when adding a new component:
- Add a new
TestResourceNames
enum entry. - Add ProjectReference to the new resource/component from the TestProject.AppHost and TestProject.IntegrationServiceA projects.
- Add PackageVersion entries to the new packages in Directory.Packages.Helix.props
- Add entries to the Program.cs of both the AppHost and IntegrationServiceA projects.
- Add a test in IntegrationServicesTests
- If the component's container starts in a reasonable time, the new test can just be a new
[InlineData]
entry to the existingVerifyComponentWorks
test. - If the container takes a long time to start, or is flaky, add a separate test scenario (similar to Oracle and Cosmos).
- If the component's container starts in a reasonable time, the new test can just be a new
See dotnet#4179 for an example.
-
We want to run some EndToEnd tests on CI, which can
dotnet run
an aspire project, and allow individual tests to interact with the services. This requires:- Ability to build, and run an aspire project - IOW, a sdk with the
aspire
workload installed. docker
- Ability to build, and run an aspire project - IOW, a sdk with the
-
Also, allow using
TestProject.*
intests/testproject
, in two modes:
in-repo
test run which directly reference aspire projects, and repo targetsoutside-of-repo
test runs which uses a SDK+workload based on local build output
- This can switch between the two test run modes using the msbuild property
$(TestsRunningOutsideOfRepo)
- when running
in-repo
the test project directly references hosting targets, and aspire projects viaProjectReference
- when running
outside-of-repo
theProjectReferences
and imports are replaced withPackageReferences
to the Aspire nugets
- when running
- Default is to run
in-repo
- The tests are built on the build machine
- The testproject, and the sdk+workload is sent to helix
- where the tests run using
dotnet
from the sdk+workload path
- where the tests run using
- Since
docker
is needed to helix, this is enabled only forLinux
in this PR. Blocked on dotnet/dnceng#2067 for windows support.