Skip to content

Commit 3ef0084

Browse files
committed
Add run-with-env.sh
1 parent 7bda294 commit 3ef0084

18 files changed

+38
-32
lines changed

.evergreen/config.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ functions:
228228
params:
229229
binary: bash
230230
args:
231+
- src/.evergreen/scripts/run-with-env.sh
231232
- src/.evergreen/scripts/bootstrap-mongo-orchestration.sh
232233
- command: expansions.update
233234
params:
@@ -267,6 +268,7 @@ functions:
267268
working_dir: "src"
268269
binary: bash
269270
args:
271+
- .evergreen/scripts/run-with-env.sh
270272
- .evergreen/scripts/run-mod-wsgi-tests.sh
271273

272274
"run mockupdb tests":
@@ -276,6 +278,7 @@ functions:
276278
working_dir: "src"
277279
binary: bash
278280
args:
281+
- .evergreen/scripts/run-with-env.sh
279282
- .evergreen/scripts/run-mockupdb-tests.sh
280283

281284
"run doctests":
@@ -285,6 +288,7 @@ functions:
285288
working_dir: "src"
286289
binary: bash
287290
args:
291+
- .evergreen/scripts/run-with-env.sh
288292
- .evergreen/scripts/run-doctests.sh
289293

290294
"run tests":
@@ -295,13 +299,15 @@ functions:
295299
background: true
296300
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
297301
args:
302+
- .evergreen/scripts/run-with-env.sh
298303
- .evergreen/scripts/setup-encryption.sh
299304
- command: subprocess.exec
300305
params:
301306
working_dir: "src"
302307
binary: bash
303308
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
304309
args:
310+
- .evergreen/scripts/run-with-env.sh
305311
- .evergreen/scripts/run-tests.sh
306312

307313
"run enterprise auth tests":
@@ -312,14 +318,15 @@ functions:
312318
working_dir: "src"
313319
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
314320
args:
321+
- .evergreen/scripts/run-with-env.sh
315322
- .evergreen/scripts/run-enterprise-auth-tests.sh
316323

317324
"run atlas tests":
318325
- command: subprocess.exec
319326
type: test
320327
params:
321328
binary: bash
322-
include_expansions_in_env: ["PYTHON_BINARY", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
329+
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
323330
working_dir: "src"
324331
args:
325332
- .evergreen/scripts/run-with-env.sh
@@ -338,10 +345,11 @@ functions:
338345
- command: subprocess.exec
339346
type: test
340347
params:
341-
include_expansions_in_env: ["DRIVERS_TOOLS", "PYTHON_BINARY", "skip_EC2_auth_test"]
348+
include_expansions_in_env: ["DRIVERS_TOOLS", "skip_EC2_auth_test"]
342349
binary: bash
343350
working_dir: "src"
344351
args:
352+
- .evergreen/scripts/run-with-env.sh
345353
- .evergreen/scripts/run-mongodb-aws-test.sh
346354
- regular
347355

@@ -353,6 +361,7 @@ functions:
353361
binary: bash
354362
working_dir: "src"
355363
args:
364+
- .evergreen/scripts/run-with-env.sh
356365
- .evergreen/scripts/run-mongodb-aws-test.sh
357366
- assume-role
358367

@@ -364,6 +373,7 @@ functions:
364373
binary: bash
365374
working_dir: "src"
366375
args:
376+
- .evergreen/scripts/run-with-env.sh
367377
- .evergreen/scripts/run-mongodb-aws-test.sh
368378
- ec2
369379

@@ -376,6 +386,7 @@ functions:
376386
binary: bash
377387
working_dir: "src"
378388
args:
389+
- .evergreen/scripts/run-with-env.sh
379390
- .evergreen/scripts/run-mongodb-aws-test.sh
380391
- web-identity
381392
- command: subprocess.exec
@@ -385,6 +396,7 @@ functions:
385396
binary: bash
386397
working_dir: "src"
387398
args:
399+
- .evergreen/scripts/run-with-env.sh
388400
- AWS_ROLE_SESSION_NAME="test" .evergreen/scripts/run-mongodb-aws-test.sh
389401
- web-identity
390402

@@ -396,6 +408,7 @@ functions:
396408
binary: bash
397409
working_dir: "src"
398410
args:
411+
- .evergreen/scripts/run-with-env.sh
399412
- .evergreen/scripts/run-mongodb-aws-test.sh
400413
- env-creds
401414

@@ -407,6 +420,7 @@ functions:
407420
binary: bash
408421
working_dir: "src"
409422
args:
423+
- .evergreen/scripts/run-with-env.sh
410424
- .evergreen/scripts/run-mongodb-aws-test.sh
411425
- session-creds
412426

@@ -439,6 +453,7 @@ functions:
439453
binary: bash
440454
working_dir: "src"
441455
args:
456+
- .evergreen/scripts/run-with-env.sh
442457
- .evergreen/scripts/run-aws-ecs-auth-test.sh
443458

444459
"cleanup":
@@ -447,6 +462,7 @@ functions:
447462
binary: bash
448463
working_dir: "src"
449464
args:
465+
- .evergreen/scripts/run-with-env.sh
450466
- .evergreen/scripts/cleanup.sh
451467

452468
"fix absolute paths":
@@ -483,6 +499,7 @@ functions:
483499
binary: bash
484500
working_dir: "src"
485501
args:
502+
- .evergreen/scripts/run-with-env.sh
486503
- .evergreen/scripts/install-dependencies.sh
487504

488505
"assume ec2 role":
@@ -512,6 +529,7 @@ functions:
512529
binary: bash
513530
working_dir: "src"
514531
args:
532+
- .evergreen/scripts/run-with-env.sh
515533
- .evergreen/scripts/run-ocsp-test.sh
516534

517535
"run-ocsp-server":
@@ -529,6 +547,7 @@ functions:
529547
binary: bash
530548
include_expansions_in_env: ["MONGODB_URI"]
531549
args:
550+
- src/.evergreen/scripts/run-with-env.sh
532551
- src/.evergreen/scripts/run-load-balancer.sh
533552
- command: expansions.update
534553
params:
@@ -553,6 +572,7 @@ functions:
553572
params:
554573
binary: bash
555574
args:
575+
- src/.evergreen/scripts/run-with-env.sh
556576
- src/.evergreen/scripts/teardown-aws.sh
557577

558578
"teardown atlas":
@@ -569,6 +589,7 @@ functions:
569589
working_dir: "src"
570590
binary: bash
571591
args:
592+
- .evergreen/scripts/run-with-env.sh
572593
- .evergreen/scripts/run-perf-tests.sh
573594

574595
"attach benchmark test results":

.evergreen/scripts/bootstrap-mongo-orchestration.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22

3-
. src/.evergreen/scripts/env.sh
43
set -o xtrace
54

65
# Enable core dumps if enabled on the machine

.evergreen/scripts/cleanup.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22

3-
. .evergreen/scripts/env.sh
43
if [ -f "$DRIVERS_TOOLS"/.evergreen/csfle/secrets-export.sh ]; then
54
. .evergreen/hatch.sh encryption:teardown
65
fi

.evergreen/scripts/configure-env.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ export TEST_DATA_LAKE="${TEST_DATA_LAKE:-}"
6060
export TEST_SUITES="${TEST_SUITES:-}"
6161
export MONGODB_API_VERSION="${MONGODB_API_VERSION:-}"
6262
export SKIP_HATCH="${SKIP_HATCH:-}"
63+
export skip_crypt_shared="${skip_crypt_shared:-}"
64+
export VERSION="${VERSION:-}"
65+
export TOPOLOGY="${TOPOLOGY:-}"
66+
export STORAGE_ENGINE="${STORAGE_ENGINE:-}"
67+
export ORCHESTRATION_FILE="${ORCHESTRATION_FILE:-}"
68+
export REQUIRE_API_VERSION="${REQUIRE_API_VERSION:-}"
69+
export LOAD_BALANCER="${LOAD_BALANCER:-}"
6370
6471
export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
6572
export PATH="$MONGODB_BINARIES:$PATH"
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

3-
. .evergreen/scripts/env.sh
43
set -o xtrace
54
file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh"
65
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
7-
[ -f "$file" ] && bash $file || echo "$file not available, skipping"
6+
[ -f "$file" ] && bash "$file" || echo "$file not available, skipping"

.evergreen/scripts/run-aws-ecs-auth-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ if [ "${skip_ECS_auth_test}" = "true" ]; then
55
echo "This platform does not support the ECS auth test, skipping..."
66
exit 0
77
fi
8-
. .evergreen/scripts/env.sh
98
set -ex
10-
cd $DRIVERS_TOOLS/.evergreen/auth_aws
9+
cd "$DRIVERS_TOOLS"/.evergreen/auth_aws
1110
. ./activate-authawsvenv.sh
1211
. aws_setup.sh ecs
1312
export MONGODB_BINARIES="$MONGODB_BINARIES"

.evergreen/scripts/run-doctests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
22

3-
. .evergreen/scripts/env.sh
43
set -o xtrace
5-
PYTHON_BINARY=${PYTHON_BINARY} bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh doctest:test
4+
PYTHON_BINARY=${PYTHON_BINARY} bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh doctest:test

.evergreen/scripts/run-enterprise-auth-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Disable xtrace for security reasons (just in case it was accidentally set).
44
set +x
5-
bash ${DRIVERS_TOOLS}/.evergreen/auth_aws/setup_secrets.sh drivers/enterprise_auth
5+
bash "${DRIVERS_TOOLS}"/.evergreen/auth_aws/setup_secrets.sh drivers/enterprise_auth
66
TEST_ENTERPRISE_AUTH=1 AUTH=auth bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash
22

3-
. src/.evergreen/scripts/env.sh
43
MONGODB_URI=${MONGODB_URI} bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh start
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22

3-
. .evergreen/scripts/env.sh
43
set -o xtrace
54
export PYTHON_BINARY=${PYTHON_BINARY}
6-
bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh test:test-mockupdb
5+
bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-mockupdb

0 commit comments

Comments
 (0)