Compare commits

...

6 Commits

3 changed files with 15 additions and 7 deletions
+9 -5
View File
@@ -1,22 +1,26 @@
# Task 06G4GWWJ8SWFREF06HDYEBAG0C
# Task 06G4M6HF1Z3EREX1X3NEKSHP24
Route the healthcheck output through one helper
Name the healthcheck success message once
- Project: test-e2e
- Source: gitea:test-e2e/15
- Source: burnin/run14-a
- Priority: 0
## Instructions
`scripts/orchestra_e2e_healthcheck.sh` prints its success line from more than one place. Centralise the output so every path goes through one helper, and give that helper an explicit format argument rather than reading a global.
scripts/orchestra_e2e_healthcheck.sh spells its success message inline. Give it a single named constant beside the existing VERSION constant and use that constant everywhere the message is printed.
Behaviour must not change. The plain run, `--quiet`, `--help` and `--json` all keep their current output and exit statuses, and `scripts/test_healthcheck.sh` keeps passing.
Behaviour must not change. The plain run, --quiet and --help keep their current output and exit statuses, and scripts/test_healthcheck.sh keeps passing.
## Research first
Establish at least three findings with distinct confidence: at least one `fact`, one `inference`, one `assumption`.
## Quality gate
bash -n scripts/*.sh && bash scripts/orchestra_e2e_healthcheck.sh
## Completion
Run the configured quality gate. When the task is ready for the worker to verify and deliver, create `.orchestra/done`. Do not write a prose completion report.
+5 -1
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
readonly VERSION=1.0.0
readonly SUCCESS_MESSAGE='OK - all healthchecks passed'
# emit <format> <template> [args...]: the single output path.
# format: text or json print; none suppresses (--quiet). Explicit argument,
# never read from an enclosing variable.
@@ -18,6 +21,7 @@ main() {
emit text 'Healthcheck script for Orchestra E2E tests.\n'
emit text 'Exits 0 with a success message if all checks pass.\n'
emit text ' --quiet Suppress the success message; still exits 0.\n'
emit text 'Version: %s\n' "$VERSION"
exit 0
elif [ "$arg" = --quiet ]; then
quiet=1
@@ -35,7 +39,7 @@ main() {
exit 0
fi
emit "$format" 'OK - all healthchecks passed\n'
emit "$format" '%s\n' "$SUCCESS_MESSAGE"
exit 0
}
+1 -1
View File
@@ -3,7 +3,7 @@
HC="$(dirname "$0")/orchestra_e2e_healthcheck.sh"
OK='OK - all healthchecks passed'
USAGE="$(printf 'Usage: orchestra_e2e_healthcheck.sh [--quiet]\n\nHealthcheck script for Orchestra E2E tests.\nExits 0 with a success message if all checks pass.\n --quiet Suppress the success message; still exits 0.')"
USAGE="$(printf 'Usage: orchestra_e2e_healthcheck.sh [--quiet]\n\nHealthcheck script for Orchestra E2E tests.\nExits 0 with a success message if all checks pass.\n --quiet Suppress the success message; still exits 0.\nVersion: 1.0.0')"
fails=0
check() { # check <expected-stdout> <label> [args...]