-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYTHON-4496 Add integration test (#92)
Signed-off-by: mongodb-dbx-release-bot[bot] <167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com> Co-authored-by: mongodb-dbx-release-bot[bot] <167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d1c2560
commit 7963281
Showing
7 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
export CONFIG=$PROJECT_DIRECTORY/.github/reviewers.txt | ||
export SCRIPT="$DRIVERS_TOOLS/.evergreen/github_app/assign-reviewer.sh" | ||
# shellcheck disable=SC2154 | ||
bash $SCRIPT -p $CONFIG -h ${github_commit} -o "mongodb" -n "winkerberos" | ||
echo '{"results": [{ "status": "PASS", "test_file": "Build", "log_raw": "Test completed" } ]}' > ${PROJECT_DIRECTORY}/test-results.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
exec_timeout_secs: 3600 | ||
|
||
# Mark a failure as a system/bootstrap failure (purple box) rather then a task | ||
# failure by default. | ||
# Actual testing tasks are marked with `type: test` | ||
command_type: system | ||
|
||
functions: | ||
"setup": | ||
- command: git.get_project | ||
params: | ||
directory: src | ||
- command: subprocess.exec | ||
params: | ||
binary: bash | ||
working_dir: "src" | ||
add_expansions_to_env: true | ||
args: | ||
- ./.evergreen/setup.sh | ||
- command: expansions.update | ||
params: | ||
file: src/expansion.yml | ||
|
||
"bootstrap mongo-orchestration": | ||
- command: subprocess.exec | ||
params: | ||
binary: bash | ||
env: | ||
MONGODB_VERSION: latest | ||
TOPOLOGY: server | ||
args: | ||
- ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh | ||
|
||
"run unit tests": | ||
- command: subprocess.exec | ||
type: test | ||
params: | ||
binary: bash | ||
working_dir: "src" | ||
include_expansions_in_env: ["DRIVERS_TOOLS"] | ||
args: | ||
- ./.evergreen/run-tests.sh | ||
|
||
"assign pr reviewer": | ||
- command: subprocess.exec | ||
type: test | ||
params: | ||
binary: bash | ||
add_expansions_to_env: true | ||
working_dir: "src" | ||
args: | ||
- ./.evergreen/assign-pr-reviewer.sh | ||
|
||
"teardown": | ||
- command: subprocess.exec | ||
params: | ||
binary: bash | ||
args: | ||
- ${DRIVERS_TOOLS}/.evergreen/teardown.sh | ||
|
||
pre: | ||
- func: setup | ||
- func: bootstrap mongo-orchestration | ||
|
||
post: | ||
- func: teardown | ||
- command: attach.xunit_results | ||
params: | ||
file: "mongo-python-driver/xunit-results/TEST-*.xml" | ||
|
||
tasks: | ||
- name: run-tests | ||
commands: | ||
- func: "run unit tests" | ||
|
||
- name: assign-pr-reviewer | ||
tags: ["pr"] | ||
allowed_requesters: ["patch", "github_pr"] | ||
commands: | ||
- func: "assign pr reviewer" | ||
|
||
buildvariants: | ||
- name: tests | ||
display_name: Run Tests | ||
run_on: windows-64-vsMulti-small | ||
tasks: | ||
- name: run-tests | ||
|
||
- name: rhel8-pr-assign-reviewer | ||
display_name: Assign PR Reviewer | ||
run_on: rhel87-small | ||
tasks: | ||
- name: "assign-pr-reviewer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/bash | ||
# Disable xtrace for security reasons (just in case it was accidentally set). | ||
set +x | ||
set -eu | ||
|
||
# Fetch secrets | ||
bash ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/enterprise_auth | ||
source secrets-export.sh | ||
|
||
# Set up env | ||
pushd .. | ||
git clone https://github.com/mongodb/mongo-python-driver | ||
|
||
set -x | ||
"C:/python/Python38/python.exe" -m venv .venv | ||
dos2unix -q .venv/Scripts/activate | ||
. .venv/Scripts/activate | ||
pip install "./mongo-python-driver[test]" | ||
pip install -e ./src | ||
|
||
pushd ./mongo-python-driver | ||
TEST_ENTERPRISE_AUTH=1 bash ./.evergreen/run-tests.sh | ||
popd | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eux | ||
|
||
# Get the current unique version of this checkout | ||
# shellcheck disable=SC2154 | ||
if [ "${is_patch}" = "true" ]; then | ||
# shellcheck disable=SC2154 | ||
CURRENT_VERSION=$(git describe)-patch-${version_id} | ||
else | ||
CURRENT_VERSION=latest | ||
fi | ||
|
||
# Python has cygwin path problems on Windows. | ||
DRIVERS_TOOLS="$(dirname "$(pwd)")/drivers-tools" | ||
PROJECT_DIRECTORY="$(pwd)" | ||
|
||
if [ "Windows_NT" = "${OS:-}" ]; then | ||
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) | ||
PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) | ||
fi | ||
export PROJECT_DIRECTORY | ||
export DRIVERS_TOOLS | ||
|
||
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" | ||
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" | ||
# shellcheck disable=SC2154 | ||
export UPLOAD_BUCKET="${project}" | ||
|
||
cat <<EOT > expansion.yml | ||
CURRENT_VERSION: "$CURRENT_VERSION" | ||
DRIVERS_TOOLS: "$DRIVERS_TOOLS" | ||
MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME" | ||
MONGODB_BINARIES: "$MONGODB_BINARIES" | ||
UPLOAD_BUCKET: "$UPLOAD_BUCKET" | ||
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" | ||
EOT | ||
|
||
# Set up drivers-tools with a .env file. | ||
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git ${DRIVERS_TOOLS} | ||
cat <<EOT > ${DRIVERS_TOOLS}/.env | ||
CURRENT_VERSION="$CURRENT_VERSION" | ||
DRIVERS_TOOLS="$DRIVERS_TOOLS" | ||
MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" | ||
MONGODB_BINARIES="$MONGODB_BINARIES" | ||
UPLOAD_BUCKET="$UPLOAD_BUCKET" | ||
PROJECT_DIRECTORY="$PROJECT_DIRECTORY" | ||
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# List of reviewers for auto-assignment of reviews. | ||
caseyclements | ||
blink1073 | ||
Jibola | ||
NoahStapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ winkerberos.egg-info/ | |
envfile | ||
.venv | ||
signatures | ||
secrets-export.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters