
* upgrade to latest pip for in_docker_test_script.sh * Bump gunicorn to 22.0.0 (security) Changelog: https://docs.gunicorn.org/en/stable/news.html#id1 use utime to notify workers liveness migrate setup to pyproject.toml fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors) parsing additional requests is no longer attempted past unsupported request framing on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) requests conflicting configured or passed SCRIPT_NAME now produce a verbose error Trailer fields are no longer inspected for headers indicating secure scheme support Python 3.12 ** Breaking changes ** minimum version is Python 3.7 the limitations on valid characters in the HTTP method have been bounded to Internet Standards requests specifying unsupported transfer coding (order) are refused by default (rare) HTTP methods are no longer casefolded by default (IANA method registry contains none affected) HTTP methods containing the number sign (#) are no longer accepted by default (rare) HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported) HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits) requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling) empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies) ** SECURITY ** fix CVE-2024-1135 * Remove TYPE_CHECKING guard for pydantic v1 imports Retain TYPE_CHECKING guard in v1 fallback to force pyright into pydantic.v1 namespace * Run unit tests with pydantic v1 now that v2 is installed via poetry
86 lines
2.5 KiB
YAML
86 lines
2.5 KiB
YAML
name: unit-tests
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
pull_request:
|
|
branches: ['main']
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
unit-tests:
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-12]
|
|
python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
|
# Windows is a bit behind on Python version availability in Github
|
|
exclude:
|
|
- os: windows-latest
|
|
python-version: '3.10.13'
|
|
- os: windows-latest
|
|
python-version: '3.9.18'
|
|
- os: windows-latest
|
|
python-version: '3.8.18'
|
|
include:
|
|
- os: windows-latest
|
|
python-version: '3.10.11'
|
|
- os: windows-latest
|
|
python-version: '3.9.13'
|
|
- os: windows-latest
|
|
python-version: '3.8.10'
|
|
runs-on: ${{ matrix.os }}
|
|
# Service containers to run with `runner-job`
|
|
services:
|
|
# Label used to access the service container
|
|
redis:
|
|
image: ${{ matrix.os == 'ubuntu-latest' && 'redis' || '' }}
|
|
# Set health checks to wait until redis has started
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
# Maps port 6379 on service container to the host
|
|
- 6379:6379
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/setup_build_env
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
run-poetry-install: true
|
|
create-venv-at-path: .venv
|
|
- name: Run unit tests
|
|
run: |
|
|
export PYTHONUNBUFFERED=1
|
|
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
|
- name: Run unit tests w/ redis
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: |
|
|
export PYTHONUNBUFFERED=1
|
|
export REDIS_URL=redis://localhost:6379
|
|
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
|
# Change to explicitly install v1 when reflex-hosting-cli is compatible with v2
|
|
- name: Run unit tests w/ pydantic v1
|
|
run: |
|
|
export PYTHONUNBUFFERED=1
|
|
poetry run pip install "pydantic~=1.10"
|
|
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
|
- run: poetry run coverage html
|