Skip to content

chore(tests): improve ut coverage for rate_limit configuration#1113

Merged
Molter73 merged 1 commit into
mainfrom
mauro/tests/rate-limit
Jul 15, 2026
Merged

chore(tests): improve ut coverage for rate_limit configuration#1113
Molter73 merged 1 commit into
mainfrom
mauro/tests/rate-limit

Conversation

@Molter73

@Molter73 Molter73 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Add a few missing tests for the rate_limit configuration value.

Checklist

  • Patch has a change log entry OR does not need one.
  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

CI should be enough.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for the rate_limit configuration setting.
    • Added validation for invalid values, including booleans, non-integer numbers, and negative integers.
    • Verified configuration updates, default values, and YAML parsing behavior.
    • Confirmed the default scan interval is 30 seconds and the default rate limit is 0.

Add a few missing tests for the `rate_limit` configuration value.
@Molter73 Molter73 requested a review from a team as a code owner July 15, 2026 08:44
@Molter73 Molter73 enabled auto-merge (squash) July 15, 2026 08:44
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The configuration test suite now covers rate_limit parsing, invalid values, update scenarios, expected configurations, and default values. It also asserts the default scan interval.

Changes

Rate limit configuration

Layer / File(s) Summary
Rate limit parsing and validation
fact/src/config/tests.rs
Parsing expectations include rate_limit: Some(50000), and invalid boolean, real, and negative integer values are checked against specific errors.
Rate limit updates and defaults
fact/src/config/tests.rs
Tests cover setting and overwriting rate_limit, update expectations use concrete values, and defaults assert a 30-second scan interval and zero rate limit.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly describes the change: adding test coverage for the rate_limit configuration.
Description check ✅ Passed The description follows the template with a summary, checklist, automated testing notes, and a testing section.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mauro/tests/rate-limit

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.22%. Comparing base (eb45b77) to head (f5cf4d7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1113      +/-   ##
==========================================
+ Coverage   32.95%   33.22%   +0.26%     
==========================================
  Files          21       21              
  Lines        2971     2971              
  Branches     2971     2971              
==========================================
+ Hits          979      987       +8     
+ Misses       1989     1981       -8     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Molter73 Molter73 merged commit ea25951 into main Jul 15, 2026
40 of 43 checks passed
@Molter73 Molter73 deleted the mauro/tests/rate-limit branch July 15, 2026 09:18
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.

3 participants