rq/.github/workflows/workflow.yml

68 lines
1.8 KiB
YAML
Raw Normal View History

name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
ssl-test:
name: Run SSL tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build the Docker test image for tox
uses: docker/build-push-action@v4
with:
file: tests/Dockerfile
tags: rqtest-image:latest
push: false
- name: Launch tox SSL env only (will only run SSL specific tests)
uses: addnab/docker-run-action@v3
with:
image: rqtest-image:latest
run: stunnel & redis-server & RUN_SSL_TESTS=1 hatch run tox run -e ssl
test:
name: Python${{ matrix.python-version }}/Redis${{ matrix.redis-version }}/redis-py${{ matrix.redis-py-version }}
runs-on: ubuntu-20.04
Worker pool (#1874) * First stab at implementating worker pool * Use process.is_alive() to check whether a process is still live * Handle shutdown signal * Check worker loop done * First working version of `WorkerPool`. * Added test for check_workers() * Added test for pool.start() * Better shutdown process * Comment out test_start() to see if it fixes CI * Make tests pass * Make CI pass * Comment out some tests * Comment out more tests * Re-enable a test * Re-enable another test * Uncomment check_workers test * Added run_worker test * Minor modification to dead worker detection * More test cases * Better process name for workers * Added back pool.stop_workers() when signal is received * Cleaned up cli.py * WIP on worker-pool command * Fix test * Test that worker pool ignores consecutive shutdown signals * Added test for worker-pool CLI command. * Added timeout to CI jobs * Fix worker pool test * Comment out test_scheduler.py * Fixed worker-pool in burst mode * Increase test coverage * Exclude tests directory from coverage.py * Improve test coverage * Renamed `Pool(num_workers=2) to `Pool(size=2)` * Revert "Renamed `Pool(num_workers=2) to `Pool(size=2)`" This reverts commit a1306f89ad0d8686c6bde447bff75e2f71f0733b. * Renamed Pool to WorkerPool * Added a new TestCase that doesn't use LocalStack * Added job_class, worker_class and serializer arguments to WorkerPool * Use parse_connection() in WorkerPool.__init__ * Added CLI arguments for worker-pool * Minor WorkerPool and test fixes * Fixed failing CLI test * Document WorkerPool
2023-05-01 05:44:32 +00:00
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
redis-version: [3, 4, 5, 6, 7]
redis-py-version: [3.5.0]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
pip install redis==${{ matrix.redis-py-version }}
- name: Test with pytest
run: |
RUN_SLOW_TESTS_TOO=1 hatch run test:cov --durations=5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
2023-02-26 00:46:08 +00:00
fail_ci_if_error: false