Skip to content

Commit 41b3468

Browse files
committed
[CI] Use mise action in CI
1 parent 0b2e190 commit 41b3468

File tree

3 files changed

+171
-44
lines changed

3 files changed

+171
-44
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ jobs:
8181
uses: ./.github/actions/install-protobuf
8282
- name: Install FUSE
8383
uses: ./.github/actions/install-fuse
84+
- name: Install cargo-deny
85+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
86+
with:
87+
install_args: "aqua:EmbarkStudios/cargo-deny"
8488
- run: ci/deny
8589

8690
test:
@@ -113,9 +117,9 @@ jobs:
113117
- name: Install FUSE
114118
uses: ./.github/actions/install-fuse
115119
- name: Install nextest
116-
uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
120+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
117121
with:
118-
tool: nextest@0.9
122+
install_args: "aqua:nextest-rs/nextest/cargo-nextest"
119123
- run: ci/test
120124

121125
benchmark-check:
@@ -308,44 +312,24 @@ jobs:
308312
# Check our protobufs for lint cleanliness and for lack of breaking
309313
# changes
310314
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
311-
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.10
312-
- name: Install Protobuf
313-
uses: ./.github/actions/install-protobuf
314-
- name: Install FUSE
315-
uses: ./.github/actions/install-fuse
316-
- name: buf-setup
317-
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
315+
- name: Install buf
316+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
317+
with:
318+
install_args: buf
318319
- run: ci/buf
319320

320321
actionlint:
321322
runs-on: ubuntu-latest
322323
steps:
323-
- name: set actionlint version & checksum
324-
id: version
325-
run: |
326-
export ACTIONLINT="1.7.3"
327-
export ACTIONLINT_CHECKSUM="37252b4d440b56374b0fc1726e05fd7452d30d6d774f6e9b52e65bb64475f9db"
328-
329-
echo "actionlint version: ${ACTIONLINT}"
330-
echo "actionlint checksum: ${ACTIONLINT_CHECKSUM}"
331-
332-
echo "ACTIONLINT=${ACTIONLINT}" >> $GITHUB_OUTPUT
333-
echo "ACTIONLINT_CHECKSUM=${ACTIONLINT_CHECKSUM}" >> $GITHUB_OUTPUT
334-
335324
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
336-
- name: Download actionlint
337-
shell: bash
338-
run: |
339-
wget https://github.com/rhysd/actionlint/releases/download/v${{ steps.version.outputs.ACTIONLINT }}/actionlint_${{ steps.version.outputs.ACTIONLINT }}_linux_amd64.tar.gz
340-
341-
echo "${{ steps.version.outputs.ACTIONLINT_CHECKSUM }} actionlint_${{ steps.version.outputs.ACTIONLINT }}_linux_amd64.tar.gz" >> CHECKSUMS
342-
sha256sum -c CHECKSUMS
343-
344-
tar -xvf actionlint_${{ steps.version.outputs.ACTIONLINT }}_linux_amd64.tar.gz
325+
- name: Install actionlint
326+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
327+
with:
328+
install_args: actionlint
345329
- name: Check workflow files
346330
shell: bash
347331
run: |
348-
./actionlint -color \
332+
actionlint -color \
349333
-ignore 'Double quote to prevent globbing and word splitting' \
350334
-ignore 'Consider using { cmd1; cmd2; } >> file instead of individual redirects' \
351335
-ignore 'Declare and assign separately to avoid masking return values'
@@ -382,9 +366,10 @@ jobs:
382366
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
383367
with:
384368
cache: false
385-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
369+
- name: Install cargo-machete
370+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
386371
with:
387-
tool: cargo-machete@0.9.1
372+
install_args: "github:bnjbvr/cargo-machete"
388373
- run: cargo machete
389374

390375
custom-lints:
@@ -393,15 +378,9 @@ jobs:
393378
steps:
394379
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
395380
- name: Install ast-grep
396-
run: |
397-
wget https://github.com/ast-grep/ast-grep/releases/download/0.39.5/app-x86_64-unknown-linux-gnu.zip
398-
echo "9a1cab3e7916c98c6fe0079cc2c3b44d98832ba3bdb9db492d04a4e60e41fd0f app-x86_64-unknown-linux-gnu.zip" | sha256sum -c
399-
unzip app-x86_64-unknown-linux-gnu.zip
400-
mv sg /usr/local/bin/sg
401-
mv ast-grep /usr/local/bin/ast-grep
402-
chmod +x /usr/local/bin/sg
403-
chmod +x /usr/local/bin/ast-grep
404-
sg --version
381+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
382+
with:
383+
install_args: "aqua:ast-grep/ast-grep"
405384
- name: Test custom lints
406385
run: ci/test_custom_lints
407386
- name: Run custom lints

.github/workflows/config-validation.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
2828
with:
2929
cache: true
30-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
30+
- name: Install nextest
31+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
3132
with:
32-
tool: nextest@0.9.72
33+
install_args: "aqua:nextest-rs/nextest/cargo-nextest"
3334
- name: Install Protobuf
3435
uses: ./.github/actions/install-protobuf
3536
- name: Install FUSE

.plan/improve-test-target.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Improve duck: backport smp-test-target features
2+
3+
## Background
4+
5+
Comparison of `smp-test-target` (in the SMP repo at `testing/target/`) with lading's
6+
duck + sheepdog integration testing (`integration/ducks/` + `integration/sheepdog/`).
7+
8+
---
9+
10+
## Systems at a Glance
11+
12+
| Aspect | smp-test-target | duck + sheepdog |
13+
|---|---|---|
14+
| Control plane | CLI flags only | gRPC over Unix socket (StartTest / GetMetrics / Shutdown RPCs) |
15+
| Metrics exposure | Prometheus HTTP endpoint | gRPC `GetMetrics` RPC → structured types |
16+
| Port allocation | Fixed/configured addresses | Random ports (`127.0.0.1:0`), returned via RPC |
17+
| Protocols | HTTP/1.1, TCP, UDS (simultaneously) | HTTP, TCP, UDP (one at a time via enum) |
18+
| Failure simulation | Normal / Crash / Hang behavior modes | None |
19+
| Data quality | Not measured | Shannon entropy + DDSketch quantiles |
20+
| Tests | `proptest` timing + `insta` snapshots | None inside duck |
21+
| Orchestration | External (SMP system) | Sheepdog builds both binaries, runs load test, asserts |
22+
23+
---
24+
25+
## Where duck/sheepdog is already better
26+
27+
- **gRPC control plane** – runtime config, structured metric collection, dynamic port
28+
allocation; far more composable than CLI flags.
29+
- **Sheepdog orchestration** – true end-to-end harness; SMP's target is driven
30+
externally.
31+
- **Data quality** – Shannon entropy + DDSketch per protocol; SMP only counts bytes.
32+
- **Port isolation**`127.0.0.1:0` is safe for parallel test runs; SMP uses fixed
33+
addresses.
34+
35+
---
36+
37+
## Backports (priority order)
38+
39+
### 1. Behavior modes — `Normal / Crash / Hang` ← most impactful
40+
41+
smp-test-target's `behavior.rs` simulates target misbehavior so the *harness* can
42+
be tested. Duck has none of this; sheepdog never exercises lading's reaction to a
43+
failing target.
44+
45+
**Design:**
46+
47+
Add `BehaviorConfig` to `DucksConfig` in `integration/shared/src/lib.rs`:
48+
49+
```rust
50+
#[derive(Debug, Clone, Serialize, Deserialize)]
51+
pub enum BehaviorConfig {
52+
Normal,
53+
Crash { delay_secs: u64 },
54+
Hang { delay_secs: u64 },
55+
}
56+
```
57+
58+
Duck's `start_test()` spawns a behavior task alongside the listener. On `Hang`, the
59+
behavior task drops its shutdown receiver so it must be explicitly aborted (mirror
60+
smp-test-target's approach of aborting the task handle after the 5-second timeout).
61+
62+
**Files:**
63+
- `integration/shared/src/lib.rs` — add `BehaviorConfig` to `DucksConfig`
64+
- `integration/ducks/src/main.rs` — spawn behavior task; explicit abort on Hang
65+
- `integration/sheepdog/src/lib.rs` — new test cases exercising Crash/Hang
66+
67+
**Reference:** `../single-machine-performance/testing/target/src/behavior.rs`
68+
69+
---
70+
71+
### 2. Shutdown timeout
72+
73+
smp-test-target enforces a 5-second timeout waiting for tasks to exit. Duck has no
74+
timeout guard; a stuck task will block shutdown indefinitely.
75+
76+
**Design:** wrap duck's `JoinSet`/task-wait in
77+
`tokio::time::timeout(Duration::from_secs(5), ...)`.
78+
79+
**Files:**
80+
- `integration/ducks/src/main.rs` — shutdown path
81+
82+
---
83+
84+
### 3. Multiple simultaneous inputs
85+
86+
smp-test-target runs HTTP + TCP + UDS together. Duck's `ListenConfig` is a
87+
single-variant enum so only one protocol can be active per test.
88+
89+
**Design:** replace the enum with a struct:
90+
91+
```rust
92+
pub struct ListenConfig {
93+
pub http: bool,
94+
pub tcp: bool,
95+
pub udp: bool,
96+
pub uds: Option<PathBuf>, // see backport 4
97+
}
98+
```
99+
100+
**Files:**
101+
- `integration/shared/src/lib.rs` — restructure `ListenConfig`
102+
- `integration/ducks/src/main.rs` — spin up all enabled listeners
103+
- `integration/sheepdog/src/lib.rs` — update test configs
104+
105+
---
106+
107+
### 4. UDS input
108+
109+
smp-test-target has a Unix datagram socket input (`inputs/uds.rs`). Duck supports
110+
HTTP / TCP / UDP but not UDS, despite lading being able to generate UDS traffic.
111+
112+
**Design:** add `uds_listen()` to duck; add `uds: Option<PathBuf>` to `ListenConfig`
113+
(naturally pairs with backport 3); add `SocketMetrics` for UDS to the protobuf.
114+
115+
**Files:**
116+
- `integration/ducks/src/main.rs``uds_listen()` function
117+
- `integration/shared/src/lib.rs` — UDS in `ListenConfig` + `Metrics`
118+
- `integration/shared/proto/integration_api.proto` — UDS in `Metrics` message
119+
120+
**Reference:** `../single-machine-performance/testing/target/src/inputs/uds.rs`
121+
122+
---
123+
124+
### 5. Internal tests for duck
125+
126+
smp-test-target uses `proptest` + Tokio time-pausing (`time::pause()` /
127+
`time::advance()`) to validate behavior delay timing without real sleeps. Duck has
128+
no internal tests at all.
129+
130+
Add `proptest` tests for behavior timing once backport 1 is in place.
131+
132+
**Files:**
133+
- `integration/ducks/src/main.rs` (or a new `behavior.rs` module) — `#[cfg(test)]`
134+
block
135+
136+
---
137+
138+
## Verification
139+
140+
```
141+
cargo build -p ducks
142+
cargo build -p sheepdog
143+
cargo test -p sheepdog # existing tests still green
144+
cargo test -p sheepdog crash # new Crash behavior test
145+
```
146+
147+
New sheepdog test goal: lading exits 0 even when duck exits 1 (Crash mode).

0 commit comments

Comments
 (0)