summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook.git@proton.me>2022-09-29 14:25:13 -0500
committerJordan Cook <jordan.cook.git@proton.me>2022-09-30 16:00:16 -0500
commitc567350d4e452a3cfd95647e7b17b973557105d0 (patch)
tree2dd69b50042fb72931a339e3283bacd4bd7f081a /.github
parente1de1742fc8f91229fff069b12c3ce0b23a43d16 (diff)
downloadrequests-cache-c567350d4e452a3cfd95647e7b17b973557105d0.tar.gz
Run pre-deploy stress tests as a separate job
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml2
-rw-r--r--.github/workflows/deploy.yml41
2 files changed, 35 insertions, 8 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e2f5e9e..7f02b51 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -38,7 +38,7 @@ jobs:
# Start integration test databases
- uses: supercharge/mongodb-github-action@1.8.0
with:
- mongodb-version: 4.4
+ mongodb-version: 5.0
- uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 8c3d14b..60839e5 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -20,7 +20,7 @@ on:
env:
LATEST_PY_VERSION: '3.10'
PYTEST_VERBOSE: 'true'
- STRESS_TEST_MULTIPLIER: 5
+ STRESS_TEST_MULTIPLIER: 7
jobs:
# Run tests for all supported requests versions and minimum supported python version
@@ -54,7 +54,7 @@ jobs:
# Start integration test databases
- uses: supercharge/mongodb-github-action@1.8.0
with:
- mongodb-version: 4.4
+ mongodb-version: 5.0
- uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
@@ -73,12 +73,11 @@ jobs:
poetry add requests@${{ matrix.requests-version }} --lock
poetry install -v -E all
- # Run unit + integration tests, with additional stress tests
+ # Run unit + integration tests
- name: Run tests
run: |
source $VENV
nox -e test-current
- nox -e stress -- ${{ env.STRESS_TEST_MULTIPLIER }}
# Run unit tests without any optional dependencies installed
test-minimum-deps:
@@ -92,7 +91,6 @@ jobs:
python-version: ${{ env.LATEST_PY_VERSION }}
- uses: snok/install-poetry@v1.3
with:
- version: 1.2.0b1
virtualenvs-in-project: true
# Cache packages per python version, and reuse until lockfile changes
@@ -111,17 +109,46 @@ jobs:
source $VENV
pytest -n auto tests/unit
+ # Run additional stress tests
+ test-stress:
+ runs-on: ubuntu-latest
+
+ steps:
+ # Set up python + poetry
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ env.LATEST_PY_VERSION }}
+ - uses: snok/install-poetry@v1.3
+ with:
+ virtualenvs-in-project: true
+
+ # Cache packages per python version, and reuse until lockfile changes
+ - name: Cache python packages
+ id: cache
+ uses: actions/cache@v3
+ with:
+ path: .venv
+ key: venv-${{ env.LATEST_PY_VERSION }}-latest-${{ hashFiles('poetry.lock') }}
+ - name: Install dependencies
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: poetry install -v -E all
+
+ - name: Run stress tests
+ run: |
+ source $VENV
+ nox -e stress -- ${{ env.STRESS_TEST_MULTIPLIER }}
# Deploy stable builds on tags only, and pre-release builds from manual trigger ("workflow_dispatch")
release:
- needs: [test, test-minimum-deps]
+ needs: [test, test-minimum-deps, test-stress]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- - uses: snok/install-psoetry@v1.3
+ - uses: snok/install-poetry@v1.3
with:
virtualenvs-in-project: true