mirror of
https://github.com/pretix/pretix.git
synced 2025-12-05 21:32:28 +00:00
Compare commits
13 Commits
v2025.7.3
...
hacky-debu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b23fdf2000 | ||
|
|
80d1dd16f4 | ||
|
|
82ed8abecc | ||
|
|
c0849c9d9c | ||
|
|
e3f6b3f70a | ||
|
|
67934e51fc | ||
|
|
d4ea0990b3 | ||
|
|
9b4506d5e5 | ||
|
|
f559cd2618 | ||
|
|
33991cfb77 | ||
|
|
fe12eea591 | ||
|
|
7000d4897d | ||
|
|
e6337e07e1 |
11
.github/workflows/tests.yml
vendored
11
.github/workflows/tests.yml
vendored
@@ -22,9 +22,10 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Tests
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11"]
|
||||
database: [sqlite, postgres]
|
||||
database: [ postgres]
|
||||
exclude:
|
||||
- database: sqlite
|
||||
python-version: "3.9"
|
||||
@@ -70,7 +71,13 @@ jobs:
|
||||
run: make all compress
|
||||
- name: Run tests
|
||||
working-directory: ./src
|
||||
run: PRETIX_CONFIG_FILE=tests/ci_${{ matrix.database }}.cfg py.test -n 3 -p no:sugar --cov=./ --cov-report=xml --reruns 3 tests --maxfail=100
|
||||
run: PRETIX_CONFIG_FILE=tests/ci_${{ matrix.database }}.cfg py.test -n 3 -p no:sugar --cov=./ --cov-report=xml --reruns 0 tests --maxfail=100 || true
|
||||
|
||||
# XXXXXXXXXXXXXX for test only
|
||||
- name: print debug output
|
||||
working-directory: ./src
|
||||
run: cat /tmp/test.txt
|
||||
|
||||
- name: Run concurrency tests
|
||||
working-directory: ./src
|
||||
run: PRETIX_CONFIG_FILE=tests/ci_${{ matrix.database }}.cfg py.test tests/concurrency_tests/ --reruns 0 --reuse-db
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
#
|
||||
import inspect
|
||||
import os
|
||||
import time
|
||||
|
||||
import pytest
|
||||
from django.db import connection
|
||||
from django.test import override_settings
|
||||
from django.utils import translation
|
||||
from django_scopes import scopes_disabled
|
||||
@@ -119,3 +121,33 @@ def fakeredis_client(monkeypatch):
|
||||
redis.flushall()
|
||||
monkeypatch.setattr('django_redis.get_redis_connection', get_redis_connection, raising=False)
|
||||
yield redis
|
||||
|
||||
|
||||
|
||||
|
||||
# XXXXXXXXXXXXXXXXXXX for test only
|
||||
|
||||
f = open("/tmp/test.txt","w")
|
||||
|
||||
if os.environ.get("GITHUB_WORKFLOW", ""):
|
||||
@pytest.fixture(autouse=True)
|
||||
def ensure_healthy_connection(request, worker_id):
|
||||
# We have no idea why this is neccessary. It shouldn't be, and it costs some performance.
|
||||
# However, in ~August 2024 our tests became really flake on GitHub Actions (failing more than 80% of the time)
|
||||
# for no apparent reason with some error messages related to PostgreSQL connection issues. This appears to
|
||||
# work around it...
|
||||
|
||||
# Check if the test even has DB access
|
||||
marker = request.node.get_closest_marker("django_db")
|
||||
f.write(str(time.time())+"\t"+ str(worker_id)+"\t"+str(request.path)+"\t"+ str(request.module.__name__)+"\t"+ str(request.function.__name__)+"\tstart\n")
|
||||
f.flush()
|
||||
# Run actual test
|
||||
yield
|
||||
f.write(str(time.time())+"\t"+ str(worker_id)+"\t"+str(request.path)+"\t"+ str(request.module.__name__)+"\t"+ str(request.function.__name__)+"\tend\n")
|
||||
f.flush()
|
||||
# If yes, do a dummy query at the end of the test
|
||||
#if marker:
|
||||
# with connection.cursor() as cursor:
|
||||
# cursor.execute("SELECT 1")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user