- custom_components/fglair/README.md: HACS-установка, cloud/ручной/импорт, превью шаблона, сущности, ключ для ESPHome (reconfigure/CLI), диагностика и troubleshoot; заглушки screenshots/step-1..8.png (сгенерированы) - tests/acceptance/test_esphome_ha.py: quick/burst/long через REST API HA (long-lived token), адаптивная матрица по capabilities, возврат исходного состояния, CSV-отчёт long, опциональный ESPHome-канал (aioesphomeapi) - self-test приёмки на моке HA REST (6 тестов, без железа) - hacs.json; README: раздел Home Assistant; docs/RELEASE_HA.md: публикация pyfglair на PyPI (wheel/sdist, auditwheel), HACS-релиз, приёмка - scripts/py-ci.sh: tests/acceptance; план H5 отмечен
40 lines
1.3 KiB
Bash
40 lines
1.3 KiB
Bash
#!/bin/bash
|
||
# CI python-части репозитория: pyfglair + HA-компонент.
|
||
# scripts/py-ci.sh --setup # venv для pyfglair-тестов
|
||
# scripts/py-ci.sh --setup-ha # venv с homeassistant/pytest-плагином (тяжёлый)
|
||
# scripts/py-ci.sh # pytest: tests/pyfglair + tests/components (если есть venv)
|
||
set -euo pipefail
|
||
cd "$(dirname "$0")/.."
|
||
|
||
VENV="${PY_VENV:-.venv}"
|
||
HA_VENV="${HA_VENV:-.venv-ha}"
|
||
|
||
case "${1:-}" in
|
||
--setup)
|
||
python3 -m venv "$VENV"
|
||
"$VENV/bin/pip" install -q --upgrade pip
|
||
"$VENV/bin/pip" install -q cffi aiohttp pytest pytest-asyncio
|
||
;;
|
||
--setup-ha)
|
||
python3 -m venv "$HA_VENV"
|
||
"$HA_VENV/bin/pip" install -q --upgrade pip
|
||
"$HA_VENV/bin/pip" install -q -r tests/components/requirements.txt
|
||
;;
|
||
esac
|
||
|
||
if [ ! -x "$VENV/bin/python" ]; then
|
||
echo "py-ci: нет $VENV (запустите: scripts/py-ci.sh --setup)" >&2
|
||
exit 1
|
||
fi
|
||
|
||
"$VENV/bin/python" -m pytest tests/pyfglair tests/acceptance -q
|
||
|
||
if [ -x "$HA_VENV/bin/python" ]; then
|
||
"$HA_VENV/bin/python" -m pytest tests/components -q
|
||
elif [ "${PY_CI_SKIP_HA:-0}" = "1" ]; then
|
||
echo "py-ci: HA-тесты пропущены (PY_CI_SKIP_HA=1)"
|
||
else
|
||
echo "py-ci: нет $HA_VENV — запустите scripts/py-ci.sh --setup-ha" >&2
|
||
exit 1
|
||
fi
|