Repository navigation
Skip Fusion Redis tests from the test body when Redis is unreachable - #10343
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is isolated to test infrastructure and consistently updates all affected tests to skip safely under xUnit v3 when Redis is unreachable.
Pull request overview
This PR adjusts the Redis integration test fixture for Fusion.Subscriptions.Redis.Tests so tests are skipped from within each test body (instead of during fixture initialization), avoiding xUnit v3 treating fixture-init skips as failures when REDIS_CONNECTION_STRING points to an unreachable Redis instance.
Changes:
- Record Redis unavailability in
RedisFixtureduringInitializeAsyncinstead of callingAssert.Skipthere. - Add
RedisFixture.SkipWhenUnavailable()so each test can skip itself early from the test body. - Update Redis subscription/broker tests to call
SkipWhenUnavailable()as the first arrange step.
File summaries
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Subscriptions.Redis.Tests/RedisSubscriptionTests.cs | Skips the test from the test body when Redis is unreachable. |
| src/HotChocolate/Fusion/test/Fusion.Subscriptions.Redis.Tests/RedisFixture.cs | Moves skip decision to a stored reason and exposes SkipWhenUnavailable() for tests to invoke. |
| src/HotChocolate/Fusion/test/Fusion.Subscriptions.Redis.Tests/RedisEventStreamBrokerTests.cs | Applies the new per-test skip call consistently across broker tests. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 25, 2026
Merged
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.
Summary
RedisFixtureno longer callsAssert.SkipfromInitializeAsync. xUnit v3 treats a skip thrown during fixture initialization as a failure, so withREDIS_CONNECTION_STRINGpointing at an unreachable instance every test inFusion.Subscriptions.Redis.Testsfailed instead of skipping.SkipReasonand exposesSkipWhenUnavailable(), which each test calls as its first arrange step so the skip happens from the test body.Test plan
REDIS_CONNECTION_STRING=localhost:1: 7 skipped, 0 failed. The run exits with Microsoft.Testing.Platform code 8 because no test executed, which is the platform's zero-tests behavior and unchanged by this PR.