-
-
Notifications
You must be signed in to change notification settings - Fork 19
58 lines (49 loc) · 1.98 KB
/
Copy pathtests.yaml
File metadata and controls
58 lines (49 loc) · 1.98 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
# Lets the suite be run by hand against any branch — used to confirm a test
# actually fails when the defect it targets is reintroduced.
workflow_dispatch:
jobs:
# Fast suite: pure protocol logic, no Home Assistant. Runs in well under a second,
# which is what makes it usable on every register-map change.
unit:
name: Unit tests (no HA)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install pytest pymodbus pyserial
- name: Run tests
run: pytest tests/ -v
# Home Assistant suite: config flow, setup/unload, entity creation, diagnostics.
#
# Linux only. Home Assistant pins lru-dict==1.3.0, which has no CPython 3.13 Windows
# wheel and needs a C compiler — so this cannot run on a Windows dev machine, and CI
# is the only place these tests execute.
#
# pytest-homeassistant-custom-component is pinned deliberately: each release targets
# one specific HA version, so leaving it floating means an upstream HA release can
# break this job without any change here. Bump it on purpose.
homeassistant:
name: Home Assistant integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
# pymodbus and pyserial are the integration's own manifest.json requirements.
# Home Assistant installs those itself at runtime, but the test harness does not —
# so without them config_flow.py fails at `import serial` and every test dies with
# a bare "Import error" from HA's platform loader.
- name: Install Home Assistant test harness
run: pip install pytest-homeassistant-custom-component==0.13.316 pymodbus pyserial
- name: Run tests
run: pytest tests_ha/ -v