| index b1aa2e3..645666a 100644 | ||
| --- a/Makefile | ||
| +++ b/Makefile | ||
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | # make fortify -D_FORTIFY_SOURCE=2 -> ./plugin_webhook-fortify |
| 23 | 23 | # make ui regenerate src/ui_html.h from src/ui.html |
| 24 | 24 | # make test build + run tests/run.sh |
| 25 | -# make e2e build + run tests/e2e.py (Playwright) | |
| 25 | +# make e2e build + run tests/e2e.py --shots (Playwright, refreshes docs/) | |
| 26 | 26 | # make clean |
| 27 | 27 | |
| 28 | 28 | CC ?= cc |
| @@ -89,7 +89,7 @@ test: native | ||
| 89 | 89 | @bash tests/run.sh |
| 90 | 90 | |
| 91 | 91 | e2e: native |
| 92 | - @python3 tests/e2e.py | |
| 92 | + @python3 tests/e2e.py --shots | |
| 93 | 93 | |
| 94 | 94 | clean: |
| 95 | 95 | rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN)-asan $(BIN)-fortify |
| index 69b4507..068c4db 100755 | ||
| --- a/tests/e2e.py | ||
| +++ b/tests/e2e.py | ||
| @@ -19,7 +19,14 @@ themes and asserts: | ||
| 19 | 19 | Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays |
| 20 | 20 | dependency-free. |
| 21 | 21 | |
| 22 | +Screenshots are written to a temp directory by default and only refreshed in | |
| 23 | +docs/ when --shots is passed (`make e2e`). The PNGs carry the live times of the | |
| 24 | +deliveries the run fires, so regenerating them on every gate run would leave two | |
| 25 | +tracked files dirty and make a history audit that refuses a dirty tree report a | |
| 26 | +violation against an unrelated commit. | |
| 27 | + | |
| 22 | 28 | python3 tests/e2e.py # run if Playwright is available |
| 29 | + python3 tests/e2e.py --shots # also refresh docs/ui-*.png (commit them) | |
| 23 | 30 | python3 tests/e2e.py --strict # exit 2 when Playwright is missing |
| 24 | 31 | """ |
| 25 | 32 | |
| @@ -176,6 +183,8 @@ def record_count(): | ||
| 176 | 183 | def main(): |
| 177 | 184 | ap = argparse.ArgumentParser() |
| 178 | 185 | ap.add_argument("--strict", action="store_true") |
| 186 | + ap.add_argument("--shots", action="store_true", | |
| 187 | + help="refresh docs/ui-*.png (they are committed artefacts)") | |
| 179 | 188 | args = ap.parse_args() |
| 180 | 189 | |
| 181 | 190 | try: |
| @@ -188,6 +197,9 @@ def main(): | ||
| 188 | 197 | bad("plugin_webhook binary is missing (run make first)") |
| 189 | 198 | return 1 |
| 190 | 199 | |
| 200 | + global DOCS | |
| 201 | + if not args.shots: | |
| 202 | + DOCS = tempfile.mkdtemp(prefix="webhook-shots-") | |
| 191 | 203 | os.makedirs(DOCS, exist_ok=True) |
| 192 | 204 | start_recorder() |
| 193 | 205 | seed() |
| 194 | 206 |
| index b1aa2e3..645666a 100644 | index b1aa2e3..645666a 100644 | ||
| --- a/Makefile | --- a/Makefile | ||
| +++ b/Makefile | +++ b/Makefile | ||
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | # make fortify -D_FORTIFY_SOURCE=2 -> ./plugin_webhook-fortify | 22 | # make fortify -D_FORTIFY_SOURCE=2 -> ./plugin_webhook-fortify |
| 23 | # make ui regenerate src/ui_html.h from src/ui.html | 23 | # make ui regenerate src/ui_html.h from src/ui.html |
| 24 | # make test build + run tests/run.sh | 24 | # make test build + run tests/run.sh |
| 25 | -# make e2e build + run tests/e2e.py (Playwright) | 25 | +# make e2e build + run tests/e2e.py --shots (Playwright, refreshes docs/) |
| 26 | # make clean | 26 | # make clean |
| 27 | 27 | ||
| 28 | CC ?= cc | 28 | CC ?= cc |
| @@ -89,7 +89,7 @@ test: native | @@ -89,7 +89,7 @@ test: native | ||
| 89 | @bash tests/run.sh | 89 | @bash tests/run.sh |
| 90 | 90 | ||
| 91 | e2e: native | 91 | e2e: native |
| 92 | - @python3 tests/e2e.py | 92 | + @python3 tests/e2e.py --shots |
| 93 | 93 | ||
| 94 | clean: | 94 | clean: |
| 95 | rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN)-asan $(BIN)-fortify | 95 | rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN)-asan $(BIN)-fortify |
| index 69b4507..068c4db 100755 | index 69b4507..068c4db 100755 | ||
| --- a/tests/e2e.py | --- a/tests/e2e.py | ||
| +++ b/tests/e2e.py | +++ b/tests/e2e.py | ||
| @@ -19,7 +19,14 @@ themes and asserts: | @@ -19,7 +19,14 @@ themes and asserts: | ||
| 19 | Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays | 19 | Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays |
| 20 | dependency-free. | 20 | dependency-free. |
| 21 | 21 | ||
| 22 | +Screenshots are written to a temp directory by default and only refreshed in | ||
| 23 | +docs/ when --shots is passed (`make e2e`). The PNGs carry the live times of the | ||
| 24 | +deliveries the run fires, so regenerating them on every gate run would leave two | ||
| 25 | +tracked files dirty and make a history audit that refuses a dirty tree report a | ||
| 26 | +violation against an unrelated commit. | ||
| 27 | + | ||
| 22 | python3 tests/e2e.py # run if Playwright is available | 28 | python3 tests/e2e.py # run if Playwright is available |
| 29 | + python3 tests/e2e.py --shots # also refresh docs/ui-*.png (commit them) | ||
| 23 | python3 tests/e2e.py --strict # exit 2 when Playwright is missing | 30 | python3 tests/e2e.py --strict # exit 2 when Playwright is missing |
| 24 | """ | 31 | """ |
| 25 | 32 | ||
| @@ -176,6 +183,8 @@ def record_count(): | @@ -176,6 +183,8 @@ def record_count(): | ||
| 176 | def main(): | 183 | def main(): |
| 177 | ap = argparse.ArgumentParser() | 184 | ap = argparse.ArgumentParser() |
| 178 | ap.add_argument("--strict", action="store_true") | 185 | ap.add_argument("--strict", action="store_true") |
| 186 | + ap.add_argument("--shots", action="store_true", | ||
| 187 | + help="refresh docs/ui-*.png (they are committed artefacts)") | ||
| 179 | args = ap.parse_args() | 188 | args = ap.parse_args() |
| 180 | 189 | ||
| 181 | try: | 190 | try: |
| @@ -188,6 +197,9 @@ def main(): | @@ -188,6 +197,9 @@ def main(): | ||
| 188 | bad("plugin_webhook binary is missing (run make first)") | 197 | bad("plugin_webhook binary is missing (run make first)") |
| 189 | return 1 | 198 | return 1 |
| 190 | 199 | ||
| 200 | + global DOCS | ||
| 201 | + if not args.shots: | ||
| 202 | + DOCS = tempfile.mkdtemp(prefix="webhook-shots-") | ||
| 191 | os.makedirs(DOCS, exist_ok=True) | 203 | os.makedirs(DOCS, exist_ok=True) |
| 192 | start_recorder() | 204 | start_recorder() |
| 193 | seed() | 205 | seed() |
| 194 | 206 |