Skip to content

fix(test): restore full suite projection bootstrap - #99

Merged
yordis merged 2 commits into
mainfrom
yordis/fix-projection-test-bootstrap
Apr 29, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/fix-projection-test-bootstrap

Conversation

@yordis

@yordis yordis commented Apr 29, 2026

Copy link
Copy Markdown
Member
  • keep projection and Ecto test coverage trustworthy by creating the tables those suites actually depend on
  • prevent suite-only regressions caused by projection setup differing between isolated runs and full
  • make the dispatcher retry OTel test resilient to unrelated span exports so full-suite results reflect real regressions instead of export ordering

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Apr 29, 2026

Copy link
Copy Markdown

PR Summary

Cursor Bugbot is generating a summary for commit 05efd7c. Configure here.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

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

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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: 1dd763c3-0d66-461e-bc1c-43739829925b

📥 Commits

Reviewing files that changed from the base of the PR and between 05efd7c and fc09cfa.

📒 Files selected for processing (1)
  • test/opentelemetry/dispatcher_retry_test.exs

Walkthrough

Two test infrastructure improvements: refactoring telemetry span collection in dispatcher retry tests to use continuous message receiving instead of fixed-count collection, and adding SQL-based provisioning for a new projection_versions table with projection name and event tracking fields.

Changes

Cohort / File(s) Summary
Telemetry Test Refactoring
test/opentelemetry/dispatcher_retry_test.exs
Replaces fixed telemetry span collection with continuous message receiving via collect_retry_spans/1. Tracks observed "dispatch " and "execute " spans individually and compares their trace/parent relationships in assertions.
Projection Version Tracking
test/projections/support/setup.ex
Adds ensure_projection_versions_table!/0 helper to provision a new projection_versions table containing projection_name (primary key), last_seen_event_number, inserted_at, and updated_at columns. Integrates into existing setup flow for both default and "test" schemas.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A table for versions now takes its place,
Spans flow through messages at a measured pace,
With names and events tracked with care,
Our telemetry blooms beyond compare!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(test): restore full suite projection bootstrap' directly and clearly summarizes the main change: restoring projection bootstrap for the full test suite, which aligns with the changeset's focus on ensuring projection tables are created and tests are resilient.
Description check ✅ Passed The description explains the purpose of the changes: creating projection tables for test coverage, aligning setup between isolated and full-suite runs, and making the OTel test resilient to span exports, which directly relates to the changeset modifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/fix-projection-test-bootstrap

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
Review rate limit: 0/1 reviews remaining, refill in 31 minutes and 45 seconds.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 05efd7c. Configure here.

Comment thread test/opentelemetry/dispatcher_retry_test.exs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/opentelemetry/dispatcher_retry_test.exs`:
- Around line 95-126: The helper collect_retry_spans/1 currently returns the
first dispatch and execute spans seen even if they belong to different traces or
commands; update the matching logic in collect_retry_spans(dispatch_span,
execute_span, seen, deadline) (and its helper clause that builds dispatch_span
and execute_span) to only consider a dispatch/execute pair when they share a
stable identifier (e.g., the span's trace id or a "command" attribute extracted
from span(span, :attributes)), by extracting that identifier from each received
span and tracking it alongside seen entries, then only return {dispatch_span,
execute_span} when both spans have the same identifier; continue accumulating
unrelated spans in seen until a matching pair is found or deadline expires.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b95eabeb-d495-4551-b26f-ca4a68ab1b48

📥 Commits

Reviewing files that changed from the base of the PR and between 353e939 and 05efd7c.

📒 Files selected for processing (2)
  • test/opentelemetry/dispatcher_retry_test.exs
  • test/projections/support/setup.ex

Comment thread test/opentelemetry/dispatcher_retry_test.exs Outdated
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 945b1cf into main Apr 29, 2026
3 checks passed
@yordis
yordis deleted the yordis/fix-projection-test-bootstrap branch April 29, 2026 04:31
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