Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
186 changes: 0 additions & 186 deletions .github/workflows/bench-integration.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,72 @@ jobs:
with:
mode: simulation,memory
run: cargo codspeed run

# Integration benches drive the real async client against the bartender mock
# server, so they need the service container + MOCK_SERVER_URL. Kept as a
# separate job so the unit-bench job above stays fast and mock-server-free.
integration-benchmarks:
name: Run CodSpeed integration benchmarks
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # for OpenID Connect authentication with CodSpeed
services:
mock-server:
image: ghcr.io/whiskeysockets-devtools/bartender:latest
Comment thread
jlucaso1 marked this conversation as resolved.
Comment thread
jlucaso1 marked this conversation as resolved.
credentials:
username: ${{ github.actor }}
password: ${{ secrets.BARTENDER_GHCR_TOKEN }}
ports:
- 8080:8080
env:
CHATSTATE_TTL_SECS: "3"
options: --log-driver none
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-06-16

- name: Install tools (protoc, cargo-codspeed)
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }},cargo-codspeed@4.7.0

- name: Cache Rust registry
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ runner.os }}-cargo-codspeed-integration
cache-targets: "false"

- name: Wait for mock server
run: |
for i in $(seq 1 30); do
if curl -sk https://localhost:8080/ > /dev/null 2>&1; then
echo "Mock server is ready"
exit 0
fi
sleep 1
done
echo "Mock server failed to become ready"
exit 1

# simulation and memory share the same instrumented build, so one
# build covers both instruments.
- name: Build the benchmark targets
run: cargo codspeed build -m simulation -m memory -p bench-integration

# `-p bench-integration` is required: `tests/bench-integration` is not a
# workspace default-member, so a bare `cargo codspeed run` discovers no
# benchmarks for it ("No benchmarks found for the simulation mode").
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4
env:
MOCK_SERVER_URL: "wss://127.0.0.1:8080/ws/chat"
RUST_LOG: warn
with:
mode: simulation,memory
run: cargo codspeed run -p bench-integration
7 changes: 1 addition & 6 deletions Cargo.lock

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

21 changes: 5 additions & 16 deletions tests/bench-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,11 @@ version = "0.0.0"
edition = "2024"
publish = false

[package.metadata.cargo-shear]
ignored = ["dhat"]

[[bin]]
name = "bench-integration"
path = "src/main.rs"

[features]
dhat-heap = ["dep:dhat"]

[dependencies]
anyhow = { workspace = true }
dhat = { version = "0.3", optional = true }
divan = { workspace = true }
e2e-tests = { path = "../e2e" }
env_logger = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, features = ["std"] }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "sync", "time"] }
wacore = { path = "../../wacore" }
whatsapp-rust = { path = "../..", default-features = false, features = [
"danger-skip-tls-verify",
"debug-diagnostics",
Expand All @@ -33,5 +18,9 @@ whatsapp-rust = { path = "../..", default-features = false, features = [
"signal",
] }

[[bench]]
name = "integration"
harness = false

[lints]
workspace = true
Loading
Loading