Skip to content

Commit 6812815

Browse files
authored
Fix issue when replacing arguments with circleci env subst (#105)
* Extra test with args * Add debug to new test * Fix shell * Add shell to executor * update the way the subst is done on scripts * Do the substitution in a more explicit way * remove debug
1 parent 8b947a4 commit 6812815

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.circleci/test-deploy.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ jobs:
130130
tag:
131131
type: string
132132
description: "Android machine image tag to use."
133+
args:
134+
type: string
135+
default: ""
136+
description: Additional args to pass to avd creation
133137
executor:
134138
name: android/android_machine
135139
tag: << parameters.tag >>
@@ -148,6 +152,7 @@ jobs:
148152
- android/restore_build_cache
149153
- run: cd compose-samples/Jetchat && ./gradlew assembleDebugAndroidTest
150154
post_emulator_launch_assemble_command: ""
155+
additional_avd_args: <<parameters.args>>
151156
run_tests_working_directory: ./compose-samples/Jetchat
152157
post_run_tests_steps:
153158
- android/save_build_cache
@@ -272,7 +277,13 @@ workflows:
272277
# tag: "default"
273278
# filters: *filters
274279
- test_start_emulator_and_run_tests:
280+
name: test_start_emulator_and_run_tests
281+
tag: "default"
282+
filters: *filters
283+
- test_start_emulator_and_run_tests:
284+
name: test_start_emulator_and_run_tests-with-args
275285
tag: "default"
286+
args: -d pixel_6
276287
filters: *filters
277288
- test-fastlane
278289
- orb-tools/pack:

src/scripts/create_avd.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
2-
PARAM_AVD_NAME="$(circleci env subst "$PARAM_AVD_NAME")"
3-
PARAM_SYSTEM_IMAGE="$(circleci env subst "$PARAM_SYSTEM_IMAGE")"
4-
PARAM_ADDITIONAL_ARGS="$(circleci env subst "$PARAM_ADDITIONAL_ARGS")"
2+
PARAM_AVD_NAME="$(echo "$PARAM_AVD_NAME" | circleci env subst "$PARAM_AVD_NAME")"
3+
PARAM_SYSTEM_IMAGE="$(echo "$PARAM_SYSTEM_IMAGE" | circleci env subst "$PARAM_SYSTEM_IMAGE")"
4+
PARAM_ADDITIONAL_ARGS="$(circleci env subst -- "$PARAM_ADDITIONAL_ARGS")"
55

66
if [ "${PARAM_INSTALL}" == 1 ]; then
77
sdkmanager "${PARAM_SYSTEM_IMAGE}"

src/scripts/run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
PARAM_PRE_TEST_COMMAND="$(circleci env subst "$PARAM_PRE_TEST_COMMAND")"
3-
PARAM_TEST_COMMAND="$(circleci env subst "$PARAM_TEST_COMMAND")"
2+
PARAM_PRE_TEST_COMMAND="$(echo "$PARAM_PRE_TEST_COMMAND" | circleci env subst "$PARAM_PRE_TEST_COMMAND")"
3+
PARAM_TEST_COMMAND="$(echo "$PARAM_TEST_COMMAND" | circleci env subst "$PARAM_TEST_COMMAND")"
44

55
run_with_retry() {
66
MAX_TRIES=${PARAM_MAX_TRIES}

0 commit comments

Comments
 (0)