Skip to content

Commit 374e5a7

Browse files
author
Danilo Morães
committed
test: --image without args runs on latest rc image
1 parent 8b87c96 commit 374e5a7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ee/packages/federation-matrix/tests/scripts/run-integration-tests.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RC1_CONTAINER="rc1"
2424

2525
# Build configuration
2626
# Use a temporary directory outside the repo to avoid symlink traversal issues during Meteor build
27-
BUILD_DIR="$(mktemp -d "${FEDERATION_TEST_TMPDIR:-/tmp}/rc-federation-build.XXXXXX")"
27+
BUILD_DIR="$(mktemp -d "${FEDERATION_TEST_TMPDIR:-/tmp}/rc-federation-build")"
2828
ROCKETCHAT_ROOT="$(cd "$PACKAGE_ROOT/../../.." && pwd)" # Go up to project root
2929

3030
# Parse command line arguments
@@ -47,19 +47,26 @@ while [[ $# -gt 0 ]]; do
4747
;;
4848
--image)
4949
USE_PREBUILT_IMAGE=true
50-
PREBUILT_IMAGE="$2"
51-
shift 2
50+
# If no IMAGE value is provided (or next token is another flag), default to latest
51+
if [[ -z "${2:-}" || "$2" == -* ]]; then
52+
PREBUILT_IMAGE="rocketchat/rocket.chat:latest"
53+
shift 1
54+
else
55+
PREBUILT_IMAGE="$2"
56+
shift 2
57+
fi
5258
;;
5359
--help|-h)
5460
echo "Usage: $0 [OPTIONS]"
5561
echo "Options:"
5662
echo " --keep-running Keep Docker containers running after tests complete"
5763
echo " --element Include Element web client in the test environment"
58-
echo " --image IMAGE Use a pre-built Docker image instead of building locally"
64+
echo " --image [IMAGE] Use a pre-built Docker image instead of building locally"
5965
echo " --help, -h Show this help message"
6066
echo ""
6167
echo "By default, builds Rocket.Chat locally and runs the 'test' profile"
6268
echo "Use --image to test against a pre-built image (e.g., --image rocketchat/rocket.chat:latest)"
69+
echo "If --image is provided without a value, defaults to rocketchat/rocket.chat:latest"
6370
echo "Use --element to run all services including Element web client"
6471
exit 0
6572
;;

0 commit comments

Comments
 (0)