Skip to content

Commit e5e3c93

Browse files
test(NODE-5317): use new evergreen scripts (#3669)
Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
1 parent 1e58a4c commit e5e3c93

File tree

4 files changed

+57
-55
lines changed

4 files changed

+57
-55
lines changed

.evergreen/config.in.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,10 @@ functions:
675675
shell: bash
676676
script: |
677677
${PREPARE_SHELL}
678+
set -ex
678679
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
679680
. ./activate-authawsvenv.sh
680-
${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js
681+
python aws_tester.py regular
681682
- command: shell.exec
682683
type: test
683684
params:
@@ -706,9 +707,10 @@ functions:
706707
shell: bash
707708
script: |
708709
${PREPARE_SHELL}
710+
set -ex
709711
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
710712
. ./activate-authawsvenv.sh
711-
${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js
713+
python aws_tester.py assume-role
712714
- command: shell.exec
713715
type: test
714716
params:
@@ -744,9 +746,10 @@ functions:
744746
# Write an empty prepare_mongodb_aws so no auth environment variables
745747
# are set.
746748
echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
749+
set -ex
747750
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
748751
. ./activate-authawsvenv.sh
749-
${MONGODB_BINARIES}/mongo aws_e2e_ec2.js
752+
python aws_tester.py ec2
750753
- command: shell.exec
751754
type: test
752755
params:
@@ -762,9 +765,12 @@ functions:
762765
params:
763766
working_dir: "src"
764767
silent: true
768+
shell: bash
765769
script: |
770+
set -ex
766771
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
767-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_regular_aws.js
772+
. ./activate-authawsvenv.sh
773+
python aws_tester.py regular
768774
cd -
769775
cat <<EOF > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
770776
export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
@@ -785,9 +791,12 @@ functions:
785791
params:
786792
working_dir: "src"
787793
silent: true
794+
shell: bash
788795
script: |
796+
set -ex
789797
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
790-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_assume_role.js
798+
. ./activate-authawsvenv.sh
799+
python aws_tester.py assume-role
791800
cd -
792801
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
793802
export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
@@ -809,10 +818,12 @@ functions:
809818
params:
810819
working_dir: "src"
811820
silent: true
821+
shell: bash
812822
script: |
823+
set -ex
813824
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
814-
. ./activate_venv.sh
815-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
825+
. ./activate-authawsvenv.sh
826+
python aws_tester.py web-identity
816827
cd -
817828
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
818829
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
@@ -834,10 +845,12 @@ functions:
834845
params:
835846
working_dir: "src"
836847
silent: true
848+
shell: bash
837849
script: |
850+
set -ex
838851
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
839-
. ./activate_venv.sh
840-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
852+
. ./activate-authawsvenv.sh
853+
python aws_tester.py web-identity
841854
cd -
842855
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
843856
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
@@ -863,23 +876,17 @@ functions:
863876
AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws
864877
ECS_SRC_DIR=$AUTH_AWS_DIR/src
865878
866-
# fix issue with `TestData` in SERVER-46340
867-
sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js
868-
869879
# pack up project directory to ssh it to the container
870880
mkdir -p $ECS_SRC_DIR/.evergreen
871881
cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen
872882
tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY .
873883
874-
cd $AUTH_AWS_DIR
875-
cat <<EOF > setup.js
876-
const mongo_binaries = "$MONGODB_BINARIES";
877-
const project_dir = "$ECS_SRC_DIR";
878-
EOF
879-
880-
cat setup.js
884+
set -ex
885+
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
881886
. ./activate-authawsvenv.sh
882-
${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js
887+
export MONGODB_BINARIES="${MONGODB_BINARIES}";
888+
export PROJECT_DIRECTORY=$ECS_SRC_DIR;
889+
python aws_tester.py ecs
883890
884891
"run-ocsp-test":
885892
- command: shell.exec

.evergreen/config.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,10 @@ functions:
627627
shell: bash
628628
script: |
629629
${PREPARE_SHELL}
630+
set -ex
630631
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
631632
. ./activate-authawsvenv.sh
632-
${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js
633+
python aws_tester.py regular
633634
- command: shell.exec
634635
type: test
635636
params:
@@ -657,9 +658,10 @@ functions:
657658
shell: bash
658659
script: |
659660
${PREPARE_SHELL}
661+
set -ex
660662
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
661663
. ./activate-authawsvenv.sh
662-
${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js
664+
python aws_tester.py assume-role
663665
- command: shell.exec
664666
type: test
665667
params:
@@ -694,9 +696,10 @@ functions:
694696
# Write an empty prepare_mongodb_aws so no auth environment variables
695697
# are set.
696698
echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
699+
set -ex
697700
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
698701
. ./activate-authawsvenv.sh
699-
${MONGODB_BINARIES}/mongo aws_e2e_ec2.js
702+
python aws_tester.py ec2
700703
- command: shell.exec
701704
type: test
702705
params:
@@ -711,9 +714,12 @@ functions:
711714
params:
712715
working_dir: src
713716
silent: true
717+
shell: bash
714718
script: |
719+
set -ex
715720
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
716-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_regular_aws.js
721+
. ./activate-authawsvenv.sh
722+
python aws_tester.py regular
717723
cd -
718724
cat <<EOF > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
719725
export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
@@ -733,9 +739,12 @@ functions:
733739
params:
734740
working_dir: src
735741
silent: true
742+
shell: bash
736743
script: |
744+
set -ex
737745
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
738-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_assume_role.js
746+
. ./activate-authawsvenv.sh
747+
python aws_tester.py assume-role
739748
cd -
740749
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
741750
export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
@@ -756,10 +765,12 @@ functions:
756765
params:
757766
working_dir: src
758767
silent: true
768+
shell: bash
759769
script: |
770+
set -ex
760771
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
761-
. ./activate_venv.sh
762-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
772+
. ./activate-authawsvenv.sh
773+
python aws_tester.py web-identity
763774
cd -
764775
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
765776
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
@@ -780,10 +791,12 @@ functions:
780791
params:
781792
working_dir: src
782793
silent: true
794+
shell: bash
783795
script: |
796+
set -ex
784797
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
785-
. ./activate_venv.sh
786-
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
798+
. ./activate-authawsvenv.sh
799+
python aws_tester.py web-identity
787800
cd -
788801
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
789802
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
@@ -808,23 +821,17 @@ functions:
808821
AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws
809822
ECS_SRC_DIR=$AUTH_AWS_DIR/src
810823
811-
# fix issue with `TestData` in SERVER-46340
812-
sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js
813-
814824
# pack up project directory to ssh it to the container
815825
mkdir -p $ECS_SRC_DIR/.evergreen
816826
cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen
817827
tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY .
818828
819-
cd $AUTH_AWS_DIR
820-
cat <<EOF > setup.js
821-
const mongo_binaries = "$MONGODB_BINARIES";
822-
const project_dir = "$ECS_SRC_DIR";
823-
EOF
824-
825-
cat setup.js
829+
set -ex
830+
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
826831
. ./activate-authawsvenv.sh
827-
${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js
832+
export MONGODB_BINARIES="${MONGODB_BINARIES}";
833+
export PROJECT_DIRECTORY=$ECS_SRC_DIR;
834+
python aws_tester.py ecs
828835
run-ocsp-test:
829836
- command: shell.exec
830837
type: test

.evergreen/run-orchestration.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ echo "COMPRESSOR=${COMPRESSOR}"
3030
export PATH="$MONGODB_BINARIES:$PATH"
3131
echo "MONGODB_BINARIES=${MONGODB_BINARIES}"
3232

33+
export SKIP_LEGACY_SHELL="true"
34+
echo "SKIP_LEGACY_SHELL=${SKIP_LEGACY_SHELL}"
35+
3336
bash "${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh"

test/integration/auth/mongodb_aws.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { performance } from 'perf_hooks';
44
import * as sinon from 'sinon';
55

66
import { MongoAWSError, MongoClient, MongoServerError } from '../../mongodb';
7-
import { removeAuthFromConnectionString } from '../../tools/utils';
87

98
describe('MONGODB-AWS', function () {
109
let client: MongoClient;
@@ -20,20 +19,6 @@ describe('MONGODB-AWS', function () {
2019
await client?.close();
2120
});
2221

23-
it('should not authorize when not authenticated', async function () {
24-
const url = removeAuthFromConnectionString(this.configuration.url());
25-
client = this.configuration.newClient(url); // strip provided URI of credentials
26-
27-
const error = await client
28-
.db('aws')
29-
.collection('aws_test')
30-
.estimatedDocumentCount()
31-
.catch(error => error);
32-
33-
expect(error).to.be.instanceOf(MongoServerError);
34-
expect(error).to.have.property('code', 13);
35-
});
36-
3722
it('should authorize when successfully authenticated', async function () {
3823
client = this.configuration.newClient(process.env.MONGODB_URI); // use the URI built by the test environment
3924

0 commit comments

Comments
 (0)