Skip to content

Commit b278bda

Browse files
committed
fix(ci): Run pytest tests individually in workflow
Adapts CI to run tests per file, similar to local scripts, to improve stability and better isolate asyncio-related issues. Incorporates environment variables from run_tests.sh.
1 parent ec5a9c3 commit b278bda

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,31 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

26-
- name: Install dependencies using pip
27-
# run: ~/.cargo/bin/uv pip install -e ".[dev]" # Use pip instead
28-
# Use pip (standard method)
26+
- name: Install dependencies
2927
run: |
3028
python -m pip install --upgrade pip
3129
pip install -e ".[dev]"
3230
33-
- name: Test with pytest
34-
run: python -m pytest
35-
env: # Set environment variable for the test step
31+
- name: Run tests individually
32+
env:
3633
JUPYTER_PLATFORM_DIRS: 1
37-
# Pytest will use settings from pyproject.toml to run coverage
34+
PYTHONASYNCIODBG: 0
35+
PYTHONASYNCIODEBUG: 0
36+
ASYNCIO_TASK_TIMEOUT_SEC: 5
37+
run: |
38+
# Remove any existing coverage data to ensure a clean run
39+
rm -f .coverage .coverage.*
40+
41+
# Run each test file separately with coverage, fail fast
42+
for test_file in tests/test_*.py; do
43+
echo "Running tests in $test_file"
44+
python -m pytest "$test_file" --timeout=30 -v --cov=cursor_notebook_mcp --cov-append
45+
done
46+
47+
echo "All test batches completed."
48+
# Optional: Generate a combined text report for the logs here if desired
49+
# python -m coverage report
50+
# The .coverage file will be used by the Coveralls step
3851
3952
- name: Upload coverage reports to Coveralls
4053
# This step requires COVERALLS_REPO_TOKEN to be set in GitHub secrets

0 commit comments

Comments
 (0)