diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index 0b468c0..0000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Looking for Support - -Check out our [support options](https://particular.net/support). \ No newline at end of file diff --git a/.github/copy-sc-testing.md b/.github/copy-sc-testing.md new file mode 100644 index 0000000..0d24541 --- /dev/null +++ b/.github/copy-sc-testing.md @@ -0,0 +1,105 @@ +# Testing + +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. + +## Unit tests + +ServiceControl components have specific unit test projects verifying their behaviors and API. + +## Packaging tests + +Packaging tests check: + +- Folder structure and content of the [packaging process](packaging.md) output. +- That packaged [assembly versions match](packaging.md#assembly-mismatches). + +## Installation engine tests + +Installation engine tests run partial installations and checks: + +- That the generated configuration is correct. +- That transport and persistence are correctly extracted. + +## Persistence tests + +Persistence tests check assumptions at the persistence seam level by exercising each persister. +For local setup details, see [Local Testing of Persistence Providers](testing-persistence.md). + +## Transport tests + +Transport tests are done by executing the transport test suite for each transport. + +## Acceptance tests + +Run ServiceControl full version and use the HTTP API to validate results. LearningTransport is used for all tests. + +### Windows prerequisite: register the event sources + +On Windows, every acceptance test fails on first run with: + +``` +System.Security.SecurityException : The source ServiceControl was not found on computer ., +but some or all event logs could not be searched. Inaccessible logs: Security. +``` + +Setup registers a Windows event source, and checking whether one already exists enumerates every event log, including `Security`, which a process without administrator rights cannot read. + +Register both sources once, from an **elevated** PowerShell prompt: + +```powershell +[System.Diagnostics.EventLog]::CreateEventSource('ServiceControl', 'Application') +[System.Diagnostics.EventLog]::CreateEventSource('ServiceControl.Audit', 'Application') +``` + +Use the .NET API as shown rather than `New-EventLog`, which is not available in PowerShell 7. Afterwards the tests run normally without elevation, because the lookup finds the registered source before it needs to read `Security`. + +## Multi-instance 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 tests + +Container images generated for all builds are pushed to the [GitHub container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry). Once pushed, all images are tested by [spinning them all up for each supported transport](/src/container-integration-test/). + +Containers built by a PR and stored on GitHub Container Registry can be tested locally: + +1. [Authenticate to the GitHub Container Registry using a personal access token](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic). + - Create a [classic token](https://github.com/settings/tokens). Select the scope for `read:packages` + - Copy the newly created token text. + - Run the following command in a terminal: + ```shell + docker login ghcr.io + ``` + you will be prompted for a username (your particular.net email) and a password (the token) + - ensure that you get a successful login message. + - Use `docker logout ghcr.io` once the following steps are complete and consider removing the token from github if its no longer needed +2. In the terminal, navigate to [`/docs/test-ghcr-tag`](/docs/test/ghcr-tag). +3. Edit the [`.env` file](/docs/test-ghcr-tag/.env) to specify the PR-based tag (in the form `pr-####`) to test. +4. Run `docker compose up -d`. +5. Services will be available at the following URLs: + * [RabbitMQ Management](http://localhost:15672) (Login: `guest`/`guest`) + * [RavenDB](http://localhost:8080) + * [ServiceControl API](http://localhost:33333/api) + * [Audit API](http://localhost:44444/api) + * [Monitoring API](http://localhost:33633) + * [ServicePulse (latest from Docker Hub)](http://localhost:9090) +6. Tear down services using `docker compose down`. + +## Container tests using Aspire + +The [Particular.Aspire.Hosting.ServicePlatform](https://github.com/Particular/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`](/docs/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: + +1. Set up your github container registry credentials as described in the [Container tests](#container-tests) section above. +2. Make sure you have the [Aspire CLI installed](https://aspire.dev/get-started/install-cli/). +3. Run `aspire update` to ensure that the testing AppHost file `docs/test-ghcr-tag-aspire/AppHost.cs` is running the latest aspire SDK and RabbitMQ integration package. +4. Run `aspire run docs/test-ghcr-tag-aspire/AppHost.cs -- tag` to start the application, where `tag` is the PR-based tag (in the form `pr-####`) to test. If no tag is provided, it will default to the `latest` tag. +5. 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) +6. Aspire will automatically tear down the application when you exit the CLI process. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2992d7a..5be7bc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,18 +25,18 @@ jobs: fail-fast: false steps: - name: Checkout - uses: actions/checkout@v7.0.1 + uses: actions/checkout@v10.0.0-fake with: fetch-depth: 0 - name: Setup .NET SDK - uses: actions/setup-dotnet@v6.0.0 + uses: actions/setup-dotnet@v10.0.0-fake with: global-json-file: global.json - name: Build run: dotnet build src --configuration Release - name: Upload packages if: matrix.name == 'Windows' - uses: actions/upload-artifact@v7.0.1 + uses: actions/upload-artifact@v10.0.0-fake with: name: NuGet packages path: nugets/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c2dcb8..01df7e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,11 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v7.0.1 + uses: actions/checkout@v10.0.0-fake with: fetch-depth: 0 - name: Setup .NET SDK - uses: actions/setup-dotnet@v6.0.0 + uses: actions/setup-dotnet@v10.0.0-fake with: global-json-file: global.json - name: Build @@ -31,7 +31,7 @@ jobs: client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }} certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }} - name: Publish artifacts - uses: actions/upload-artifact@v7.0.1 + uses: actions/upload-artifact@v10.0.0-fake with: name: nugets path: nugets/* diff --git a/global.json b/global.json index 7ca72cb..02247fa 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "10.0.100", - "allowPrerelease": false, + "version": "11.0.100", + "allowPrerelease": true, "rollForward": "latestFeature" } } diff --git a/src/Custom.Build.props b/src/Custom.Build.props index c0a6503..7abc21c 100644 --- a/src/Custom.Build.props +++ b/src/Custom.Build.props @@ -3,6 +3,7 @@ 2.0 minor + preview diff --git a/src/NServiceBus.ClaimCheck.AcceptanceTests/NServiceBus.ClaimCheck.AcceptanceTests.csproj b/src/NServiceBus.ClaimCheck.AcceptanceTests/NServiceBus.ClaimCheck.AcceptanceTests.csproj index 97b6228..0958ddb 100644 --- a/src/NServiceBus.ClaimCheck.AcceptanceTests/NServiceBus.ClaimCheck.AcceptanceTests.csproj +++ b/src/NServiceBus.ClaimCheck.AcceptanceTests/NServiceBus.ClaimCheck.AcceptanceTests.csproj @@ -1,7 +1,7 @@  - net10.0 + net10.0;net11.0 enable diff --git a/src/NServiceBus.ClaimCheck.Tests/NServiceBus.ClaimCheck.Tests.csproj b/src/NServiceBus.ClaimCheck.Tests/NServiceBus.ClaimCheck.Tests.csproj index 92904b1..e6fa319 100644 --- a/src/NServiceBus.ClaimCheck.Tests/NServiceBus.ClaimCheck.Tests.csproj +++ b/src/NServiceBus.ClaimCheck.Tests/NServiceBus.ClaimCheck.Tests.csproj @@ -1,7 +1,7 @@  - net10.0 + net10.0;net11.0 enable true ..\NServiceBusTests.snk diff --git a/src/NServiceBus.ClaimCheck/NServiceBus.ClaimCheck.csproj b/src/NServiceBus.ClaimCheck/NServiceBus.ClaimCheck.csproj index 23975e4..aef8341 100644 --- a/src/NServiceBus.ClaimCheck/NServiceBus.ClaimCheck.csproj +++ b/src/NServiceBus.ClaimCheck/NServiceBus.ClaimCheck.csproj @@ -1,15 +1,15 @@  - net10.0 - enable + net11.0 + whatever true ..\NServiceBus.snk - - + +