FuelLabs/sway

E2E test CLI flag/doc SWAY_TEST_VERBOSE inconsistency

Open

#3174 opened on Oct 27, 2022

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Rust (61,702 stars) (5,421 forks)batch import
P: lowgood first issuetesting

Description

Take the following sets of commands:

export SWAY_TEST_VERBOSE=1
cargo run --bin test

Now produces:

error: '1' isn't a valid value for '--verbose'
  [possible values: true, false]
When setting the env var `SWAY_TEST_VERBOSE=1` and running `cargo run --bin test`

Which is a breaking but reasonable change from the previous behavior.

The main issue is that the help text still documents the previous value (=1):

Usage: test [OPTIONS] [REGEX]

Arguments:
  [REGEX]  Only run tests matching this regex

Options:
  -e, --exclude <REGEX>     Exclude tests matching this regex
  -s, --skip-until <REGEX>  Skip all tests until a test matches this regex
      --abi-only            Only run tests with ABI JSON output validation [aliases: abi]
      --contract-only       Only run tests that deploy contracts [aliases: contract]
      --first-only          Only run the first test [aliases: first]
      --verbose             Print out warnings and errors [env: SWAY_TEST_VERBOSE=1]
      --locked              Intended for use in `CI` to ensure test lock files are up to date
  -h, --help                Print help information

Contributor guide