Bogie Testing Crate

Railscale’s dedicated testing crate for HTTP/1.x compliance, regression, and performance testing. Named after the wheel assembly that supports a railcar.

Overview

Located at bogie/ in the workspace root. Implements a three-layer testing pyramid plus local benchmarks. Uses proptest for property-based testing, criterion for benchmarks, and shell scripts for conformance tests against the reference binary.

Test Pyramid

Layer 1: Property Tests (proptest)

FileContents
bogie/src/generators.rsProptest strategies for HTTP messages (methods, URIs, versions, headers, full messages)
bogie/tests/proptest_derive.rs9 property tests for the derivation engine — version matching, content-length, chunked TE, CL+TE conflicts, connection semantics, matcher dedup
bogie/tests/proptest_codec.rs4 property tests for HttpStreamingCodec — split invariance, frame count, round-trip fidelity, no-panic on arbitrary bytes

Layer 2: Deterministic Tests

FileTestsCoverage
bogie/tests/compliance_matrix.rs28 (26 active, 2 ignored)RFC 7230 sections 3.3.3, 3.3.2, 3.3.1, 6.1, 2.6. Uses ComplianceCase struct with DeriverSession feed/resolve pattern
bogie/tests/integration.rs8 asyncSimple GET, POST with body, malformed400, upstream down502, large body streaming 1MB, concurrent clients, client disconnect, unix socket
bogie/tests/smuggling.rs11 (10 active, 1 ignored)CL.TE, CL.CL, TE.TE, obfuscated TE variants

Layer 3: Conformance Shell Tests

Runner: bogie/conformance/run.sh — builds the reference binary and executes all test_*.sh scripts.

Helpers:

  • bogie/conformance/helpers/common.sh — port allocation, wait_for_port, start_echo_upstream, start_proxy, cleanup trap
  • bogie/conformance/helpers/assertions.shassert_status, assert_body_contains

6 test scripts: test_basic_get, test_post_with_body, test_connection_close, test_http10_close, test_upstream_down, test_malformed_request (skipped)

Benchmarks (criterion)

FileBenchmarksGroups
bogie/benches/micro.rs7 microbenchmarkscodec_decode, matcher, derive
bogie/benches/pipeline.rs1 end-to-end100 requests through full proxy pipeline

Test Harness

bogie/src/harness.rs provides reusable test infrastructure:

  • TestUpstream — echo or fixed_response mode
  • TestProxy — spawns a full Pipeline for integration tests
  • send_raw helper — raw TCP request sender
  • free_port — finds an available port
  • Both TestUpstream and TestProxy abort handles on Drop

Known Compliance Gaps

Documented but not yet fixed

  1. CL+TE conflict should reject request (RFC 7230 section 3.3.3) — #[ignore]
  2. Unknown HTTP version should reject (RFC 7230 section 2.6) — #[ignore]
  3. Malformed request line not validated — conformance test skipped

Running Tests

Quick Reference

cargo test -p bogie          # All Rust tests
bash bogie/conformance/run.sh # Shell conformance tests
cargo bench -p bogie          # All benchmarks

Current Status (2026-03-31)

  • 57 Rust tests passing, 3 ignored
  • 6/6 conformance shell tests passing (1 skipped)
  • All benchmarks verified working