Skip to content

Commit ecb1b41

Browse files
authored
fix(dev): fixed environment parsing for local IT runs (#23664)
1 parent badeb4a commit ecb1b41

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

scripts/run-integration-test.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Options:
3232
-h Show this help and exit
3333
-r <NUM> Number of retries for the "test" phase (default: 2)
3434
-v Increase verbosity; repeat for more (e.g. -vv or -vvv)
35-
-e <ENV> TEST_ENVIRONMENT to export as TEST_ENVIRONMENT (default: not set)
35+
-e <ENV> One or more environments to run (repeatable or comma-separated).
36+
If provided, these are used as TEST_ENVIRONMENTS instead of auto-discovery.
3637
3738
Notes:
3839
- All existing two-argument invocations remain compatible:
@@ -43,7 +44,8 @@ USAGE
4344

4445
# Parse options
4546
# Note: options must come before positional args (standard getopts behavior)
46-
while getopts ":hr:v:" opt; do
47+
TEST_ENV=""
48+
while getopts ":hr:v:e:" opt; do
4749
case "$opt" in
4850
h)
4951
usage
@@ -59,6 +61,9 @@ while getopts ":hr:v:" opt; do
5961
v)
6062
VERBOSITY+="v"
6163
;;
64+
e)
65+
TEST_ENV="$OPTARG"
66+
;;
6267
\?)
6368
echo "error: unknown option: -$OPTARG" >&2
6469
usage
@@ -95,14 +100,13 @@ case "$TEST_TYPE" in
95100
;;
96101
esac
97102

98-
# Collect all available environments
99-
mapfile -t TEST_ENVIRONMENTS < <(cargo vdev "${VERBOSITY}" "${TEST_TYPE}" show -e "${TEST_NAME}")
100-
101-
if [[ "${ACTIONS_RUNNER_DEBUG:-}" == "true" ]]; then
102-
echo "Environments found: ${#TEST_ENVIRONMENTS[@]}"
103-
for TEST_ENV in "${TEST_ENVIRONMENTS[@]}"; do
104-
echo "${TEST_ENV}"
105-
done
103+
# Determine environments to run
104+
if [[ ${#TEST_ENV} -gt 0 ]]; then
105+
# Use the environments supplied via -e
106+
TEST_ENVIRONMENTS="${TEST_ENV}"
107+
else
108+
# Collect all available environments via auto-discovery
109+
mapfile -t TEST_ENVIRONMENTS < <(cargo vdev "${VERBOSITY}" "${TEST_TYPE}" show -e "${TEST_NAME}")
106110
fi
107111

108112
for TEST_ENV in "${TEST_ENVIRONMENTS[@]}"; do

0 commit comments

Comments
 (0)