Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ jobs:
- run: cargo bench --no-run -p tako-rs-core

autobahn:
name: autobahn websocket suite
name: autobahn websocket suite (${{ matrix.example }})
runs-on: ubuntu-latest
# The suite is heavy (4-7 minutes) and depends on docker. Run it on
# PRs that touch streams + on main. PRs that don't touch the WS path
# opt out via path filter.
strategy:
fail-fast: false
matrix:
example: [autobahn-echo, autobahn-echo-compio]
# Heavy (4-7 minutes) and needs Docker: runs on pushes to main and on PRs
# labeled run-autobahn.
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
Expand All @@ -224,13 +227,13 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: autobahn
key: autobahn-${{ matrix.example }}
- name: Run Autobahn fuzzingclient
run: ci/autobahn/run.sh
run: ci/autobahn/run.sh ${{ matrix.example }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: autobahn-report
name: autobahn-report-${{ matrix.example }}
path: ci/autobahn/reports/

fuzz-build:
Expand Down Expand Up @@ -268,6 +271,7 @@ jobs:
- cookies
- query_multi
- sse_encoder
- ws_frame
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
Expand Down
58 changes: 7 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
exclude = [
"examples/auth",
"examples/autobahn-echo",
"examples/autobahn-echo-compio",
"examples/extractors-multi",
"examples/file-stream",
"examples/graphql",
Expand Down Expand Up @@ -44,7 +45,7 @@ exclude = [
"examples/upload-progress",
"examples/websocket",
"examples/websocket-compio",
"examples/websocket-http2",
"examples/websocket-tls",
"examples/webtransport",
"examples/with-state",
"fuzz",
Expand Down Expand Up @@ -147,7 +148,6 @@ tikv-jemallocator = "0.7.0"
tokio = { version = "1.52.1", features = ["fs", "io-util", "macros", "net", "rt", "rt-multi-thread", "signal", "sync", "time"] }
tokio-rustls = "0.26.2"
tokio-stream = "0.1.17"
tokio-tungstenite = "0.30.0"
tokio-util = { version = "0.7.15", features = ["compat"] }
tokio-vsock = "0.7.2"
tonic = { version = "0.14.6", default-features = false, features = ["channel"] }
Expand All @@ -167,6 +167,9 @@ zstd = "0.14.0"
lto = "fat"
codegen-units = 1

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(fuzzing)"] }

[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }

Expand Down
18 changes: 18 additions & 0 deletions ci/autobahn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WebSocket conformance

Run on Linux with Cargo and Docker available:

```sh
ci/autobahn/run.sh
ci/autobahn/run.sh autobahn-echo-compio
AUTOBAHN_CASES='1.*,2.*' ci/autobahn/run.sh
```

The first command tests Tokio; the second tests Compio. `AUTOBAHN_CASES`
replaces the selected cases in `fuzzingclient.json`. The configured suite
excludes large-message/performance groups 9 and compression groups 12 and 13.

Exit status 0 means every selected case is OK or NON-STRICT. Status 1 means
the runner or server failed, a report is missing, or a case reports FAILED,
INFORMATIONAL_FAILED, WRONG_CODE, or UNCLEAN. Reports are written under
`ci/autobahn/reports/`.
26 changes: 7 additions & 19 deletions ci/autobahn/run.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
#!/usr/bin/env bash
#
# Runs the Autobahn fuzzingclient suite against the bundled echo server.
#
# Required tools on PATH:
# - cargo (with the workspace already cloned)
# - docker
#
# Exit codes:
# 0 every case is OK or NON-STRICT (interpreted as pass per Autobahn).
# 1 the runner crashed, the server didn't come up, or any case is
# FAILED / INFORMATIONAL_FAILED / WRONG_CODE / UNCLEAN.
#
# Usage:
# ci/autobahn/run.sh # full case set per fuzzingclient.json
# AUTOBAHN_CASES='1.*,2.*' ci/autobahn/run.sh # restrict cases (override)
# See ci/autobahn/README.md for prerequisites, case selection, and exit codes.

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
EXAMPLE="${1:-autobahn-echo}"
CONF_DIR="${ROOT_DIR}/ci/autobahn"
REPORT_DIR="${ROOT_DIR}/ci/autobahn/reports"

cd "${ROOT_DIR}"

echo "==> Building autobahn-echo example (release)"
cargo build --release --manifest-path examples/autobahn-echo/Cargo.toml
echo "==> Building ${EXAMPLE} example (release)"
cargo build --release --manifest-path "examples/${EXAMPLE}/Cargo.toml"

echo "==> Starting autobahn-echo on 127.0.0.1:9001"
"${ROOT_DIR}/examples/autobahn-echo/target/release/autobahn-echo" &
echo "==> Starting ${EXAMPLE} on 127.0.0.1:9001"
"${ROOT_DIR}/examples/${EXAMPLE}/target/release/${EXAMPLE}" &
SERVER_PID=$!
trap 'kill $SERVER_PID 2>/dev/null || true' EXIT

Expand All @@ -40,7 +28,7 @@ for _ in $(seq 1 50); do
sleep 0.1
done
if ! (echo > /dev/tcp/127.0.0.1/9001) 2>/dev/null; then
echo "autobahn-echo failed to bind 127.0.0.1:9001" >&2
echo "${EXAMPLE} failed to bind 127.0.0.1:9001" >&2
exit 1
fi
echo "==> server up, running fuzzingclient"
Expand Down
Loading
Loading