-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_proc_macros: timed test macros #10065
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
base: main-v0.14.1
Are you sure you want to change the base?
apollo_proc_macros: timed test macros #10065
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
396bc8b to
907bb53
Compare
069e68d to
c0e0c10
Compare
Itay-Tsabary-Starkware
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion
crates/apollo_proc_macros_tests/tests/timed_test.rs line 61 at r1 (raw file):
tokio::time::sleep(Duration::from_millis(20)).await; assert!(value > 0); }
Could you please add tests that are expected to fail (look for the #[should_panic] annotation) such that:
- some fail on the actual test content
- some fail on timeout
Code quote:
#[timed_rstest_tokio(150)]
#[case(1)]
#[case(2)]
async fn test_rstest_async_custom_limit(#[case] value: u32) {
tokio::time::sleep(Duration::from_millis(20)).await;
assert!(value > 0);
}
Itay-Tsabary-Starkware
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @victorkstarkware)
crates/apollo_proc_macros/src/lib.rs line 610 at r1 (raw file):
Ok(_) => { let elapsed = start.elapsed(); let elapsed_ms = elapsed.as_millis() as u64;
Why is this conversion needed?
Code quote:
let elapsed_ms = elapsed.as_millis() as u64;
Itay-Tsabary-Starkware
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @victorkstarkware)
crates/apollo_proc_macros/src/lib.rs line 622 at r1 (raw file):
Err(_) => { let elapsed = start.elapsed(); let elapsed_ms = elapsed.as_millis() as u64;
These two lines appear in both branches, please unify them (by calling them before the match statement)
Code quote:
let elapsed = start.elapsed();
let elapsed_ms = elapsed.as_millis() as u64;c0e0c10 to
1abf29e
Compare
victorkstarkware
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/apollo_proc_macros/src/lib.rs line 610 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Why is this conversion needed?
time limit constant is given in ms
crates/apollo_proc_macros/src/lib.rs line 622 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
These two lines appear in both branches, please unify them (by calling them before the
matchstatement)
Done.
crates/apollo_proc_macros_tests/tests/timed_test.rs line 61 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Could you please add tests that are expected to fail (look for the
#[should_panic]annotation) such that:
- some fail on the actual test content
- some fail on timeout
Done.
358f47a to
bd78fe0
Compare
bd78fe0 to
5b7e27e
Compare
5b7e27e to
1f1d01a
Compare

No description provided.