Skip to content

Commit 8835ce6

Browse files
feat(test): add the openshell-test program
tests/openshell-test/ builds openshell-test, a binary whose main calls testkit::main() and links the conformance suite. It lists, waits for the gateway, and runs the conformance tests without cargo or nextest. Its list matches what nextest lists for the suite. It is its own workspace because later families live in other workspaces. Its lockfile is aligned with the root's, and Branch Checks and the mise tasks format, lint and test it. It is not published, and CI does not run it against a gateway yet. A dependency that is never named is not linked, so a suite the program forgets to name would silently go missing. testkit::main() now fails with exit 2 when a program links no tests, under every command. Signed-off-by: Matthew Grossman <[email protected]>
1 parent 0bf03f5 commit 8835ce6

14 files changed

Lines changed: 4621 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ jobs:
236236
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance -- --check
237237
cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh -- --check
238238
cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check
239+
cargo fmt --manifest-path tests/openshell-test/Cargo.toml --all -- --check
239240
240241
cargo-lockfiles:
241242
name: Cargo lockfiles
@@ -300,6 +301,7 @@ jobs:
300301
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml -p conformance --all-targets -- -D warnings
301302
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh --all-targets -- -D warnings
302303
cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings
304+
cargo clippy --locked --manifest-path tests/openshell-test/Cargo.toml --all-targets -- -D warnings
303305
304306
rust-test:
305307
name: Rust test (${{ matrix.system }})
@@ -389,6 +391,7 @@ jobs:
389391
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml
390392
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/tmachine/Cargo.toml
391393
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/runner/Cargo.toml
394+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/openshell-test/Cargo.toml
392395
393396
rust-postgres-test:
394397
name: Rust PostgreSQL tests

‎TESTING.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ python/openshell/ # Python unit tests (*_test.py suffix)
1717
e2e/python/ # Python E2E tests (test_*.py prefix)
1818
e2e/rust/ # Rust CLI E2E tests
1919
tests/testkit/ # Support library for SDK-driven E2E suites
20+
tests/openshell-test/ # openshell-test: the conformance suite as one program
2021
tests/suites/ # E2E suites, grouped by test family
2122
tests/tmachine/ # QEMU test machines, Ansible playbooks, and the Session API
2223
tests/runner/ # openshell-test-runner: runs a test family in a tmachine environment
@@ -181,6 +182,11 @@ by `OPENSHELL_BIN`. See
181182
[tests/testkit/README.md](tests/testkit/README.md) for how to write and run
182183
tests.
183184

185+
`tests/openshell-test/` builds `openshell-test`, a program that links the
186+
conformance suite and runs it against a gateway without cargo or nextest
187+
(`openshell-test list`, `ready`, `run`). The testkit README describes its
188+
commands.
189+
184190
Suites live under `tests/suites/<family>/`. Each family is a Cargo workspace
185191
with its own lockfile. Run the `conformance` suites against a local Docker
186192
gateway with:

‎tasks/rust.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ run = [
4242
"cargo clippy --manifest-path tests/suites/conformance/Cargo.toml -p conformance --all-targets -- -D warnings",
4343
"cargo clippy --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh --all-targets -- -D warnings",
4444
"cargo clippy --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings",
45+
"cargo clippy --manifest-path tests/openshell-test/Cargo.toml --all-targets -- -D warnings",
4546
]
4647
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 lint native"
4748
hide = true
@@ -60,6 +61,7 @@ run = [
6061
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance",
6162
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh",
6263
"cargo fmt --manifest-path tests/support/Cargo.toml --all",
64+
"cargo fmt --manifest-path tests/openshell-test/Cargo.toml --all",
6365
]
6466
hide = true
6567

@@ -77,6 +79,7 @@ run = [
7779
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p conformance -- --check",
7880
"cargo fmt --manifest-path tests/suites/features/Cargo.toml -p keycloak-provider-refresh -- --check",
7981
"cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check",
82+
"cargo fmt --manifest-path tests/openshell-test/Cargo.toml --all -- --check",
8083
]
8184
hide = true
8285

‎tasks/scripts/check_cargo_lockfile_alignment.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"tests/testkit",
4040
"tests/suites/conformance",
4141
"tests/suites/features",
42+
"tests/openshell-test",
4243
)
4344

4445

‎tasks/test.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ run = [
127127
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/testkit/Cargo.toml",
128128
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/tmachine/Cargo.toml",
129129
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/runner/Cargo.toml",
130+
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/openshell-test/Cargo.toml",
130131
]
131132
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 test-precommit native"
132133
hide = true

0 commit comments

Comments
 (0)