Skip to content

fix(test): keep projection setup out of unrelated runs#81

Merged
yordis merged 2 commits intomainfrom
yordis/fix-test-helper-boot
Apr 15, 2026
Merged

fix(test): keep projection setup out of unrelated runs#81
yordis merged 2 commits intomainfrom
yordis/fix-test-helper-boot

Conversation

@yordis
Copy link
Copy Markdown
Member

@yordis yordis commented Apr 15, 2026

  • keep non-projection test runs focused on the code they exercise instead of paying an unconditional database setup cost
  • move projection database boot into the application path that actually needs it so setup work happens only when those tests opt in

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 15, 2026

PR Summary

Low Risk
Low risk: test-only changes that move Postgres repo/migration setup behind an explicit TestApplication init path, reducing unnecessary DB work; main risk is missing initialization if a test relies on projections without booting the app.

Overview
Moves projection database bootstrapping out of test_helper.exs and into an explicit, opt-in path.

Adds Commanded.TestSupport.ProjectionsSetup (a GenServer) to lazily start the projections Repo, run a one-off migration to create the projections table, and set SQL sandbox mode, and wires it into TestApplication.init/1 while test_helper.exs now only starts the setup server.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Warning

Rate limit exceeded

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

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 35 seconds.

⌛ 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: 0e679cb8-18ce-4e42-9aab-23c6fdc09f82

📥 Commits

Reviewing files that changed from the base of the PR and between 91a612f and 0782b79.

📒 Files selected for processing (11)
  • mix.exs
  • test/projections/after_update_callback_test.exs
  • test/projections/commanded_batch_integration_test.exs
  • test/projections/ecto_projection_batch_test.exs
  • test/projections/ecto_projection_test.exs
  • test/projections/init_callback_test.exs
  • test/projections/projection_version_schema_prefix_test.exs
  • test/projections/support/ecto_case.ex
  • test/projections/support/setup.ex
  • test/support/mock_projection_case.ex
  • test/test_helper.exs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/fix-test-helper-boot

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/fix-test-helper-boot branch from f2ea923 to d8c924d Compare April 15, 2026 04:57
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis merged commit ea80428 into main Apr 15, 2026
4 checks passed
@yordis yordis deleted the yordis/fix-test-helper-boot branch April 15, 2026 05:30
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