Skip to content

Commit

Permalink
cleanup some args (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglass committed Jun 6, 2023
1 parent d2752b4 commit ec19fb2
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .captain/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ test-suites:
print-summary: true
reporters:
github-step-summary:
# shorthand for running clippy in dev
dev-clippy:
command: cargo clippy --workspace --tests --profile=release-unstable --all-features -- --deny warnings
# shorthand for running tests in dev
dev-test-abq:
command: cargo nextest r --all-features --cargo-profile=release-unstable
1 change: 1 addition & 0 deletions .captain/dev-clippy/flakes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions .captain/dev-clippy/quarantines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions .captain/dev-clippy/timings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions .captain/dev-test-abq/flakes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions .captain/dev-test-abq/quarantines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions .captain/dev-test-abq/timings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
25 changes: 15 additions & 10 deletions crates/abq_cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub enum Command {
/// Stores an RWX access token for local usage. You can generate RWX Personal Access Tokens at: https://account.rwx.com/_/personal_access_tokens
Login {
/// The access token to save to the local abq config file.
///
/// Will be asked for interactively if not provided as an argument or set in RWX_ACCESS_TOKEN env var.
#[clap(long, required = false, env("RWX_ACCESS_TOKEN"))]
access_token: Option<AccessToken>,
},
Expand Down Expand Up @@ -326,19 +328,22 @@ pub enum Command {

/// How ABQ will distribute the tests.
///
/// By default, ABQ will distribute the next unassigned test to a worker asking for tests.
/// work-strategy=by-file, abq will distribute whole-files-at-a-time to workers asking for tests.
/// The non-default behavior can be helpful if you have very expensive setup or teardowns in a test file
/// that would, by default, be run multiples times by multiples workers instead of a single time on the worker
/// responsible for that test file.
/// Options:{n}
///- by-test: distribute the next test to any worker.{n}
///- by-file: distribute all tests in a file to the same worker. This ensures that expensive per-file shared setups or
/// teardowns will run only once on one worker, however it may cause tests to be less evenly distributed.
///
/// Note: The Jest & Playwright test frameworks run with a by-file strategy regardless of the value of this flag.
#[clap(long, default_value = "by-test")]
test_strategy: TestStrategy,

/// Whether to report tests with colors.
///
/// When set to `auto`, will try to emit colors unless the output channel is detected
/// Options:{n}
///- auto: try to emit colors unless the output channel is detected
/// not to be a TTY, if (on Windows) the console isn't available, if NO_COLOR is set, if
/// TERM is set to `dumb`, amongst other heuristics.
///- never: don't emit colors.
#[clap(long, default_value = "auto")]
color: ColorPreference,

Expand All @@ -351,9 +356,7 @@ pub enum Command {

/// A broad measure of inactivity timeout seconds, after which a test run is cancelled.
///
/// The inactivity timeout is applied in the following cases:
///
/// - If a test takes longer than the timeout seconds to complete
/// The inactivity timeout is applied if a single test takes longer than the timeout seconds to complete
///
/// When setting the inactivity, it is recommended to over-estimate
/// based on historical test runtimes you have observed for abq.
Expand Down Expand Up @@ -406,9 +409,11 @@ pub enum Command {

/// Whether to report tests with colors.
///
/// When set to `auto`, will try to emit colors unless the output channel is detected
/// Options:{n}
///- auto: try to emit colors unless the output channel is detected
/// not to be a TTY, if (on Windows) the console isn't available, if NO_COLOR is set, if
/// TERM is set to `dumb`, amongst other heuristics.
///- never: don't emit colors.
#[clap(long, default_value = "auto")]
color: ColorPreference,

Expand Down
12 changes: 11 additions & 1 deletion development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Then install cargo-insta for testing
cargo install cargo-insta
```

and nextest

```bash
curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
```

and set up the test data for some integration tests:

```bash
Expand Down Expand Up @@ -36,12 +42,16 @@ run lints similarly to how they're run in CI:

```bash
cargo clippy --workspace --tests --profile=release-unstable --all-features -- --deny warnings
# or with captain...
captain run dev-clippy
```

run tests similarly to how they're run in CI:

```bash
cargo test --profile=release-unstable --all-features
cargo nextest --cargo-profile=release-unstable --all-features
# or with captain...
captain run dev-test-abq
```


Expand Down

0 comments on commit ec19fb2

Please sign in to comment.