-
Notifications
You must be signed in to change notification settings - Fork 7
125 lines (107 loc) · 5.17 KB
/
Copy pathhotpath-coverage.yml
File metadata and controls
125 lines (107 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Coverage lanes for the hotpath instrumentation already present in two
# slices:
# * storage, tracedecay-rusqlite-runtime, tracedecay-global-db
# (`slice-tests`)
# * sessions/lcm/capture/temporal-query, tracedecay-sessions,
# tracedecay-session-memory, tracedecay-session-runtime,
# tracedecay-session-temporal-store, tracedecay-lcm, tracedecay-capture,
# tracedecay-temporal-query (`sessions-slice-tests`)
#
# Each job runs two lanes of the same test set:
# 1. feature off. Every `#[hotpath::measure]` macro must stay a no-op;
# 2. `--features <crate>/hotpath`. The `hotpath_coverage` tests wrap a
# real workload in a HotpathGuard and assert the JSON report carries
# the crates' existing measure labels, so the lane fails if the
# measures stop firing.
#
# hotpath stays opt-in: nothing here touches `default` or `production`
# feature sets, and the metrics HTTP server is disabled at the job boundary
# (see .github/workflows/hotpath-profile.yml, which owns the separate
# index-bench profiling lane and is unaffected by this workflow).
name: hotpath-coverage
on:
workflow_dispatch:
permissions:
contents: read
env:
# Hotpath binds a localhost metrics server by default; tests disable it
# themselves before building a guard, and this makes that explicit at the
# job boundary too.
HOTPATH_METRICS_SERVER_OFF: "1"
# rustc writes .rmeta read-only and updates them in place when incremental
# compilation is on. A restored rust-cache blob then fails the compile.
CARGO_INCREMENTAL: "0"
jobs:
slice-tests:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-pnpm
- name: Check rust-cache restore lineage
run: |
python3 scripts/test-rust-cache-lineage.py
python3 scripts/check-rust-cache-lineage.py
# Unique v1-rust shared-key so this job never prefix-restores another
# lane's (or a kache-era v0-rust) compiler tree. rustc writes .rmeta
# read-only; a lockfile-prefix restore of those files fails the compile.
- name: Cache Rust dependency artifacts
id: rust-cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
prefix-key: v1-rust
shared-key: hotpath-coverage-slice
# Vendored-dependency roots: see the debug-cli cache step in ci.yml.
workspaces: |
crates -> ../target
. -> target/rust-cache-lockfile-key
cache-workspace-crates: "false"
cache-on-failure: true
- name: Discard prefix-restored compiler artifacts
run: scripts/drop-prefix-restored-rust-artifacts.sh "${{ steps.rust-cache.outputs.cache-hit }}"
# `test-helpers` only unlocks the registered-store harness the
# coverage test drives; it gates no production code.
- name: Slice tests (hotpath off)
run: |
cargo test -p tracedecay-rusqlite-runtime -p tracedecay-global-db \
--locked --features tracedecay-global-db/test-helpers
- name: Slice tests (hotpath on)
run: |
cargo test -p tracedecay-rusqlite-runtime -p tracedecay-global-db \
--locked --features \
tracedecay-rusqlite-runtime/hotpath,tracedecay-global-db/hotpath,tracedecay-global-db/test-helpers
sessions-slice-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-pnpm
- name: Cache Rust dependency artifacts
id: rust-cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
prefix-key: v1-rust
shared-key: hotpath-coverage-sessions
# Vendored-dependency roots: see the debug-cli cache step in ci.yml.
workspaces: |
crates -> ../target
. -> target/rust-cache-lockfile-key
cache-workspace-crates: "false"
cache-on-failure: true
- name: Discard prefix-restored compiler artifacts
run: scripts/drop-prefix-restored-rust-artifacts.sh "${{ steps.rust-cache.outputs.cache-hit }}"
- name: Sessions slice tests (hotpath off)
run: |
cargo test -p tracedecay-sessions -p tracedecay-session-memory \
-p tracedecay-session-runtime -p tracedecay-session-temporal-store \
-p tracedecay-lcm -p tracedecay-capture -p tracedecay-temporal-query \
--locked
- name: Sessions slice tests (hotpath on)
run: |
cargo test -p tracedecay-sessions -p tracedecay-session-memory \
-p tracedecay-session-runtime -p tracedecay-session-temporal-store \
-p tracedecay-lcm -p tracedecay-capture -p tracedecay-temporal-query \
--locked --features \
tracedecay-sessions/hotpath,tracedecay-session-memory/hotpath,tracedecay-session-runtime/hotpath,tracedecay-session-temporal-store/hotpath,tracedecay-lcm/hotpath,tracedecay-capture/hotpath,tracedecay-temporal-query/hotpath