Skip to content

Commit 93ea354

Browse files
committed
Conditionally source setup-secrets.sh from run-tests.sh
1 parent 0899bfd commit 93ea354

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

.evergreen/config/functions.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,6 @@ functions:
222222
${PREPARE_SHELL}
223223
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
224224
225-
"run atlas connectivity tests":
226-
- command: shell.exec
227-
type: test
228-
params:
229-
working_dir: "src"
230-
shell: bash
231-
script: |
232-
${PREPARE_SHELL}
233-
. ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect
234-
TESTS="tests/atlas.phpt" \
235-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
236-
237225
"cleanup":
238226
- command: shell.exec
239227
params:

.evergreen/config/test-tasks.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ tasks:
22
- name: "test-atlas-connectivity"
33
tags: ["atlas", "nodb"]
44
commands:
5-
- func: "run atlas connectivity tests"
5+
# This creates secrets-export.sh, which is later sourced by run-tests.sh
6+
- command: shell.exec
7+
params:
8+
working_dir: "src"
9+
script: |
10+
bash ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect
11+
- func: "run tests"
12+
vars:
13+
TESTS: "tests/atlas.phpt"
614

715
# Test different storage engines
816
- name: "test-mongodb-4.0-standalone-inmemory"

.evergreen/run-tests.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ else
3939
echo "crypt_shared library will be loaded from path: $CRYPT_SHARED_LIB_PATH"
4040
fi
4141

42+
# Conditionally source setup-secrets.sh created by drivers-evergreen-tools
43+
if [ -f "${PROJECT_DIRECTORY}/secrets-export.sh" ]; then
44+
source ${PROJECT_DIRECTORY}/secrets-export.sh
45+
fi
46+
4247
echo "Running tests with URI: $MONGODB_URI"
4348

4449
# Run the tests, and store the results in a junit result file

0 commit comments

Comments
 (0)