Skip to content

Commit 1a21699

Browse files
committed
fix(build-tests): --image CLI flag wins over fixture INTEGRATION_IMAGE
Rabbit-flagged: the fixture source step (`source inputs.env`) unconditionally clobbered the parsed CLI --image value with the fixture's INTEGRATION_IMAGE, so the advertised flag was effectively ignored whenever a fixture set the env var. Track whether --image came from the CLI; let the fixture value override only when the flag was not passed. Lets callers A/B-test a scenario against a different image (e.g., to bisect a flex tag regression) without editing the fixture. Refs: openemr#146 (issue), openemr#148 (this PR) Assisted-by: Claude Code
1 parent 0d8ad98 commit 1a21699

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tools/build-tests/integration/run-scenario.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ SCENARIO=""
3737
# (Alpine 3.22 / PHP 8.2). Per-fixture inputs.env may override via
3838
# INTEGRATION_IMAGE.
3939
IMAGE="openemr/openemr:flex-3.22-php-8.2"
40+
IMAGE_FROM_CLI=0 # set when --image is passed; takes precedence over inputs.env
4041
TIMEOUT_SECONDS=900 # 15 min ceiling for composer + npm + mariadb populate
4142
UPDATE_GOLDENS="${UPDATE_GOLDENS:-0}"
4243

4344
while [[ $# -gt 0 ]]; do
4445
case "$1" in
45-
--image) IMAGE="$2"; shift 2 ;;
46+
--image) IMAGE="$2"; IMAGE_FROM_CLI=1; shift 2 ;;
4647
--timeout) TIMEOUT_SECONDS="$2"; shift 2 ;;
4748
--*) echo "Unknown flag: $1" >&2; exit 2 ;;
4849
*)
@@ -121,7 +122,10 @@ if [[ -z "$DOCKERDEMO" ]]; then
121122
echo "FAIL: $FIXTURE_DIR/inputs.env must set DOCKERDEMO" >&2
122123
exit 1
123124
fi
124-
if [[ -n "$INTEGRATION_IMAGE" ]]; then
125+
if [[ -n "$INTEGRATION_IMAGE" && "$IMAGE_FROM_CLI" -eq 0 ]]; then
126+
# Fixture override only applies when --image wasn't explicitly passed;
127+
# CLI wins so callers can A/B-test against a different image without
128+
# editing the fixture.
125129
IMAGE="$INTEGRATION_IMAGE"
126130
fi
127131

0 commit comments

Comments
 (0)