Skip to content

Run integration tests through the oha binary and simplify test setup - #896

Merged
hatoo merged 3 commits into
masterfrom
test/use-cargo-bin-exe
Sep 8, 2026
Merged

Run integration tests through the oha binary and simplify test setup#896
hatoo merged 3 commits into
masterfrom
test/use-cargo-bin-exe

Conversation

@hatoo

@hatoo hatoo commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Integration tests previously called oha::run through a library target, bypassing the executable's entry point. Run the Cargo-built binary via CARGO_BIN_EXE_oha instead, capturing its exit status and output for failure diagnostics. Move the implementation into main.rs and retain argument-parsing checks as unit tests.

The integration tests now use current-thread Tokio runtimes. Simplify argument handling with AsRef<OsStr>, merge the proxy helpers, and parameterize JSON schema validation. Bind TCP and QUIC servers to OS-assigned ports while retaining their sockets, and embed the HTTP/3 test certificates with include_bytes!.

Validation on Linux:

  • Integration tests: default (37 passed), HTTP/3 (42 passed), native-tls (37 passed).
  • Unit tests: 40 passed after moving the implementation into main.rs.
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings

@hatoo
hatoo merged commit 4efba2d into master Sep 8, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant