Skip to content

chore(tests): prefer single item assertions#343

Merged
yordis merged 1 commit into
masterfrom
yordis/chore-xunit-single-assertions
May 13, 2026
Merged

chore(tests): prefer single item assertions#343
yordis merged 1 commit into
masterfrom
yordis/chore-xunit-single-assertions

Conversation

@yordis
Copy link
Copy Markdown
Member

@yordis yordis commented May 13, 2026

  • Keep single-item assertions aligned with current xUnit analyzer guidance.
  • Reduce test-diagnostic noise around metrics and scavenge coverage.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 13, 2026

PR Summary

Low Risk
Low risk: test-only changes that refactor assertions without altering production behavior. Main risk is minor—tests may become stricter about expecting exactly one measurement/tag in a few cases.

Overview
Updates multiple metrics/scavenge-related tests to prefer single-item assertions by replacing Assert.Collection (with one expected element) with Assert.Single and then asserting on the returned measurement/tag/scavenge point.

This reduces analyzer noise and slightly tightens expectations around collections that should contain exactly one item (e.g., metric tags/measurements and newly-created scavenge points).

Reviewed by Cursor Bugbot for commit 034fd74. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@yordis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 5 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a062dd91-3b81-46d7-b15c-61c6f5b97214

📥 Commits

Reviewing files that changed from the base of the PR and between 92e4a69 and 034fd74.

📒 Files selected for processing (5)
  • src/EventStore.Core.XUnit.Tests/Metrics/IncomingGrpcCallsMetricTests.cs
  • src/EventStore.Core.XUnit.Tests/Metrics/PersistentSubscriptionMetricsTests.cs
  • src/EventStore.Core.XUnit.Tests/Metrics/QueueBusyTrackerTests.cs
  • src/EventStore.Core.XUnit.Tests/Scavenge/SubsequentScavengeTests.cs
  • src/EventStore.Core.XUnit.Tests/TransactionLog/Checkpoint/CheckpointMetricTests.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/chore-xunit-single-assertions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the yordis/chore-xunit-single-assertions branch from 7082613 to 034fd74 Compare May 13, 2026 16:03
@yordis yordis merged commit b736f39 into master May 13, 2026
22 of 23 checks passed
@yordis yordis deleted the yordis/chore-xunit-single-assertions branch May 13, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant