-
Notifications
You must be signed in to change notification settings - Fork 196
Add forest api test-stateful subcommand
#5836
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
Changes from 16 commits
e383a9e
6c24d61
92e36d9
1166dbe
8025482
a103025
d2aa97f
7069381
da92434
fefbbc2
155c539
4a316c0
032778d
9c0afbf
e893aeb
722ca1b
1c90178
797ee37
cc1b2ba
4f0c2a4
b65cc97
f5d86d9
db3655e
c3913bb
884de14
e8b6bb6
cdea50f
ab02767
4fb1c99
cc6defe
95c36d9
ee14d70
e172cde
d8b5576
e1c2729
8fed6e0
6171f1e
1e93afe
8713195
20b22a9
c2fbe02
6c17c65
4095010
54659d7
78dc2c7
70ad519
b610bf3
585c279
c6d419e
e8b936b
41afdca
1a40061
61c6dc1
d969a28
ab46e8e
8907015
34283bc
a65918e
06b9c46
9842f14
a127f9d
33f37bd
515cf18
1e819fa
f64456b
9258ee6
66f6a11
2a340ef
ca998b1
258621e
9ebf228
1407333
c07de53
0971f06
c53a2b5
4517417
e840947
706ef61
20a9c8d
e67db40
248fa27
6e41430
cd831aa
b89f0e7
e8ac160
4146221
7b2cdeb
d9b1239
86f4c3f
7492451
c353ad3
07d772f
d068413
9fd72b4
4752dee
907bd29
589a0b9
1446872
5bd721f
d1a2afa
58e86a6
b07fac6
3a8de44
b7dfcfc
8e0702e
98b7dde
21aa151
737edb0
9614295
a47c4eb
7de68a9
cac27de
7f164b6
11dfa3f
b63f1bd
87e33de
5bca9bb
bad13d6
9c72ec8
5beb9d6
79667c9
70fe4fd
30433fb
1e3e088
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| // SPDX-License-Identifier: Apache-2.0, MIT | ||
|
|
||
| mod api_compare_tests; | ||
| mod api_run_tests; | ||
| mod generate_test_snapshot; | ||
| mod report; | ||
| mod test_snapshot; | ||
|
|
@@ -177,6 +178,17 @@ pub enum ApiCommands { | |
| #[arg(num_args = 1.., required = true)] | ||
| files: Vec<PathBuf>, | ||
| }, | ||
| Run { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be great to have comment and help text for this command
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the name and invocation of the command is very expressive. As I understand when looking into it in the description, it should serve some API, similar to I recommend to changing it to something obvious to what it actually does. For example,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, sounds good. But let's put it under the |
||
| /// Forest address | ||
| #[clap(long, default_value = "/ip4/127.0.0.1/tcp/2345/http")] | ||
| forest: UrlFromMultiAddr, | ||
| /// Lotus address | ||
| #[clap(long, default_value = "/ip4/127.0.0.1/tcp/1234/http")] | ||
| lotus: UrlFromMultiAddr, | ||
| /// Filter which tests to run according to method name. Case sensitive. | ||
| #[arg(long, default_value = "")] | ||
| filter: String, | ||
| }, | ||
| } | ||
|
|
||
| impl ApiCommands { | ||
|
|
@@ -323,6 +335,17 @@ impl ApiCommands { | |
| }; | ||
| } | ||
| } | ||
| Self::Run { | ||
| forest: UrlFromMultiAddr(forest), | ||
| lotus: UrlFromMultiAddr(lotus), | ||
| filter, | ||
| } => { | ||
| let forest = Arc::new(rpc::Client::from_url(forest)); | ||
| let lotus = Arc::new(rpc::Client::from_url(lotus)); | ||
|
|
||
| let tests = api_run_tests::create_tests().await; | ||
| api_run_tests::run_tests(tests, forest.clone(), lotus.clone(), filter).await?; | ||
| } | ||
|
elmattic marked this conversation as resolved.
|
||
| Self::DumpTests { | ||
| create_tests_args, | ||
| path, | ||
|
|
||
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.
nit: as far as I recall, the
format!performance is not great, especially compared to dedicated crates likehex. I'd rather we use the latter.It might make sense to consider https://lib.rs/crates/faster-hex in the future to replace the
hexas well.