-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved CI ⏩ #11
Improved CI ⏩ #11
Conversation
By using the library [divan](https://crates.io/crates/divan) Added the bench command to the required tests
Warning Rate Limit Exceeded@Bullrich has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 54 minutes and 28 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughThe recent changes introduce a new benchmarking capability using the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (3)
- .github/workflows/test.yml (1 hunks)
- Cargo.toml (1 hunks)
- benches/action_speed.rs (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/test.yml
Additional comments not posted (4)
Cargo.toml (2)
22-24
: The benchmark configuration withharness = false
is appropriate for custom benchmark setups.
20-20
: Ensuredivan
version "0.1.14" is the latest or a stable version to avoid potential issues.Verification successful
The version "0.1.14" specified for the
divan
dependency is the latest available on crates.io.
- Cargo.toml: Line 20
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the latest version of `divan` on crates.io curl https://crates.io/api/v1/crates/divan | jq '.crate.max_version'Length of output: 394
benches/action_speed.rs (2)
19-23
: Add a comment explaining the intent behind expecting an error for these inputs.
33-40
: Ensure that the log levels are appropriately set and tested in this benchmark.Verification successful
The implementations of the logging functions in
src/logger.rs
confirm that the log levels are appropriately set:
debug_log
formats the message with a::debug::
prefix.info
writes the message to stdout.warn_log
,error_log
, andnotice_log
use theissue_command
function with the respective log levels.This ensures that the log levels are correctly set and tested in the
log_benchmark
function.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify log levels are set correctly in the benchmark. grep -r "log_level" src/Length of output: 24
Script:
#!/bin/bash # Find the implementation of the `debug_log` function ast-grep --lang rust --pattern 'fn debug_log($_) { $$$ }' # Find the implementation of the `info` function ast-grep --lang rust --pattern 'fn info($_) { $$$ }' # Find the implementation of the `warn_log` function ast-grep --lang rust --pattern 'fn warn_log($_) { $$$ }' # Find the implementation of the `error_log` function ast-grep --lang rust --pattern 'fn error_log($_) { $$$ }' # Find the implementation of the `notice_log` function ast-grep --lang rust --pattern 'fn notice_log($_) { $$$ }'Length of output: 294
Script:
#!/bin/bash # Find the implementation of the `debug_log` function rg 'fn debug_log' # Find the implementation of the `info` function rg 'fn info' # Find the implementation of the `warn_log` function rg 'fn warn_log' # Find the implementation of the `error_log` function rg 'fn error_log' # Find the implementation of the `notice_log` function rg 'fn notice_log'Length of output: 309
Script:
#!/bin/bash # Extract the implementation of the `debug_log` function sed -n '/pub fn debug_log/,/}/p' src/logger.rs # Extract the implementation of the `info` function sed -n '/pub fn info/,/}/p' src/logger.rs # Extract the implementation of the `warn_log` function sed -n '/pub fn warn_log/,/}/p' src/logger.rs # Extract the implementation of the `error_log` function sed -n '/pub fn error_log/,/}/p' src/logger.rs # Extract the implementation of the `notice_log` function sed -n '/pub fn notice_log/,/}/p' src/logger.rsLength of output: 661
fn set_output_benchmark(value: &str) { | ||
match set_output("name", value) { | ||
Ok(_) => {} | ||
Err(err) => panic!("{:#?}", err), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider handling errors more gracefully in benchmarks instead of using panic!
.
match set_output("name", value) {
Ok(_) => {},
Err(err) => eprintln!("Error: {:#?}", err),
}
fn get_debug_benchmark() { | ||
if !is_debug() { | ||
panic!("It should be debug") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a less disruptive approach than panic!
for handling the debug mode check in benchmarks.
if !is_debug() {
eprintln!("Debug mode should be active.");
}
Summary by CodeRabbit
New Features
Chores
divan
dependency for benchmarking.