Skip to content

Commit 988d5c3

Browse files
ci(tests): format and lint each test workspace as a whole
Replace the per-package cargo fmt and cargo clippy lines for the conformance, drivers and features test workspaces with one line per workspace, in the Branch Checks Format and Lint steps and in the rust:lint, rust:format and rust:format:check tasks. New suite crates are covered without editing the lint lists, and the features workspace's kubernetes-updates crate is now linted; it raises no warnings. Signed-off-by: Matthew Grossman <[email protected]>
1 parent d0d6e10 commit 988d5c3

3 files changed

Lines changed: 18 additions & 25 deletions

File tree

‎.github/workflows/branch-checks.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,9 @@ jobs:
233233
cargo fmt --manifest-path tests/testkit/Cargo.toml --all -- --check
234234
cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check
235235
cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check
236-
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance -- --check
237-
cargo fmt --manifest-path tests/suites/drivers/Cargo.toml -p podman-driver -- --check
238-
cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh -- --check
239-
cargo fmt --manifest-path tests/suites/features/Cargo.toml -p oci-image -- --check
236+
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all -- --check
237+
cargo fmt --manifest-path tests/suites/drivers/Cargo.toml --all -- --check
238+
cargo fmt --manifest-path tests/suites/features/Cargo.toml --all -- --check
240239
cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check
241240
242241
cargo-lockfiles:
@@ -299,10 +298,9 @@ jobs:
299298
cargo clippy --locked --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings
300299
cargo clippy --locked --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings
301300
cargo clippy --locked --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings
302-
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml -p conformance --all-targets -- -D warnings
303-
cargo clippy --locked --manifest-path tests/suites/drivers/Cargo.toml -p podman-driver --all-targets -- -D warnings
304-
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh --all-targets -- -D warnings
305-
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml -p oci-image --all-targets -- -D warnings
301+
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings
302+
cargo clippy --locked --manifest-path tests/suites/drivers/Cargo.toml --workspace --all-targets -- -D warnings
303+
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings
306304
cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings
307305
308306
rust-test:

‎TESTING.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,9 @@ suite, with a name that says what the suite tests.
262262
2. Write the tests in `tests/*.rs` as `#[testkit::test]` functions.
263263
3. Re-lock the workspace: `cargo metadata --manifest-path
264264
tests/suites/features/Cargo.toml`, then
265-
`uv run tasks/scripts/check_cargo_lockfile_alignment.py --fix`.
266-
4. Add `cargo fmt` and `cargo clippy` lines for the package (`-p <name>`) to
267-
`tasks/rust.toml` and to the Format and Lint steps in
268-
`.github/workflows/branch-checks.yml`.
269-
5. Add a row for the suite to the matrix in `.github/workflows/e2e-suites.yml`.
265+
`uv run tasks/scripts/check_cargo_lockfile_alignment.py --fix`. `cargo fmt`
266+
and `cargo clippy` already cover every package in the workspace.
267+
4. Add a row for the suite to the matrix in `.github/workflows/e2e-suites.yml`.
270268

271269
If the feature only needs the gateway, run the suite in an existing
272270
environment such as `ubuntu-docker-rootful`, and skip the rest of this

‎tasks/rust.toml‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ run = [
3939
"cargo clippy --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings",
4040
"cargo clippy --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings",
4141
"cargo clippy --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings",
42-
"cargo clippy --manifest-path tests/suites/conformance/Cargo.toml -p conformance --all-targets -- -D warnings",
43-
"cargo clippy --manifest-path tests/suites/drivers/Cargo.toml -p podman-driver --all-targets -- -D warnings",
44-
"cargo clippy --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh --all-targets -- -D warnings",
45-
"cargo clippy --manifest-path tests/suites/features/Cargo.toml -p oci-image --all-targets -- -D warnings",
42+
"cargo clippy --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings",
43+
"cargo clippy --manifest-path tests/suites/drivers/Cargo.toml --workspace --all-targets -- -D warnings",
44+
"cargo clippy --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings",
4645
"cargo clippy --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings",
4746
]
4847
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 lint native"
@@ -59,10 +58,9 @@ run = [
5958
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all",
6059
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all",
6160
"cargo fmt --manifest-path tests/runner/Cargo.toml --all",
62-
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance",
63-
"cargo fmt --manifest-path tests/suites/drivers/Cargo.toml -p podman-driver",
64-
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh",
65-
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p oci-image",
61+
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all",
62+
"cargo fmt --manifest-path tests/suites/drivers/Cargo.toml --all",
63+
"cargo fmt --manifest-path tests/suites/features/Cargo.toml --all",
6664
"cargo fmt --manifest-path tests/support/Cargo.toml --all",
6765
]
6866
hide = true
@@ -78,10 +76,9 @@ run = [
7876
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all -- --check",
7977
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check",
8078
"cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check",
81-
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance -- --check",
82-
"cargo fmt --manifest-path tests/suites/drivers/Cargo.toml -p podman-driver -- --check",
83-
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh -- --check",
84-
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p oci-image -- --check",
79+
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all -- --check",
80+
"cargo fmt --manifest-path tests/suites/drivers/Cargo.toml --all -- --check",
81+
"cargo fmt --manifest-path tests/suites/features/Cargo.toml --all -- --check",
8582
"cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check",
8683
]
8784
hide = true

0 commit comments

Comments
 (0)