Skip to content
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

feat: add filtering and early exit to api compare command #3662

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

lemmih
Copy link
Contributor

@lemmih lemmih commented Nov 3, 2023

Summary of changes

Changes introduced in this pull request:

  • Add --filter flag limiting test runs to a subset of RPC methods.
  • Add --fast-fail flag that cancels a test run on the first failure.
  • Sort tests by RPC method name before running them.

Reference issue to close (if applicable)

Part of #3641

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@lemmih lemmih marked this pull request as ready for review November 3, 2023 13:30
@lemmih lemmih requested a review from a team as a code owner November 3, 2023 13:30
@lemmih lemmih requested review from ruseinov and aatifsyed and removed request for a team November 3, 2023 13:30
let (forest_status, lotus_status) = test.run(&forest, &lotus).await;
results
.entry((test.request.method_name, forest_status, lotus_status))
.and_modify(|v| *v += 1)
.or_insert(1u32);
if (forest_status != EndpointStatus::Valid || lotus_status != EndpointStatus::Valid)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could do something like vec![statuses].contains(lotus_status).

@@ -28,6 +28,12 @@ pub enum ApiCommands {
/// Snapshot input paths. Supports `.car`, `.car.zst`, and `.forest.car.zst`.
#[arg()]
snapshot_files: Vec<PathBuf>,
/// Test filter
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be more helpful - how do I, the user, use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Described the flag in more detail.

filter: String,
/// Cancel test run on the first failure
#[arg(long)]
fail_fast: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer --no-fail-fast to match cargo test and cargo nextest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clap has little support for --no-* flags. Let's punt this for another time.

@lemmih lemmih added this pull request to the merge queue Nov 6, 2023
Merged via the queue into main with commit c2840a4 Nov 6, 2023
26 checks passed
@lemmih lemmih deleted the lemmih/api-compare-filter-and-fast-fail branch November 6, 2023 08:14
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