mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 06:44: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
22
scripts/docker-entrypoint.sh
Executable file
22
scripts/docker-entrypoint.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
# Entrypoint script for Docker container
|
||||
# Sets up symlinks at runtime (needed because volume mount overwrites build-time symlinks)
|
||||
|
||||
set -e
|
||||
|
||||
# Create symlinks with absolute paths so they work after volume mount
|
||||
ln -sfn /app/custom_components/adaptive_lighting /core/homeassistant/components/adaptive_lighting
|
||||
ln -sfn /app/tests /core/tests/components/adaptive_lighting
|
||||
|
||||
# Run pytest with all arguments
|
||||
exec python3 -X dev -m pytest \
|
||||
-vvv \
|
||||
--timeout=9 \
|
||||
--durations=10 \
|
||||
--cov='homeassistant' \
|
||||
--cov-report=xml \
|
||||
--cov-report=html \
|
||||
--cov-report=term \
|
||||
--color=yes \
|
||||
-o console_output_style=count \
|
||||
"$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue