Skip to content

Commit a9bf5c4

Browse files
committed
Apply repository updates to master
1 parent af76e0a commit a9bf5c4

9 files changed

Lines changed: 120 additions & 17 deletions

File tree

.github/SUPPORT.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/copy-sc-testing.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Testing
2+
3+
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.
4+
5+
## Unit tests
6+
7+
ServiceControl components have specific unit test projects verifying their behaviors and API.
8+
9+
## Packaging tests
10+
11+
Packaging tests check:
12+
13+
- Folder structure and content of the [packaging process](packaging.md) output.
14+
- That packaged [assembly versions match](packaging.md#assembly-mismatches).
15+
16+
## Installation engine tests
17+
18+
Installation engine tests run partial installations and checks:
19+
20+
- That the generated configuration is correct.
21+
- That transport and persistence are correctly extracted.
22+
23+
## Persistence tests
24+
25+
Persistence tests check assumptions at the persistence seam level by exercising each persister.
26+
For local setup details, see [Local Testing of Persistence Providers](testing-persistence.md).
27+
28+
## Transport tests
29+
30+
Transport tests are done by executing the transport test suite for each transport.
31+
32+
## Acceptance tests
33+
34+
Run ServiceControl full version and use the HTTP API to validate results. LearningTransport is used for all tests.
35+
36+
### Windows prerequisite: register the event sources
37+
38+
On Windows, every acceptance test fails on first run with:
39+
40+
```
41+
System.Security.SecurityException : The source ServiceControl was not found on computer .,
42+
but some or all event logs could not be searched. Inaccessible logs: Security.
43+
```
44+
45+
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.
46+
47+
Register both sources once, from an **elevated** PowerShell prompt:
48+
49+
```powershell
50+
[System.Diagnostics.EventLog]::CreateEventSource('ServiceControl', 'Application')
51+
[System.Diagnostics.EventLog]::CreateEventSource('ServiceControl.Audit', 'Application')
52+
```
53+
54+
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`.
55+
56+
## Multi-instance tests
57+
58+
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.
59+
60+
## Container tests
61+
62+
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/).
63+
64+
Containers built by a PR and stored on GitHub Container Registry can be tested locally:
65+
66+
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).
67+
- Create a [classic token](https://github.com/settings/tokens). Select the scope for `read:packages`
68+
- Copy the newly created token text.
69+
- Run the following command in a terminal:
70+
```shell
71+
docker login ghcr.io
72+
```
73+
you will be prompted for a username (your particular.net email) and a password (the token)
74+
- ensure that you get a successful login message.
75+
- Use `docker logout ghcr.io` once the following steps are complete and consider removing the token from github if its no longer needed
76+
2. In the terminal, navigate to [`/docs/test-ghcr-tag`](/docs/test/ghcr-tag).
77+
3. Edit the [`.env` file](/docs/test-ghcr-tag/.env) to specify the PR-based tag (in the form `pr-####`) to test.
78+
4. Run `docker compose up -d`.
79+
5. Services will be available at the following URLs:
80+
* [RabbitMQ Management](http://localhost:15672) (Login: `guest`/`guest`)
81+
* [RavenDB](http://localhost:8080)
82+
* [ServiceControl API](http://localhost:33333/api)
83+
* [Audit API](http://localhost:44444/api)
84+
* [Monitoring API](http://localhost:33633)
85+
* [ServicePulse (latest from Docker Hub)](http://localhost:9090)
86+
6. Tear down services using `docker compose down`.
87+
88+
## Container tests using Aspire
89+
90+
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.
91+
92+
Containers built by a PR and stored on GitHub Container Registry can be tested locally:
93+
94+
1. Set up your github container registry credentials as described in the [Container tests](#container-tests) section above.
95+
2. Make sure you have the [Aspire CLI installed](https://aspire.dev/get-started/install-cli/).
96+
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.
97+
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.
98+
5. Once running you can open the dashboard from the link in the terminal, this dashboard will provide the assigned ports for each service.
99+
* RabbitMQ Management (Login: `guest`/`guest`)
100+
* RavenDB
101+
* ServiceControl API
102+
* Audit API
103+
* Monitoring API
104+
* ServicePulse (latest from Docker Hub)
105+
6. Aspire will automatically tear down the application when you exit the CLI process.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525
fail-fast: false
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v7.0.1
28+
uses: actions/checkout@v10.0.0-fake
2929
with:
3030
fetch-depth: 0
3131
- name: Setup .NET SDK
32-
uses: actions/setup-dotnet@v6.0.0
32+
uses: actions/setup-dotnet@v10.0.0-fake
3333
with:
3434
global-json-file: global.json
3535
- name: Build
3636
run: dotnet build src --configuration Release
3737
- name: Upload packages
3838
if: matrix.name == 'Windows'
39-
uses: actions/upload-artifact@v7.0.1
39+
uses: actions/upload-artifact@v10.0.0-fake
4040
with:
4141
name: NuGet packages
4242
path: nugets/

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v7.0.1
17+
uses: actions/checkout@v10.0.0-fake
1818
with:
1919
fetch-depth: 0
2020
- name: Setup .NET SDK
21-
uses: actions/setup-dotnet@v6.0.0
21+
uses: actions/setup-dotnet@v10.0.0-fake
2222
with:
2323
global-json-file: global.json
2424
- name: Build
@@ -31,7 +31,7 @@ jobs:
3131
client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
3232
certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}
3333
- name: Publish artifacts
34-
uses: actions/upload-artifact@v7.0.1
34+
uses: actions/upload-artifact@v10.0.0-fake
3535
with:
3636
name: nugets
3737
path: nugets/*

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "10.0.100",
4-
"allowPrerelease": false,
3+
"version": "11.0.100",
4+
"allowPrerelease": true,
55
"rollForward": "latestFeature"
66
}
77
}

src/Custom.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<MinVerMinimumMajorMinor>2.0</MinVerMinimumMajorMinor>
55
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
6+
<LangVersion>preview</LangVersion>
67
</PropertyGroup>
78

89
</Project>

src/NServiceBus.ClaimCheck.AcceptanceTests/NServiceBus.ClaimCheck.AcceptanceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
4+
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

src/NServiceBus.ClaimCheck.Tests/NServiceBus.ClaimCheck.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
4+
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<SignAssembly>true</SignAssembly>
77
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>

src/NServiceBus.ClaimCheck/NServiceBus.ClaimCheck.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
4+
<TargetFramework>net11.0</TargetFramework>
5+
<ImplicitUsings>whatever</ImplicitUsings>
66
<SignAssembly>true</SignAssembly>
77
<AssemblyOriginatorKeyFile>..\NServiceBus.snk</AssemblyOriginatorKeyFile>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="NServiceBus" Version="10.2.7" />
12-
<PackageReference Include="Particular.Packaging" Version="4.5.0" PrivateAssets="All" />
11+
<PackageReference Include="NServiceBus" Version="11.0.0" />
12+
<PackageReference Include="Particular.Packaging" Version="5.0.0" PrivateAssets="All" />
1313

1414
</ItemGroup>
1515

0 commit comments

Comments
 (0)