Skip to content

Commit

Permalink
Improve E2E test CLI (FuelLabs#3079)
Browse files Browse the repository at this point in the history
- Added new args: `exclude`, `skip-until`, `abi-only`, `contract-only`
and `first-only`:
```
❯ cargo run --bin=test -- --help
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=]
      --locked              Intended for use in `CI` to ensure test lock files are up to date
  -h, --help                Print help information
```
- Made `main()` async and refactored the rest accordingly so we don't
have to create a new Tokio runtime for each `run` and `deploy`.
- Moved some assertions to `assert_matches`, which will print the value
that wasn't matched instead of just printing that there was no match,
which helps with debugging.
- Used `anyhow::Error`s instead of `String`s in more `Result::Err`s.

Co-authored-by: Emily Herbert <[email protected]>
  • Loading branch information
AlicanC and emilyaherbert authored Oct 24, 2022
1 parent 5b9e2c9 commit 8ae44c2
Show file tree
Hide file tree
Showing 10 changed files with 434 additions and 279 deletions.
160 changes: 84 additions & 76 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion forc-pkg/src/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub type ManifestMap = HashMap<PinnedId, PackageManifestFile>;
pub struct PinnedId(u64);

/// The result of successfully compiling a package.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct Compiled {
pub json_abi_program: JsonABIProgram,
pub storage_slots: Vec<StorageSlot>,
Expand Down
Loading

0 comments on commit 8ae44c2

Please sign in to comment.