Skip to content
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
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ jobs:
options:
- ["Other", "--ignore=tests/test_replica_set.py --ignore=tests/test_replica_sets.py --ignore=tests/test_sharded_clusters.py", "3.9"]
- ["Replica Set", "tests/test_replica_set.py", "3.10"]
- ["Replica Sets", "tests/test_replica_sets.py", "3.11"]

Choose a reason for hiding this comment

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

wait why did these 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.

We only run 4 tests, so I peanut-butter spread them across versions

Choose a reason for hiding this comment

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

makes sense!

- ["Sharded", "tests/test_sharded_clusters.py", "3.13"]
- ["Replica Sets", "tests/test_replica_sets.py", "3.12"]
- ["Sharded", "tests/test_sharded_clusters.py", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.options[2] }}
allow-prereleases: true
- name: Install MongoDB
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"bottle>=0.12.7",
Expand Down
20 changes: 17 additions & 3 deletions tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import shlex
import pexpect
import subprocess
import signal
from pathlib import Path
import unittest

def run(cmd, **kwargs):
Expand All @@ -25,6 +27,11 @@ def run(cmd, **kwargs):
raise RuntimeError('Process failed!')


def stop():
pid = Path("server.pid").read_text().strip()
os.kill(int(pid), signal.SIGTERM)
Path("server.pid").unlink()

class TestLaunch(unittest.TestCase):

def test_launch_single(self):
Expand All @@ -36,7 +43,9 @@ def test_launch_single(self):
proc.send('q\n')
proc.wait()
self.assertEqual(proc.exitstatus, 0)
run('mongo-orchestration stop')
# TODO: https://jira.mongodb.org/browse/PYTHON-5594
# run('mongo-orchestration stop')
stop()

def test_launch_replica_set(self):
if os.name != 'posix':
Expand All @@ -47,7 +56,10 @@ def test_launch_replica_set(self):
proc.send('q\n')
proc.wait()
self.assertEqual(proc.exitstatus, 0)
run('mongo-orchestration stop')
# TODO: https://jira.mongodb.org/browse/PYTHON-5594
# run('mongo-orchestration stop')
stop()


def test_launch_sharded(self):
if os.name != 'posix':
Expand All @@ -58,4 +70,6 @@ def test_launch_sharded(self):
proc.send('q\n')
proc.wait()
self.assertEqual(proc.exitstatus, 0)
run('mongo-orchestration stop')
# TODO: https://jira.mongodb.org/browse/PYTHON-5594
# run('mongo-orchestration stop')
stop()