Merge branch 'master' into hacky-debug-output

This commit is contained in:
Mira
2024-10-25 17:57:06 +02:00
committed by GitHub
7 changed files with 19 additions and 13 deletions

View File

@@ -31,15 +31,21 @@ jobs:
python-version: "3.9" python-version: "3.9"
- database: sqlite - database: sqlite
python-version: "3.10" python-version: "3.10"
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pretix
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '15'
postgresql db: 'pretix'
postgresql user: 'postgres'
postgresql password: 'postgres'
if: matrix.database == 'postgres'
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
@@ -74,7 +80,7 @@ jobs:
- name: Run concurrency tests - name: Run concurrency tests
working-directory: ./src working-directory: ./src
run: PRETIX_CONFIG_FILE=tests/travis_${{ matrix.database }}.cfg py.test tests/concurrency_tests/ --reruns 0 --reuse-db run: PRETIX_CONFIG_FILE=tests/ci_${{ matrix.database }}.cfg py.test tests/concurrency_tests/ --reruns 0 --reuse-db
if: matrix.database == 'postgres' if: matrix.database == 'postgres'
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v1

View File

@@ -10,7 +10,7 @@ tests:
- cd src - cd src
- python manage.py check - python manage.py check
- make all compress - make all compress
- PRETIX_CONFIG_FILE=tests/travis_sqlite.cfg py.test --reruns 3 -n 3 tests --maxfail=100 - PRETIX_CONFIG_FILE=tests/ci_sqlite.cfg py.test --reruns 3 -n 3 tests --maxfail=100
except: except:
- pypi - pypi
pypi: pypi:

View File

@@ -95,5 +95,5 @@ class DisableMigrations(object):
return None return None
if not os.environ.get("TRAVIS", "") and not os.environ.get("GITHUB_WORKFLOW", ""): if not os.environ.get("GITHUB_WORKFLOW", ""):
MIGRATION_MODULES = DisableMigrations() MIGRATION_MODULES = DisableMigrations()

View File

@@ -39,8 +39,8 @@ CRASHED_ITEMS = set()
@pytest.hookimpl(trylast=True) @pytest.hookimpl(trylast=True)
def pytest_configure(config): def pytest_configure(config):
""" """
Somehow, somewhere, our test suite causes a segfault in SQLite, but only when run Somehow, somewhere, our test suite causes a segfault in SQLite in the past, but only when run
on Travis CI in full. Therefore, we monkeypatch pytest-xdist to retry segfaulted on CI in full. Therefore, we monkeypatch pytest-xdist to retry segfaulted
tests and keep fingers crossed that this doesn't turn into an infinite loop. tests and keep fingers crossed that this doesn't turn into an infinite loop.
""" """

View File

@@ -29,7 +29,7 @@ def test_crash():
""" """
This is a test that crashes with SIGKILL every (n+1)-th time it runs (n = 0, 1, 2, …). This is a test that crashes with SIGKILL every (n+1)-th time it runs (n = 0, 1, 2, …).
This is useful for debugging our pytest-xdist monkeypatch that we apply in conftest.py This is useful for debugging our pytest-xdist monkeypatch that we apply in conftest.py
to deal with random test crashes on Travis CI using SQLite. Usually, this test is to deal with random test crashes on CI using SQLite. Usually, this test is
skipped to avoid causing additional crashes in real runs. skipped to avoid causing additional crashes in real runs.
""" """
if os.path.exists('crashed.tmp'): if os.path.exists('crashed.tmp'):