Skip to content

Conversation

@tmacro
Copy link
Contributor

@tmacro tmacro commented Oct 29, 2025

Adds unit tests for the config loading code already in the feature branch.
Small deviation from the design to note: burstCapacity is optionally configurable at the cluster level rather than being a constant.
I thought this change was easy enough and would help us out when trying to determine the default value during testing.

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.65%. Comparing base (f44a1ec) to head (289cf0a).
⚠️ Report is 2 commits behind head on improvement/CLDSRV-766/bucket_rate_limiting.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/Config.js 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/rateLimit/config.js 100.00% <100.00%> (+76.92%) ⬆️
lib/Config.js 78.01% <0.00%> (ø)
@@                               Coverage Diff                               @@
##           improvement/CLDSRV-766/bucket_rate_limiting    #5991      +/-   ##
===============================================================================
+ Coverage                                        82.57%   82.65%   +0.08%     
===============================================================================
  Files                                              194      194              
  Lines                                            12324    12325       +1     
===============================================================================
+ Hits                                             10176    10187      +11     
+ Misses                                            2148     2138      -10     
Flag Coverage Δ
ceph-backend-test 65.31% <0.00%> (-0.01%) ⬇️
file-ft-tests 66.17% <0.00%> (-0.01%) ⬇️
kmip-ft-tests 26.75% <0.00%> (-0.01%) ⬇️
mongo-v0-ft-tests 67.48% <0.00%> (+0.01%) ⬆️
mongo-v1-ft-tests 67.48% <0.00%> (-0.01%) ⬇️
multiple-backend 35.36% <0.00%> (-0.32%) ⬇️
quota-tests 31.94% <0.00%> (-0.01%) ⬇️
quota-tests-inflights 33.88% <0.00%> (-0.01%) ⬇️
unit 67.00% <50.00%> (+0.08%) ⬆️
utapi-v2-tests 33.06% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +42 to +46
desc: '[rps] should throw an error if requestsPerSecond isn\'t an object',
input: {
requestsPerSecond: 'foo'
},
throws: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more explicit on the error thrown ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure how without tying it pretty closely to the implementation.

@tmacro tmacro merged commit e0e0179 into improvement/CLDSRV-766/bucket_rate_limiting Nov 3, 2025
26 of 27 checks passed
@tmacro tmacro deleted the improvement/CLDSRV-770/rate_limit_config_loading branch November 3, 2025 22:41
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.

4 participants