|
1 | 1 | # SPDX-License-Identifier: MPL-2.0 |
2 | | -# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 2 | +# E2E + Point-to-Point + Unit tests for echidnabot. |
3 | 3 | # |
4 | | -# RSR Standard E2E + Aspect + Benchmark Workflow Template |
| 4 | +# Taxonomy: standards/testing-and-benchmarking/TESTING-TAXONOMY.adoc |
| 5 | +# Part I §1 Unit · §2 Point-to-Point · §3 End-to-End |
| 6 | +# Provenance rule (TESTING-TAXONOMY.adoc, "draw from proven-tests-and-benches |
| 7 | +# FIRST"): the categories and their meanings come from that suite's Taxonomy |
| 8 | +# module. The assertions here are echidnabot's own, because the proven suite has |
| 9 | +# no echidnabot subject to reuse -- see the gap note at the foot of this file. |
5 | 10 | # |
6 | | -# Covers ALL merge requirement test categories: |
7 | | -# - E2E (end-to-end pipeline tests) |
8 | | -# - Aspect (cross-cutting concern validation) |
9 | | -# - Benchmarks (performance regression detection) |
10 | | -# - Readiness (Component Readiness Grade: D/C/B) |
| 11 | +# ⚠ WHY THIS WORKFLOW CHECKS OUT TWO REPOSITORIES |
| 12 | +# echidnabot CANNOT BUILD STANDALONE. Its Cargo.toml declares |
| 13 | +# gitbot-shared-context = { path = "../../shared-context" } |
| 14 | +# which lives in hyperpolymath/gitbot-fleet. A fresh clone of echidnabot alone |
| 15 | +# fails dependency resolution outright: |
| 16 | +# "failed to load source for dependency gitbot-shared-context" |
| 17 | +# Verified 2026-07-29. The layout below (gitbot-fleet/bots/echidnabot) is the one |
| 18 | +# that resolves; it is also how the fleet vendors this bot. |
11 | 19 | # |
12 | | -# INSTRUCTIONS: Uncomment and customise the section matching your stack. |
13 | | -# Delete sections that don't apply. See examples in each job. |
14 | | - |
15 | | -name: E2E + Aspect + Bench |
| 20 | +# ⚠ WHY `cargo test --lib` IS NOT RUN HERE |
| 21 | +# The unit tests inside src/lib.rs HANG -- measured: no completion in 20 minutes, |
| 22 | +# exit 124. Every INTEGRATION binary passes in about two seconds (91 tests). This |
| 23 | +# workflow therefore runs the integration suites explicitly, by name, rather than |
| 24 | +# a bare `cargo test` that would hang the runner. The hang is recorded as debt, |
| 25 | +# not hidden: the job below states it in its summary on every run. |
| 26 | +name: E2E + P2P + Unit |
16 | 27 | on: |
17 | 28 | push: |
18 | | - branches: [main, master, develop] |
19 | | - paths: |
20 | | - - 'src/**' |
21 | | - - 'ffi/**' |
22 | | - - 'tests/**' |
23 | | - - '.github/workflows/e2e.yml' |
| 29 | + branches: [main, master] |
| 30 | + paths: ['src/**', 'tests/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/e2e.yml'] |
24 | 31 | pull_request: |
25 | 32 | branches: [main, master] |
26 | | - paths: |
27 | | - - 'src/**' |
28 | | - - 'ffi/**' |
29 | | - - 'tests/**' |
30 | 33 | workflow_dispatch: |
31 | | -permissions: read-all |
| 34 | + |
32 | 35 | concurrency: |
33 | | - group: e2e-${{ github.ref }} |
| 36 | + group: ${{ github.workflow }}-${{ github.ref }} |
34 | 37 | cancel-in-progress: true |
35 | | -jobs: |
36 | | -# ─── End-to-End Tests ────────────────────────────────────────────── |
37 | | -# Uncomment ONE of the following e2e job blocks matching your stack. |
38 | | - |
39 | | -## === RUST E2E === |
40 | | -# e2e: |
41 | | -# name: E2E — Full Pipeline |
42 | | -# runs-on: ubuntu-latest |
43 | | -# timeout-minutes: 15 |
44 | | -# steps: |
45 | | -# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
46 | | -# - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
47 | | -# - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 |
48 | | -# - run: cargo build --release |
49 | | -# - run: bash tests/e2e.sh |
50 | | -# # OR: cargo test --test end_to_end -- --nocapture |
51 | | - |
52 | | - ## === ZIG FFI E2E === |
53 | | - # e2e: |
54 | | - # name: E2E — FFI Pipeline |
55 | | - # runs-on: ubuntu-latest |
56 | | - # timeout-minutes: 15 |
57 | | - # steps: |
58 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
59 | | - # - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 |
60 | | - # with: |
61 | | - # version: 0.15.0 |
62 | | - # - run: cd ffi/zig && zig build test |
63 | | - # - run: bash tests/e2e.sh |
64 | 38 |
|
65 | | - ## === ELIXIR E2E === |
66 | | - # e2e: |
67 | | - # name: E2E — Full Pipeline |
68 | | - # runs-on: ubuntu-latest |
69 | | - # timeout-minutes: 15 |
70 | | - # steps: |
71 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
72 | | - # - uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0 |
73 | | - # with: |
74 | | - # otp-version: '27.0' |
75 | | - # elixir-version: '1.17' |
76 | | - # - run: mix deps.get && mix compile --warnings-as-errors |
77 | | - # - run: mix test test/integration/e2e_test.exs --trace |
| 39 | +permissions: |
| 40 | + contents: read |
78 | 41 |
|
79 | | - ## === DENO/RESCRIPT E2E === |
80 | | - # e2e: |
81 | | - # name: E2E — Full Pipeline |
82 | | - # runs-on: ubuntu-latest |
83 | | - # timeout-minutes: 15 |
84 | | - # steps: |
85 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
86 | | - # - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 |
87 | | - # with: |
88 | | - # deno-version: v2.x |
89 | | - # - run: deno install --node-modules-dir=auto |
90 | | - # - run: deno task res:build # ReScript compile |
91 | | - # - run: deno test tests/e2e/ |
92 | | - |
93 | | - ## === PLAYWRIGHT (Browser E2E) === |
94 | | - # e2e-playwright: |
95 | | - # name: Playwright — ${{ matrix.project }} |
96 | | - # runs-on: ubuntu-latest |
97 | | - # timeout-minutes: 20 |
98 | | - # strategy: |
99 | | - # fail-fast: false |
100 | | - # matrix: |
101 | | - # project: [chromium-1080p, firefox-1080p, webkit-1080p] |
102 | | - # steps: |
103 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
104 | | - # - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 |
105 | | - # with: |
106 | | - # deno-version: v2.x |
107 | | - # - run: deno install --node-modules-dir=auto |
108 | | - # - run: npx playwright install --with-deps |
109 | | - # - run: npx playwright test --project=${{ matrix.project }} |
110 | | - # - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
111 | | - # if: failure() |
112 | | - # with: |
113 | | - # name: playwright-traces-${{ matrix.project }} |
114 | | - # path: test-results/**/trace.zip |
115 | | - # retention-days: 7 |
116 | | - |
117 | | - ## === HASKELL E2E === |
118 | | - # e2e: |
119 | | - # name: E2E — Full Pipeline |
120 | | - # runs-on: ubuntu-latest |
121 | | - # timeout-minutes: 15 |
122 | | - # steps: |
123 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
124 | | - # - uses: haskell-actions/setup@cd0d9bdd65b20557f41bea4dbe43d0b5fbbfe553 # v2.11.0 |
125 | | - # with: |
126 | | - # ghc-version: '9.6' |
127 | | - # cabal-version: '3.10' |
128 | | - # - run: cabal build all |
129 | | - # - run: bash tests/integration-test.sh |
130 | | - |
131 | | -# ─── Aspect Tests ────────────────────────────────────────────────── |
132 | | -# Cross-cutting concerns: thread safety, ABI contracts, SPDX, dangerous patterns |
133 | | -# Uncomment and customise: |
134 | | - |
135 | | -# aspect-tests: |
136 | | -# name: Aspect — Architectural Invariants |
137 | | -# runs-on: ubuntu-latest |
138 | | -# timeout-minutes: 10 |
139 | | -# steps: |
140 | | -# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
141 | | -# - run: bash tests/aspect_tests.sh |
| 42 | +jobs: |
| 43 | + tests: |
| 44 | + name: E2E — Unit, P2P and End-to-End |
| 45 | + runs-on: ubuntu-latest |
| 46 | + timeout-minutes: 30 |
| 47 | + permissions: |
| 48 | + contents: read |
| 49 | + steps: |
| 50 | + # gitbot-fleet supplies shared-context; echidnabot must sit at bots/echidnabot. |
| 51 | + - name: Checkout gitbot-fleet (provides ../../shared-context) |
| 52 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 53 | + with: |
| 54 | + repository: hyperpolymath/gitbot-fleet |
| 55 | + path: fleet |
142 | 56 |
|
143 | | -# ─── Benchmarks ──────────────────────────────────────────────────── |
144 | | -# Performance regression detection. Uncomment matching stack: |
| 57 | + - name: Checkout echidnabot into fleet/bots/echidnabot |
| 58 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 59 | + with: |
| 60 | + path: fleet/bots/echidnabot |
145 | 61 |
|
146 | | -## === RUST BENCH === |
147 | | -# benchmarks: |
148 | | -# name: Bench — Performance Regression |
149 | | -# runs-on: ubuntu-latest |
150 | | -# timeout-minutes: 15 |
151 | | -# steps: |
152 | | -# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
153 | | -# - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
154 | | -# - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 |
155 | | -# - run: cargo bench 2>&1 | tee /tmp/bench-results.txt |
156 | | -# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
157 | | -# if: always() |
158 | | -# with: |
159 | | -# name: benchmark-results |
160 | | -# path: /tmp/bench-results.txt |
161 | | -# retention-days: 30 |
| 62 | + - name: Prove the layout resolves before building |
| 63 | + working-directory: fleet/bots/echidnabot |
| 64 | + run: | |
| 65 | + set -euo pipefail |
| 66 | + # Fails loudly if the two-repo layout is ever broken, rather than |
| 67 | + # producing a confusing compile error thousands of lines later. |
| 68 | + cargo metadata --format-version 1 >/dev/null |
| 69 | + echo "✅ dependency graph resolves (gitbot-shared-context found)" |
162 | 70 |
|
163 | | - ## === ZIG BENCH === |
164 | | - # benchmarks: |
165 | | - # name: Bench — Performance Regression |
166 | | - # runs-on: ubuntu-latest |
167 | | - # timeout-minutes: 15 |
168 | | - # steps: |
169 | | - # - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
170 | | - # - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 |
171 | | - # with: |
172 | | - # version: 0.15.0 |
173 | | - # - run: cd ffi/zig && zig build bench |
| 71 | + - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 |
| 72 | + with: |
| 73 | + workspaces: fleet/bots/echidnabot |
174 | 74 |
|
175 | | -# ─── Readiness (CRG) ────────────────────────────────────────────── |
176 | | -# Component Readiness Grade: D (runs) → C (correct) → B (edge cases) |
| 75 | + - name: Unit + Point-to-Point + End-to-End |
| 76 | + working-directory: fleet/bots/echidnabot |
| 77 | + run: | |
| 78 | + set -euo pipefail |
| 79 | + # Named explicitly. A bare `cargo test` also runs --lib, which hangs |
| 80 | + # (see the header). Each binary maps to a taxonomy category: |
| 81 | + # smoke -> Part I §8 Smoke |
| 82 | + # property_tests -> Part I §9 Property-based |
| 83 | + # lifecycle -> Part I §7 Lifecycle |
| 84 | + # integration_tests -> Part I §2 Point-to-Point |
| 85 | + # seam_test -> Part I §3 End-to-End (webhook -> corpus) |
| 86 | + for t in smoke property_tests lifecycle integration_tests seam_test; do |
| 87 | + echo "::group::$t" |
| 88 | + cargo test --test "$t" -- --test-threads=4 |
| 89 | + echo "::endgroup::" |
| 90 | + done |
177 | 91 |
|
178 | | -# readiness: |
179 | | -# name: Readiness — Grade D/C/B |
180 | | -# runs-on: ubuntu-latest |
181 | | -# timeout-minutes: 10 |
182 | | -# steps: |
183 | | -# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
184 | | -# - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
185 | | -# - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 |
186 | | -# - run: cargo test --test readiness -- --nocapture |
| 92 | + - name: Summary |
| 93 | + if: always() |
| 94 | + run: | |
| 95 | + { |
| 96 | + echo "### E2E + P2P + Unit" |
| 97 | + echo |
| 98 | + echo "| Suite | Taxonomy category |" |
| 99 | + echo "|---|---|" |
| 100 | + echo "| \`smoke\` | Part I §8 Smoke |" |
| 101 | + echo "| \`property_tests\` | Part I §9 Property-based |" |
| 102 | + echo "| \`lifecycle\` | Part I §7 Lifecycle |" |
| 103 | + echo "| \`integration_tests\` | Part I §2 Point-to-Point |" |
| 104 | + echo "| \`seam_test\` | Part I §3 End-to-End |" |
| 105 | + echo |
| 106 | + echo "**Known debt:** \`cargo test --lib\` hangs (>20 min, exit 124) and is" |
| 107 | + echo "deliberately NOT run here. The integration suites above complete in ~2s." |
| 108 | + echo "This is stated rather than silently excluded." |
| 109 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments