ServiceControl tests are designed to test different components and behaviors. This document outlines the tests in the repository and what they are meant to test.
ServiceControl components have specific unit test projects verifying their behaviors and API.
Packaging tests check:
- Folder structure and content of the packaging process output.
- That packaged assembly versions match.
Installation engine tests run partial installations and checks:
- That the generated configuration is correct.
- That transport and persistence are correctly extracted.
Persistence tests check assumptions at the persistence seam level by exercising each persister.
Transport tests are done by executing the transport test suite for each transport.
Run ServiceControl full version and use the HTTP API to validate results. LearningTransport is used for all tests.
Multi-instance tests validate the interaction between different ServiceControl instances. ServiceControl instances are run in-memory in the same process. LearningTransport is used for all tests.
Container images generated for all builds are pushed to the GitHub container registry. Once pushed, all images are tested by spinning them all up for each supported transport.
Containers built by a PR and stored on GitHub Container Registry can be tested locally:
- Authenticate to the GitHub Container Registry using a personal access token.
- Create a classic token. Select the scope for
read:packages - Copy the newly created token text.
- Run the following command in a terminal:
you will be prompted for a username (your particular.net email) and a password (the token)
docker login ghcr.io
- ensure that you get a successful login message.
- Use
docker logout ghcr.ioonce the following steps are complete and consider removing the token from github if its no longer needed
- Create a classic token. Select the scope for
- In the terminal, navigate to
/docs/test-ghcr-tag. - Edit the
.envfile to specify the PR-based tag (in the formpr-####) to test. - Run
docker compose up -d. - Services will be available at the following URLs:
- RabbitMQ Management (Login:
guest/guest) - RavenDB
- ServiceControl API
- Audit API
- Monitoring API
- ServicePulse (latest from Docker Hub)
- RabbitMQ Management (Login:
- Tear down services using
docker compose down.
The Particular.Aspire.Hosting.ServicePlatform package integrates the Particular Platform with the Aspire hosting platform. This package configures environment variables to attach the platform. There is a single file apphost in test-ghcr-tag-aspire to start up serviceconrol from a prerelease container image.
Containers built by a PR and stored on GitHub Container Registry can be tested locally:
- Set up your github container registry credentials as described in the Container tests section above.
- Make sure you have the Aspire CLI installed.
- Run
aspire run docs/test-ghcr-tag-aspire/AppHost.cs -- tagto start the application, wheretagis the PR-based tag (in the formpr-####) to test. If no tag is provided, it will default to thelatesttag. - Once running you can open the dashboard from the link in the terminal, this dashboard will provide the assigned ports for each service.
- RabbitMQ Management (Login:
guest/guest) - RavenDB
- ServiceControl API
- Audit API
- Monitoring API
- ServicePulse (latest from Docker Hub)
- RabbitMQ Management (Login:
- Aspire will automatically tear down the application when you exit the CLI process.