Skip to content

test: dry up integration helpers#296

Open
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry-f1ih04
Open

test: dry up integration helpers#296
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry-f1ih04

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Motivation

  • Remove duplicated test helper code spread across many integration tests to make pipeline and bus helpers DRY and easy to reuse.
  • Provide a single source of truth for the common deadzone→curve→clamp pipeline and one-shot bus publish/receive behavior to reduce copy/paste and future maintenance overhead.

Description

  • Added standard_axis_pipeline() and publish_and_receive() to crates/flight-test-helpers/src/integration.rs and exported them via crates/flight-test-helpers/src/lib.rs, and made flight-axis a regular dependency of flight-test-helpers in crates/flight-test-helpers/Cargo.toml so tests can reuse the pipeline.
  • Replaced duplicated local helper implementations in many integration tests with imports from flight-test-helpers (e.g. publish_and_receive and standard_axis_pipeline used across crates/flight-integration-tests/tests/*.rs and helper test files).
  • Fixed a stale Saitek X52 throttle center assertion to match the parser’s [0.0, 1.0] mapping by asserting centered throttle ≈ 0.5.
  • Applied small Clippy-driven cleanup to address style/DRY findings, including replacing an explicit node counter with for (node_id, node) in (1u32..).zip(...) in flight-axis/src/compiler.rs and switching to sort_by_key(|b| Reverse(b.timestamp)) in flight-writers backup listing/rollback code.

Testing

  • Ran formatting and lints with rustfmt --edition 2024 --check and cargo clippy -p flight-test-helpers -- -D warnings, which completed successfully.
  • Ran unit tests for the helper crate with cargo test -p flight-test-helpers, which passed (all flight-test-helpers tests green).
  • Ran a broad subset of integration tests with cargo test -p flight-integration-tests (multiple individual --test targets and --test saitek_pipeline), and the effected integration tests that were updated passed; saitek_pipeline specifically passes after the assertion fix.
  • A full cargo test -p flight-integration-tests still fails due to a pre-existing non-UTF-8 fixture at compat/devices/speedlink/airrow-flightstick.yaml, which is unrelated to these helper changes and is noted as a known issue.

Codex Task

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 51 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: ASSERTIVE

Plan: Pro

Run ID: a1e7477f-28af-44a4-998d-6258a1f1be92

📥 Commits

Reviewing files that changed from the base of the PR and between 7d026c3 and 55d62b1.

📒 Files selected for processing (28)
  • crates/flight-axis/src/compiler.rs
  • crates/flight-integration-tests/tests/brunner_pipeline.rs
  • crates/flight-integration-tests/tests/bus_pipeline.rs
  • crates/flight-integration-tests/tests/ch_pipeline.rs
  • crates/flight-integration-tests/tests/e2e_axis_engine.rs
  • crates/flight-integration-tests/tests/e2e_device_bus.rs
  • crates/flight-integration-tests/tests/e2e_trace_replay.rs
  • crates/flight-integration-tests/tests/error_recovery_e2e.rs
  • crates/flight-integration-tests/tests/honeycomb_alpha_pipeline.rs
  • crates/flight-integration-tests/tests/logitech_pipeline.rs
  • crates/flight-integration-tests/tests/pipeline_e2e.rs
  • crates/flight-integration-tests/tests/saitek_pipeline.rs
  • crates/flight-integration-tests/tests/thrustmaster_pipeline.rs
  • crates/flight-integration-tests/tests/thrustmaster_tpr_pipeline.rs
  • crates/flight-integration-tests/tests/virpil_pipeline.rs
  • crates/flight-integration-tests/tests/virpil_warbrd_pipeline.rs
  • crates/flight-integration-tests/tests/vkb_modern_pipeline.rs
  • crates/flight-integration-tests/tests/vkb_pipeline.rs
  • crates/flight-integration-tests/tests/vpforce_pipeline.rs
  • crates/flight-integration-tests/tests/vpforce_rhino_pipeline.rs
  • crates/flight-integration-tests/tests/winwing_orion2_throttle_pipeline.rs
  • crates/flight-integration-tests/tests/winwing_pipeline.rs
  • crates/flight-test-helpers/Cargo.toml
  • crates/flight-test-helpers/src/integration.rs
  • crates/flight-test-helpers/src/lib.rs
  • crates/flight-test-helpers/tests/pipeline_integration.rs
  • crates/flight-writers/src/curve_conflict.rs
  • crates/flight-writers/src/rollback.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/refactor-code-to-be-more-dry-f1ih04

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant