Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix aws auth tests #2720

Merged
merged 4 commits into from Feb 2, 2021
Merged

chore(ci): fix aws auth tests #2720

merged 4 commits into from Feb 2, 2021

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Jan 27, 2021

Description

Upgrades the boto3 python dependency used in the AWS auth tests by means of the newly added activate_venv.sh script.

NODE-3056

What changed?

Are there any files to ignore?

@emadum emadum marked this pull request as ready for review January 27, 2021 18:54
working_dir: src
silent: true
script: |
pip install --upgrade boto3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will upgrade boto3 for the entire system. This is bad practice because it can break applications that use the system python and even break future Evergreen tasks that run on this machine. Instead you should create and use a virtualenv, like this:

          # The aws_e2e_assume_role script requires python3 with boto3.
          virtualenv -p ${python3_binary} mongovenv
          if [ "Windows_NT" = "$OS" ]; then
            . mongovenv/Scripts/activate
          else
            . mongovenv/bin/activate
          fi
          pip install --upgrade boto3

Since this is a virtualenv you'll need to activate it before running each JS script, eg:

          # The mongovenv was created earlier.
          if [ "Windows_NT" = "$OS" ]; then
            . mongovenv/Scripts/activate
          else
            . mongovenv/bin/activate
          fi
          cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
          ${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js

Ideally the drivers-evergreen-tools auth testing scripts would take care of these problems so that all drivers don't need to add this finicky boilerplate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and thanks for fixing this bug! I was able to fix it in pymongo too: mongodb/mongo-python-driver#562

@emadum
Copy link
Contributor Author

emadum commented Jan 28, 2021

Note: depends on mongodb-labs/drivers-evergreen-tools#138

Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants