From 423b201d6a8a77a616613d7f87eafb0e2fef741c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 18 Feb 2026 18:49:40 +0100 Subject: [PATCH] try this --- Dockerfile | 2 ++ changedetectionio/tests/conftest.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25067efd1..a9224af64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/changedetectionio/tests/conftest.py b/changedetectionio/tests/conftest.py index 9212681c9..2a7c08a65 100644 --- a/changedetectionio/tests/conftest.py +++ b/changedetectionio/tests/conftest.py @@ -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)