Skip to content

test(engine): expand profile merge coverage#552

Open
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/improve-unit-testing
Open

test(engine): expand profile merge coverage#552
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/improve-unit-testing

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • Strengthen unit test coverage for the profile merge engine to prevent regressions in hierarchical merge semantics.
  • Codify expected precedence rules so child defaults do not inadvertently erase parent overrides and the most-specific profile wins for complex fields.

Description

  • Added new unit tests in crates/engine/src/profile_merge.rs that verify scalar hierarchy behavior for ffb_gain, degrees_of_rotation, and torque_cap so child default scalars do not erase parent overrides.
  • Added tests to confirm a child FilterConfig fully replaces parent filter configuration (reconstruction, friction, damper, inertia, slew rate, and curve_points).
  • Added tests asserting LED and haptics inheritance: absent child LED/haptics preserve parent configs and most-specific profile LED/haptics configs win when present.
  • Adjusted test initializers to satisfy lints (initialized structs with ..Default::default() to avoid clippy field-reassign warnings).

Testing

  • Ran formatting with python scripts/cargo_fmt_workspace.py and it completed successfully.
  • Ran linting with cargo clippy -p racing-wheel-engine --all-targets -- -D warnings and it completed without warnings.
  • Ran the targeted unit tests with cargo test -p racing-wheel-engine profile_merge and all new and existing profile_merge tests passed (20 passed, 0 failed).

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!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 12 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: c6b2be79-6b9f-46a1-b886-11e0707bf8d1

📥 Commits

Reviewing files that changed from the base of the PR and between 549ea59 and e300829.

📒 Files selected for processing (1)
  • crates/engine/src/profile_merge.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/improve-unit-testing

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.

@factory-droid

factory-droid Bot commented May 17, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Droid review complete.

No inline comments were posted (0 candidates). No candidate comments to validate or post; the PR is limited to additional profile-merge unit tests and looks correct.

@github-actions

Copy link
Copy Markdown

Compatibility Layer Usage Report

Current usage count: 193
Baseline usage count: 193
ℹ️ Usage unchanged

📈 Usage Trend (Last 30 Days)

  • Peak usage: 193
  • Current trend: insufficient_data (0%)
  • Projected removal: unknown

Usage Details

  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/compat_impl.rs:69 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/linux.rs:1253 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/linux.rs:1282 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/mod.rs:230 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:290 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:742 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:749 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/service_example.rs:189 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/service_example.rs:218 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/integration_test.rs:79 - temp_c

... and 183 more occurrences

Migration Guide

To migrate these usages, replace:

  • .temp_c().temperature_c
  • .faults().fault_flags
  • .wheel_angle_mdeg().wheel_angle_deg
  • .wheel_speed_mrad_s().wheel_speed_rad_s

See Migration Patterns for detailed examples.

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