Add test skills#566
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds two “skills” documents under .claude/skills/ describing conventions for writing unit tests (in-process AMQP/TestKit/pure model) and integration tests (real Artemis broker) in this repository.
Changes:
- Introduces a unit test style guide covering infrastructure choices, naming, resource management, synchronization, and assertion conventions.
- Introduces an integration test style guide covering base class usage, naming, isolation, cancellation patterns, DI/hosting fixtures, and multi-step scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .claude/skills/unit-test-style/SKILL.md | Adds unit test style guidance (Core/TestKit/Pure model), but contains a few inaccuracies vs current repo patterns and some markdown table formatting issues. |
| .claude/skills/integration-test-style/SKILL.md | Adds integration test style guidance, but includes examples/rules that conflict with existing integration tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+43
| - Every test is `async Task` — no synchronous tests | ||
| - Use `[Fact]` only — no `[Theory]` | ||
| - Method names read as sentences: `Should_acknowledge_message`, `Should_send_message_with_priority` |
Comment on lines
+16
to
+20
| | Kind | Projects | Infrastructure | | ||
| |---|---|---| | ||
| | **Core unit tests** | `test/ArtemisNetClient.UnitTests/` | `ActiveMQNetSpec` base class + `TestContainerHost` (in-process AMQP server) | | ||
| | **TestKit unit tests** | `test/ArtemisNetClient.Testing.UnitTests/` | `TestKit` (the in-process broker from the test kit library), no base class | | ||
| | **Pure model tests** | either project | No infrastructure — pure C# assertions | |
|
|
||
| ## Core Unit Tests — Base Class | ||
|
|
||
| All core unit test classes inherit from `ActiveMQNetSpec`: |
Comment on lines
+69
to
+79
| TestKit specs do not inherit from `ActiveMQNetSpec`. Set up AMQP tracing in the constructor and use `EndpointUtil` directly: | ||
|
|
||
| ```csharp | ||
| public class MyTestKitSpec | ||
| { | ||
| public MyTestKitSpec(ITestOutputHelper output) | ||
| { | ||
| Trace.TraceLevel = TraceLevel.Information; | ||
| var logger = new XUnitLogger(output, "logger"); | ||
| Trace.TraceListener += (_, format, args) => logger.LogTrace(format, args); | ||
| } |
Comment on lines
+175
to
+179
| `TestContainerHost` implements `IDisposable` — always declare it with `using var`: | ||
|
|
||
| ```csharp | ||
| using var host = CreateOpenedContainerHost(endpoint); | ||
| ``` |
| - Files use the `*Spec.cs` suffix (BDD-style), e.g. `MessageAcknowledgementSpec.cs` | ||
| - Core tests live in `test/ArtemisNetClient.IntegrationTests/` | ||
| - Extension tests live in their own `*.IntegrationTests/` project | ||
| - Subtopics go in subdirectories (e.g. `TopologyManagement/FilterExpressionsSpec.cs`) |
Owner
Author
|
@copilot apply changes based on the comments in this thread |
Contributor
Applied all the review feedback in commit 01c1be9:
|
Agent-Logs-Url: https://github.com/Havret/dotnet-activemq-artemis-client/sessions/4c2aebe1-a91a-44bf-a46e-534b1e37d0da Co-authored-by: Havret <9103861+Havret@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.