-
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (119 loc) · 5.02 KB
/
Copy pathci.yml
File metadata and controls
134 lines (119 loc) · 5.02 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
126
127
128
129
130
131
132
133
134
name: CI — Validate & Package
# ═══════════════════════════════════════════════════════════════════════
# E2E TEST HARNESS GATE — READ BEFORE ENABLING E2E TESTS IN CI
# ═══════════════════════════════════════════════════════════════════════
#
# The E2E tests under tests/e2e/ are DESTRUCTIVE — they delete KV store
# records, mutate config files, clear tamper flags. Every destructive
# helper is gated behind TWO checks:
#
# 1. WL_TEST_HARNESS=1 environment variable
# 2. Container name "wl_manager_test"
#
# If you add an E2E job to this workflow, set WL_TEST_HARNESS=1 INLINE
# on each step that runs a test, NEVER as a job-wide env block:
#
# - name: Run harness gate verification
# run: WL_TEST_HARNESS=1 node tests/e2e/test_harness_gate.cjs
#
# - name: Run cooldown tamper tests
# run: WL_TEST_HARNESS=1 node tests/e2e/test_cooldown_tamper.cjs
#
# DO NOT set WL_TEST_HARNESS=1 under `env:` at workflow or job scope —
# that leaks the variable into unrelated steps and defeats the point
# of the gate.
#
# DO NOT copy this env var to any other repository, `.env` file, or
# shared shell profile.
#
# See tests/e2e/README.md for the full rationale.
# ═══════════════════════════════════════════════════════════════════════
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
validate:
name: Validate App
runs-on: ubuntu-latest
# Per-job permissions (round 7, 2026-04-29). Even though the
# workflow declares `permissions: contents: read` at the top
# level, repeating it per-job means an audit of any single job
# answers "what can this job touch?" without scrolling. It also
# protects against a future workflow-level change (e.g., adding
# `pull-requests: write` for a comment-bot job) silently
# widening every existing job's scope.
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Run validation checks
run: bash scripts/validate.sh
- name: Build .spl package
run: bash scripts/package.sh
- name: Upload .spl artifact
uses: actions/upload-artifact@v4
with:
name: wl_manager-spl
path: dist/*.spl
retention-days: 30
doc-drift:
name: Doc Drift Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Run doc-drift guard
# Same script the pre-commit hook runs locally. Verifies
# file paths in the docs exist + that bare "Build NNN" prose
# stays in sync with default/app.conf. Origin: 2026-04-19
# incident where build numbers drifted across 6 builds
# before the user noticed.
run: bash scripts/pre-commit-doc-drift.sh
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Python dev deps
# Pytest + hypothesis + freezegun. Excludes Playwright (the
# E2E tests are gated by WL_TEST_HARNESS=1 and need a real
# Splunk container — see the gate notice at top of file).
# pytest 9.0.3+ required to close GHSA-6w46-j5rx-g56g
# (round 7 B4, 2026-04-29 pip-audit run).
run: |
python -m pip install --upgrade pip
pip install pytest==9.0.3 pytest-cov==5.0.0 freezegun==1.5.1 \
hypothesis==6.90.0 pytest-timeout==2.1.0
- name: Run unit tests
# The unit suite mocks Splunk REST + filesystem layers; no
# Splunk container required. ~7s for 539 tests locally.
run: python -m pytest tests/unit/ -q --tb=short
- name: Run module-level tests
# Top-level tests/test_*.py files cover lower-layer modules
# (wl_limits, wl_hmac_key, wl_fim_common, wl_expiration_cleanup)
# with HMAC and period-boundary coverage that tests/unit/ does
# not duplicate. Note: a former tests/test_wl_filelock.py
# reference was removed during round 7 B4 — no such file
# exists; the filelock paths are exercised inside
# tests/unit/test_filelock.py.
run: |
python -m pytest tests/test_wl_limits.py \
tests/test_wl_hmac_key.py \
tests/test_wl_fim_common.py \
tests/test_wl_expiration_cleanup.py \
-q --tb=short