Skip to content

PYTHON-5365 Fix handing of remote tests #2327

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

Merged
merged 4 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .evergreen/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if [ -f $HERE/env.sh ]; then
. $HERE/env.sh
fi

# Set up the default bin directory.
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
PYMONGO_BIN_DIR="$HOME/.local/bin"
export PATH="$PYMONGO_BIN_DIR:$PATH"
fi

# Helper function to pip install a dependency using a temporary python env.
function _pip_install() {
_HERE=$(dirname ${BASH_SOURCE:-$0})
Expand Down Expand Up @@ -41,10 +47,6 @@ if ! command -v just &>/dev/null; then
if [ "Windows_NT" = "${OS:-}" ]; then
_TARGET="--target x86_64-pc-windows-msvc"
fi
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
echo "Please install just!"
exit 1
fi
_BIN_DIR=$PYMONGO_BIN_DIR
echo "Installing just..."
mkdir -p "$_BIN_DIR" 2>/dev/null || true
Expand All @@ -56,10 +58,6 @@ fi

# Ensure uv is installed.
if ! command -v uv &>/dev/null; then
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
echo "Please install uv!"
exit 1
fi
_BIN_DIR=$PYMONGO_BIN_DIR
echo "Installing uv..."
# On most systems we can install directly.
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,6 @@ def run_command(cmd: str | list[str], **kwargs: Any) -> None:

def create_archive() -> str:
run_command("git add .", cwd=ROOT)
run_command('git commit -m "add files"', check=False, cwd=ROOT)
run_command('git commit --no-verify -m "add files"', check=False, cwd=ROOT)
run_command(f"git archive -o {TMP_DRIVER_FILE} HEAD", cwd=ROOT)
return TMP_DRIVER_FILE
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ the pages will re-render and the browser will automatically refresh.
- Run `just setup-tests encryption`.
- Run the tests with `just run-tests`.

To test with `encryption` and `PyOpenSSL`, use `just setup-tests encryption pyopenssl`.

### PyOpenSSL tests

- Run `just run-server` to start the server.
- Run `just setup-tests default_sync pyopenssl`.
- Run the tests with `just run-tests`.

Note: `PyOpenSSL` is not used in async tests, but you can use `just setup-tests default_async pyopenssl`
to verify that PyMongo falls back to the standard library `OpenSSL`.

### Load balancer tests

- Install `haproxy` (available as `brew install haproxy` on macOS).
Expand Down
Loading