This commit is contained in:
dgtlmoon
2026-02-18 18:49:40 +01:00
parent 839cf7fd9d
commit 423b201d6a
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -116,6 +116,8 @@ ENV PYTHONPYCACHEPREFIX=/tmp/pycache
# Disable pytest's .pytest_cache directory (also writes to /app, which is root-owned).
# Only has an effect when running tests inside the container.
ENV PYTEST_ADDOPTS="-p no:cacheprovider"
# Redirect test logs to the datastore (writable) instead of /app/tests/logs (read-only in container).
ENV TEST_LOG_DIR=/datastore/test_logs
# Re #80, sets SECLEVEL=1 in openssl.conf to allow monitoring sites with weak/old cipher suites
RUN sed -i 's/^CipherString = .*/CipherString = DEFAULT@SECLEVEL=1/' /etc/ssl/openssl.cnf
+3 -2
View File
@@ -39,8 +39,9 @@ def per_test_log_file(request):
"""Create a separate log file for each test function with pytest output."""
import re
# Create logs directory if it doesn't exist
log_dir = os.path.join(os.path.dirname(__file__), "logs")
# Create logs directory if it doesn't exist.
# TEST_LOG_DIR can be overridden e.g. to a writable path when /app is read-only (Docker).
log_dir = os.environ.get('TEST_LOG_DIR', os.path.join(os.path.dirname(__file__), "logs"))
os.makedirs(log_dir, exist_ok=True)
# Generate log filename from test name and worker ID (for parallel runs)