Skip to content

refactor(ui): keep the tests out of the files they test - #647

Open
PiquelChips wants to merge 3 commits into
mainfrom
refactor/ui-tests-module
Open

PiquelChips wants to merge 3 commits into
mainfrom
refactor/ui-tests-module

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

A mod tests { … } that takes up a third or more of its file buries the code it tests. In piqueld-ui, 9 such blocks move to a sibling tests.rs (declared by mod tests;), and a foo.rs that gains one becomes foo/mod.rs so self_named_module_files stays satisfied. (application.rs (373 of 797 lines), auth.rs (190 of 410 lines), changes.rs (60 of 188 lines), deployments.rs (251 of 472 lines), environments.rs (237 of 548 lines), log_output.rs (60 of 149 lines), overview/dashboard.rs (133 of 310 lines), overview/notifications.rs (125 of 287 lines), secrets.rs (46 of 143 lines); each foo.rs that gains one becomes foo/mod.rs.)

Only moves: the bodies are unchanged but for rustfmt's indentation. No lint to enable: the rule is in docs/dev/rust-conventions.md, which this PR updates now that every crate has moved its tests. No #[expect]s added.

Part of PQD-169

Note

written by Claude Sonnet 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c20e957-9ec3-4d80-8b41-87259e2f1a3b
Commits

Reviewing files that changed from the base of the PR and between 8dde799 and 7cc50fd.

Files selected for processing: 20

  • apps/piqueld-ui/src/application/mod.rs
  • apps/piqueld-ui/src/application/tests.rs
  • apps/piqueld-ui/src/auth/mod.rs
  • apps/piqueld-ui/src/auth/tests.rs
  • apps/piqueld-ui/src/changes/mod.rs
  • apps/piqueld-ui/src/changes/tests.rs
  • apps/piqueld-ui/src/deployments.rs
  • apps/piqueld-ui/src/deployments/mod.rs
  • apps/piqueld-ui/src/deployments/tests.rs
  • apps/piqueld-ui/src/environments/mod.rs
  • apps/piqueld-ui/src/environments/tests.rs
  • apps/piqueld-ui/src/log_output/mod.rs
  • apps/piqueld-ui/src/log_output/tests.rs
  • apps/piqueld-ui/src/overview/dashboard/mod.rs
  • apps/piqueld-ui/src/overview/dashboard/tests.rs
  • apps/piqueld-ui/src/overview/notifications/mod.rs
  • apps/piqueld-ui/src/overview/notifications/tests.rs
  • apps/piqueld-ui/src/secrets/mod.rs
  • apps/piqueld-ui/src/secrets/tests.rs
  • docs/dev/rust-conventions.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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