-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (36 loc) · 2.14 KB
/
Makefile
File metadata and controls
41 lines (36 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# UIX development helpers
#
# All targets assume you are running from the repository root with an activated
# virtual environment (source .venv/bin/activate).
#
# Note: the `VAR=value make target` syntax for passing environment variables
# works on Linux/macOS. Windows users should use `set VAR=value && make target`
# or see tests/README.md for the equivalent `pytest` invocations.
#
# Quick reference
# ---------------
# make ha_up Start a persistent HA container for fast iterative work
# make doc_images_gen Generate any missing documentation images (first-run bootstrap)
# make doc_images_update Regenerate ALL documentation images (use after HA/UIX visual changes)
# make doc_audit Check that all doc images are scenario-generated or explicitly excluded
.PHONY: ha_up ha-tests-up doc_images_gen doc_images_update doc_audit
# Start a persistent Home Assistant container and leave it running.
# The script prints HA_URL and HA_TOKEN and writes them to .ha_env.
# In a second terminal: source .ha_env && pytest tests/visual/test_doc_images.py -k <id>
# Press Ctrl-C here to stop HA.
ha_up ha-tests-up:
HA_VERSION="$$(awk 'NF && $$1 !~ /^#/ { print; exit }' tests/HA_VERSION 2>/dev/null || true)"; HA_VERSION="$${HA_VERSION:-stable}" HA_CONFIG_PATH=tests/ha-config HA_CUSTOM_COMPONENTS_PATH=custom_components HA_SETUP_INTEGRATION=uix HA_PLUGINS_YAML=tests/plugins.yaml python -m ha_testcontainer.ha_server
# Run the doc-image test suite. Missing images are created automatically;
# existing images are verified against the current rendered output.
doc_images_gen:
pytest tests/visual/test_doc_images.py
# Regenerate all documentation images, overwriting any existing files.
# Use this after an intentional visual change to Home Assistant or UIX, then
# review the diff and commit the updated PNGs.
doc_images_update:
DOC_IMAGE_UPDATE=1 pytest tests/visual/test_doc_images.py
# Audit doc images: report any PNG/GIF referenced in docs/source/ that is
# neither generated by a scenario nor listed in tests/doc-image-audit-exclusions.txt.
# Exits non-zero (failing the test) if untracked images are found.
doc_audit:
pytest tests/test_doc_audit.py