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

Add tests for min dependencies and update test matrix for min and max server versions #183

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Changes from 3 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
45 changes: 34 additions & 11 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ defaults:
run:
shell: bash -eux {0}

env:
MONGODB_VERSION: "7.0"

jobs:
static:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,18 +52,16 @@ jobs:
- uses: extractions/setup-just@v2
- name: Start MongoDB on Linux
if: ${{ startsWith(runner.os, 'Linux') }}
run: |
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${MONGODB_VERSION} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
sleep 1
done
sudo docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
uses: supercharge/[email protected]
with:
mongodb-version: 8.0
mongodb-replica-set: test-rs
- name: Start MongoDB on MacOS
if: ${{ startsWith(runner.os, 'macOS') }}
run: |
brew tap mongodb/brew
brew install mongodb/brew/mongodb-community@${MONGODB_VERSION}
brew services start mongodb-community@${MONGODB_VERSION}
brew install mongodb/brew/mongodb-community@7.0

Choose a reason for hiding this comment

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

How come this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the highest version supported on brew right now, but not the highest available with the GitHub action on Ubuntu.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I must have had it misconfigured before, it works with 8.0.

brew services start mongodb-community@7.0
- name: Start MongoDB on Windows
if: ${{ startsWith(runner.os, 'Windows') }}
shell: powershell
Expand All @@ -77,3 +72,31 @@ jobs:
net start MongoDB
- run: just install
- run: just test

build-min:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.9"
- uses: extractions/setup-just@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.9"

Choose a reason for hiding this comment

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

Similar to comment about ${MONGODB_VERSION} => 7.0,
MIN_PYTHON_VERSION: "3.9", MONGODB_VERSION: "4.0" seem like a good idea. What am I missing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

- uses: extractions/setup-just@v2
- uses: supercharge/[email protected]
with:
mongodb-version: 4.0
mongodb-replica-set: test-rs
- name: Run unit tests with minimum dependency versions
run: |
uv sync --python="3.9" --resolution=lowest-direct
just test
Loading