mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Fix Docker volume mounts overwriting build-time symlinks
Move pytest command to entrypoint script that recreates symlinks at runtime. This allows mounting local code with -v without breaking the symlinks that connect the test runner to the component and test files.
This commit is contained in:
parent
f95093e1dc
commit
d07f5813a9
2 changed files with 24 additions and 23 deletions
25
Dockerfile
25
Dockerfile
|
|
@ -35,29 +35,8 @@ WORKDIR /app/core
|
|||
# Make 'custom_components/adaptive_lighting' imports available to tests
|
||||
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
||||
|
||||
ENTRYPOINT ["python3", \
|
||||
# Enable Python development mode
|
||||
"-X", "dev", \
|
||||
# Run pytest
|
||||
"-m", "pytest", \
|
||||
# Verbose output
|
||||
"-vvv", \
|
||||
# Set a timeout of 9 seconds per test
|
||||
"--timeout=9", \
|
||||
# Print the 10 slowest tests
|
||||
"--durations=10", \
|
||||
# Measure code coverage for the 'homeassistant' package
|
||||
"--cov='homeassistant'", \
|
||||
# Generate an XML report of the code coverage
|
||||
"--cov-report=xml", \
|
||||
# Generate an HTML report of the code coverage
|
||||
"--cov-report=html", \
|
||||
# Print a summary of the code coverage in the console
|
||||
"--cov-report=term", \
|
||||
# Print logs in color
|
||||
"--color=yes", \
|
||||
# Print a count of test results in the console
|
||||
"-o", "console_output_style=count"]
|
||||
# Entrypoint sets up symlinks at runtime (needed because volume mount overwrites build-time symlinks)
|
||||
ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]
|
||||
|
||||
# Run tests in the 'tests/components/adaptive_lighting' directory
|
||||
CMD ["tests/components/adaptive_lighting"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue