-
Notifications
You must be signed in to change notification settings - Fork 22
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
PHD: several cargo xtask phd
CLI fixes
#642
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `cargo xtask phd list` subcommand is currently broken, as it doesn't actually pass the `list` subcommand to `phd-runner` --- it just passes through any trailing args. So, running `cargo xtask phd list` gets you ```console $ cargo xtask phd list Compiling phd-runner Finished phd-runner dev [unoptimized + debuginfo] in 19.78s Running target/x86_64-unknown-illumos/debug/phd-runner Runtime configuration options for the runner. Usage: phd-runner [OPTIONS] <COMMAND> Commands: run list help Print this message or the help of the given subcommand(s) Options: --disable-ansi Suppress emission of terminal control codes in the runner's log output --emit-bunyan Emit Bunyan-formatted logs -h, --help Print help ``` rather than actually listing tests. This commit fixes that by actually passing the `list` subcommand to `phd-runner` before any trailing args. Now, it works: ```console $ cargo xtask phd list Compiling phd-runner Finished phd-runner dev [unoptimized + debuginfo] in 0.44s Running target/x86_64-unknown-illumos/debug/phd-runner list 2024-02-14T20:47:45.015748Z INFO phd_runner: 35: runner_args=ProcessArgs { command: List(ListOptions { include_filter: [], exclude_filter: [] }), disable_ansi: false, emit_bunyan: false } Tests enabled after applying filters: phd_tests::smoke::instance_spec_get_test phd_tests::smoke::nproc_test phd_tests::migrate::from_base::migration_from_base_and_back phd_tests::migrate::from_base::serial_history phd_tests::migrate::from_base::can_migrate_from_base phd_tests::server_state_machine::instance_reset_requires_running_test phd_tests::server_state_machine::instance_reset_test phd_tests::server_state_machine::instance_stop_causes_destroy_test phd_tests::server_state_machine::instance_start_stop_test phd_tests::migrate::running_process::export_failure phd_tests::migrate::running_process::import_failure phd_tests::migrate::running_process::migrate_running_process phd_tests::hw::lspci_lifecycle_test phd_tests::framework::multiline_serial_test phd_tests::crucible::migrate::load_test phd_tests::crucible::migrate::smoke_test phd_tests::crucible::smoke::shutdown_persistence_test phd_tests::crucible::smoke::boot_test phd_tests::migrate::multiple_migrations phd_tests::migrate::incompatible_vms phd_tests::migrate::serial_history phd_tests::migrate::smoke_test 22 test(s) selected ``` My bad!
Currently, `cargo xtask phd` accepts a custom `--base-propolis-branch` argument, and doesn't automatically populate that argument if it's provided. However, it doesn't support the `--base-propolis-commit` or `--base-propolis-cmd` arguments at all, and if they are present, `cargo xtask phd` will still pass `--base-propolis-branch` to `phd-runner`, causing a conflict between the `--base-propolis-branch` and `--base-propolis-commit`/`--base-propolis-cmd` args. This means that it's impossible to use `cargo xtask phd` with an explicit base commit or local base binary. This commit fixes that, by changing `cargo xtask phd run` to also look for those arguments, and skip setting the default `--base-propolis-branch` if either are present.
Currently, there's no way to *disable* the migration-from-base tests in `cargo xtask phd run`, only set where the base Propolis artifact comes from. This branch adds a `--no-base-propolis` flag to `cargo xtask phd run` so that migration-from-base tests can be skipped entirely, the way they can with a raw `phd-runner` invocation.
Currently, `cargo xtask phd` requires a `--` delimiter prior to any arguments that are passed through to `phd-runner`. This is a bit unfortunate, as the command invocation accepts some arguments that are consumed by the xtask command, and others that are passed through to `phd-runner`. This commit adds [`allow_hyphen_values`] to the trailing varargs in the Clap CLI for `cargo xtask phd`, so that the user doesn't need to explicitly pass the `--` delimiter. This makes the CLI a bit nicer to use. [`allow_hyphen_values`]: https://docs.rs/clap/latest/clap/struct.Arg.html#method.allow_hyphen_values
gjcolombo
approved these changes
Feb 14, 2024
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.
Thanks for the fixes!
Co-authored-by: Greg Colombo <greg@oxidecomputer.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch fixes a bunch of things that were broken and/or annoying about the
cargo xtask phd
CLI user experience. In particular, I've made the following changes:PHD: don't require
--
in xtask arg passthrough (a573d79)Currently,
cargo xtask phd
requires a--
delimiter prior to anyarguments that are passed through to
phd-runner
. This is a bitunfortunate, as the command invocation accepts some arguments that are
consumed by the xtask command, and others that are passed through to
phd-runner
. This commit addsallow_hyphen_values
to the trailingvarargs in the Clap CLI for
cargo xtask phd
, so that the user doesn'tneed to explicitly pass the
--
delimiter. This makes the CLI a bitnicer to use.
PHD: add
cargo xtask phd run --no-base-propolis
(f6913ca)Currently, there's no way to disable the migration-from-base tests in
cargo xtask phd run
, only set where the base Propolis artifact comesfrom. This branch adds a
--no-base-propolis
flag tocargo xtask phd run
so that migration-from-base tests can be skipped entirely, the waythey can with a raw
phd-runner
invocation.PHD: allow overriding base commit with
xtask phd
(03a64f6)Currently,
cargo xtask phd
accepts a custom--base-propolis-branch
argument, and doesn't automatically populate that argument if it's
provided. However, it doesn't support the
--base-propolis-commit
or--base-propolis-cmd
arguments at all, and if they are present,cargo xtask phd
will still pass--base-propolis-branch
tophd-runner
,causing a conflict between the
--base-propolis-branch
and--base-propolis-commit
/--base-propolis-cmd
args. This means thatit's impossible to use
cargo xtask phd
with an explicit base commit orlocal base binary.
This commit fixes that, by changing
cargo xtask phd run
to also lookfor those arguments, and skip setting the default
--base-propolis-branch
if either are present.PHD: fix
cargo xtask phd list
not doing that (882a034)The
cargo xtask phd list
subcommand is currently broken, as it doesn'tactually pass the
list
subcommand tophd-runner
--- it just passesthrough any trailing args. So, running
cargo xtask phd list
gets yourather than actually listing tests.
This commit fixes that by actually passing the
list
subcommand tophd-runner
before any trailing args. Now, it works:My bad!