diff --git a/.agents/rules/release.md b/.agents/rules/release.md index 896ed9de..044b7a6b 100644 --- a/.agents/rules/release.md +++ b/.agents/rules/release.md @@ -19,7 +19,9 @@ The VM executable build explicitly enables `native-api`; the guest requires a no `.github/workflows/weekly.yml` runs Monday at 04:23 UTC or manually. It checks floating stable fmt/clippy/nextest and a floating nightly eBPF build, re-downloads every pinned asset without caches to verify its checksum, and runs `cargo audit` for RustSec advisories. Ordinary CI has no weekly schedule; drift failures do not automatically open issues. -Its `public-vless-loopback` job uses the repository-pinned compiler and checksum-pinned official Xray/sing-box executables from `.github/ci/pins.env`. It runs exactly the two public ignored `vless_udp` cases and the ignored library case `official_vision_peers_switch_inner_tls_to_direct`, each with `rprx` and the nextest CI profile; missing executables or test selections fail. This is an optional weekly/manual lane, not a normal PR requirement or the legacy external-mask matrix. Low-port/IPv6 setup is restricted to the ephemeral GitHub-hosted runner; no lab credentials or live hosts are used. +Its `public-vless-loopback` job uses the repository-pinned compiler and checksum-pinned official Xray/sing-box executables from `.github/ci/pins.env`. It runs exactly the two public ignored `vless_udp` cases, the ignored library case `official_vision_peers_switch_inner_tls_to_direct` and the ignored `sing_box_shared_source_eim_eif_and_domain_matrix` of `tests/shared_source_sing_box.rs`, each with `rprx` and the nextest CI profile; missing executables or test selections fail. This is an optional weekly/manual lane, not a normal PR requirement or the legacy external-mask matrix. Low-port/IPv6 setup is restricted to the ephemeral GitHub-hosted runner; no lab credentials or live hosts are used. + +Each of those steps runs `ci/run-exact-ignored-tests.sh ...`, which fails unless `nextest list` reports exactly the requested tests as ignored and non-empty before running them. The independent weekly `fuzz` job uses the nightly channel from `crates/honk-ebpf/rust-toolchain.toml` and `CARGO_FUZZ_VERSION` from `pins.env`. It runs `document`, `share_link`, and `lexer` sequentially with two workers, 480 seconds per target, a 10-second input timeout and a 2048 MiB RSS limit. The job has a 40-minute timeout and uploads `fuzz-inputs` on success or failure. It keeps `contents: read` and opens no issues. diff --git a/.agents/rules/test-locations.md b/.agents/rules/test-locations.md index 32e9d0e7..6c52cbb7 100644 --- a/.agents/rules/test-locations.md +++ b/.agents/rules/test-locations.md @@ -39,7 +39,7 @@ Read with: `AGENTS.md` (Testing instructions); `real-ebpf.md` for the root-gated - `crates/honk-outbound/tests/feature_boundary.rs` — parsed VLESS nodes retain no executable backend in a normal `rprx`-off library; generation, DNS fork, ephemeral ownership and no-handler refusal remain aligned. Unlike unit tests, this does not enable backend code via `cfg(test)`. - `crates/honk-outbound/tests/vless_udp.rs` and `tests/vless_udp/reality.rs` — the two ignored public official-peer loopback cases. They require explicit `HONK_XRAY_BIN` and `HONK_SING_BOX_BIN`; the weekly/manual public-loopback job verifies nonempty selection and runs them with `rprx`, together with the ignored library case `proxy::vless::handler::tests::interop::official_vision_peers_switch_inner_tls_to_direct`. The older private external-mask test remains manual. - `crates/honk-outbound/tests/vless_udp/xhttp.rs` — unprivileged independent H2 UoT framing and the ignored official Xray H2 TLS/REALITY TCP/Native/XUDP matrix (`HONK_XRAY_BIN`, `rprx`). The independent peer waits for both the expected upload bytes and a download response handle, regardless of cross-carrier arrival order. The official matrix uses ephemeral loopback targets and explicit exact-target Freedom allows; no maintainer-lab/public-network dependency. - - `crates/honk-outbound/tests/shared_source_sing_box.rs` — ignored real-server interop for the shared UDP sources (Shadowsocks AEAD/2022, Trojan, SOCKS5, AnyTLS, VLESS UoT v2 and H2MUX) against a sing-box inbound set: two destinations on one association reach one server-side source, an unsolicited peer's reply keeps its source, and the domain-spelling matrix. It needs only `sing-box` (`HONK_SING_BOX_BIN` or PATH) and `rprx`; Juicity has no available real peer. + - `crates/honk-outbound/tests/shared_source_sing_box.rs` — ignored real-server interop for the shared UDP sources (Shadowsocks AEAD/2022, Trojan, SOCKS5, AnyTLS, VLESS UoT v2 and H2MUX) against a sing-box inbound set: two destinations on one association reach one server-side source, an unsolicited peer's reply keeps its source, and the domain-spelling matrix. It needs only `sing-box` (`HONK_SING_BOX_BIN` or PATH) and `rprx`; Juicity has no available real peer. The weekly/manual public-loopback job verifies its single nonempty selection and runs it against the pinned sing-box. - `crates/honk-core/tests/integration_test.rs` — loaded config-to-Router decisions, routing, stats, reload/subscription-merge pipeline, and daemon/CLI behavior. Direct/block and splice payload/accounting coverage stay in their owning unit suites. - `crates/honk-core/tests/clash_api_test.rs` — Clash API endpoints (auth, proxies, Score representation/current winner/PUT rejection, delay, connections, traffic/logs chunked + WS, `/dns/query`, cache flush, providers, UI hosting, store_dns). - `clash_api/ui/tests/attribution.rs` owns HTTP/TLS setup, response-header stall, carrier-failure Score attribution and certificate-name regressions; shared HTTP framing, URL authorization, bypass marking and body limits remain in `marked_http/tests.rs`. diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 9c7bfd38..b1a4d77a 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -99,7 +99,7 @@ jobs: readelf -S target/bpfel-unknown-none/release/honk-ebpf | grep '\.BTF' public-vless-loopback: - name: Public VLESS loopback interop (3 cases) + name: Public VLESS and shared-source loopback interop (4 cases) runs-on: ubuntu-24.04 timeout-minutes: 40 steps: @@ -159,31 +159,20 @@ jobs: set -euo pipefail test -x "$HONK_XRAY_BIN" test -x "$HONK_SING_BOX_BIN" - udp_test=official_xray_and_sing_box_vless_udp_loopback_interop - reality_test=reality::official_xray_reality_authenticates_first_connection_and_rejects_wrong_key - filter="test(=$udp_test) or test(=$reality_test)" - cargo nextest list -p honk-outbound --features rprx --test vless_udp --profile ci \ - --run-ignored only -E "$filter" --message-format json > "$RUNNER_TEMP/public-vless-tests.json" - jq -e --arg udp "$udp_test" --arg reality "$reality_test" ' - [."rust-suites"[].testcases | to_entries[] - | select(.value["filter-match"].status == "matches" and .value.ignored) | .key] - | sort == ([$udp, $reality] | sort) - ' "$RUNNER_TEMP/public-vless-tests.json" - cargo nextest run -p honk-outbound --features rprx --test vless_udp --profile ci \ - --run-ignored only -E "$filter" --no-tests fail + ci/run-exact-ignored-tests.sh --test vless_udp \ + official_xray_and_sing_box_vless_udp_loopback_interop \ + 'reality::official_xray_reality_authenticates_first_connection_and_rejects_wrong_key' - name: Run the official Vision uplink Direct case run: | set -euo pipefail - vision_test=proxy::vless::handler::tests::interop::official_vision_peers_switch_inner_tls_to_direct - cargo nextest list -p honk-outbound --features rprx --lib --profile ci \ - --run-ignored only -E "test(=$vision_test)" --message-format json > "$RUNNER_TEMP/public-vision-tests.json" - jq -e --arg vision "$vision_test" ' - [."rust-suites"[].testcases | to_entries[] - | select(.value["filter-match"].status == "matches" and .value.ignored) | .key] - == [$vision] - ' "$RUNNER_TEMP/public-vision-tests.json" - cargo nextest run -p honk-outbound --features rprx --lib --profile ci \ - --run-ignored only -E "test(=$vision_test)" --no-tests fail + ci/run-exact-ignored-tests.sh --lib \ + proxy::vless::handler::tests::interop::official_vision_peers_switch_inner_tls_to_direct + - name: Run the shared-source sing-box interop matrix + run: | + set -euo pipefail + test -x "$HONK_SING_BOX_BIN" + ci/run-exact-ignored-tests.sh --test shared_source_sing_box \ + sing_box_shared_source_eim_eif_and_domain_matrix - name: Upload public loopback JUnit if: failure() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/AGENTS.md b/AGENTS.md index 8124bf20..bd184aff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -162,7 +162,7 @@ The root `rust-toolchain.toml` pins the host compiler; `crates/honk-ebpf/rust-to Removed `run` / `deploy` / `docker*` recipes called absent `scripts/debug-local.sh` / `scripts/deploy-gateway.sh` / `Dockerfile` / `docker-compose.yml` (Repository layout). -`outbound-ci` runs all-target Clippy and crate test suites in separate `rprx`-off and `rprx`-on invocations; the config suite runs once. The weekly/manual `public-vless-loopback` lane separately runs the two public ignored `vless_udp` official-peer cases and the ignored official Vision uplink Direct case with pinned executables, not the legacy external-mask test. +`outbound-ci` runs all-target Clippy and crate test suites in separate `rprx`-off and `rprx`-on invocations; the config suite runs once. The weekly/manual `public-vless-loopback` lane separately runs the two public ignored `vless_udp` official-peer cases, the ignored official Vision uplink Direct case and the ignored shared-source sing-box matrix with pinned executables, not the legacy external-mask test. ## Current validation guidance diff --git a/ci/run-exact-ignored-tests.sh b/ci/run-exact-ignored-tests.sh new file mode 100755 index 00000000..fa1779cb --- /dev/null +++ b/ci/run-exact-ignored-tests.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Runs an exact, non-empty set of ignored tests: a missing or added selection +# fails before anything runs, so an interop case cannot silently stop running. +set -euo pipefail + +usage() { + echo "usage: $0 [--lib | --test ] [...]" >&2 + exit 2 +} + +target=() +while [[ ${1:-} == --lib || ${1:-} == --test ]]; do + case $1 in + --lib) target+=(--lib); shift ;; + --test) [[ $# -ge 2 ]] || usage; target+=(--test "$2"); shift 2 ;; + esac +done +[[ $# -ge 1 && ${#target[@]} -gt 0 ]] || usage + +filter='' +for test in "$@"; do + if [[ -n $filter ]]; then + filter+=' or ' + fi + filter+="test(=$test)" +done + +run=(cargo nextest run -p honk-outbound --features rprx "${target[@]}" --profile ci + --run-ignored only -E "$filter" --no-tests fail) + +echo "==> ${run[*]}" +list=$(cargo nextest list -p honk-outbound --features rprx "${target[@]}" --profile ci \ + --run-ignored only -E "$filter" --message-format json) +jq -e --args ' + [."rust-suites"[].testcases | to_entries[] + | select(.value["filter-match"].status == "matches" and .value.ignored) | .key] + | sort == ($ARGS.positional | sort) +' <<<"$list" "$@" || { + echo "selection does not match the requested ignored tests exactly" >&2 + exit 1 +} + +"${run[@]}"