Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (46 loc) · 2.58 KB
/
Copy pathMakefile
File metadata and controls
53 lines (46 loc) · 2.58 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
# Developer shortcuts. Unit tests need no hardware; the e2e targets drive a real BenchPod.
#
# make test
# make e2e POD=192.168.1.215 [FIRMWARE=path/to/scenario-sensors.elf] [USB=/dev/cu.usbmodem…] [REV=v3]
# BENCHPOD_API_KEY=eci_… make e2e-cloud CLOUD_DEVICE=benchpod-v2.0.0
#
# The board's LA voltage is set once in packages/embeddedci/tests/conftest.py; the bench wiring in
# packages/embeddedci/tests/e2e/conftest.py (override with BENCHPOD_E2E_* variables).
PYTHON ?= python
POD ?=
FIRMWARE ?=
USB ?=
CLOUD_DEVICE ?=
REV ?=
# 1 (default): clear the pod's DAC output limits for the run and restore them afterwards
# (pytest_plugin._benchpod_lift_dac_limits). LIFT_DAC_LIMITS=0 when an output stage is live.
LIFT_DAC_LIMITS ?= 1
FIRMWARE_OPT = $(if $(FIRMWARE),--benchpod-firmware=$(abspath $(FIRMWARE)),)
# REV=v3 makes a pod that reports another board revision fail instead of taking the v2 branches.
REV_ENV = $(if $(REV),BENCHPOD_E2E_BOARD_REV=$(REV),) BENCHPOD_LIFT_DAC_LIMITS=$(LIFT_DAC_LIMITS)
.PHONY: test e2e e2e-cloud check-sdk
test: # one run per package, like CI (their tests/conftest.py modules share a name)
$(PYTHON) -m pytest -q packages/embeddedci
$(PYTHON) -m pytest -q packages/embeddedci-mcp
$(PYTHON) -m pytest -q packages/embeddedci-openhtf
$(PYTHON) -m pytest -q scripts
# The e2e tiers must test THIS checkout. Installing a package that depends on embeddedci (the
# OpenHTF plug, say) can quietly swap the editable install for the PyPI release, and every test
# then exercises old code while the header still looks fine.
check-sdk:
@$(PYTHON) scripts/check_sdk.py
e2e: check-sdk
@test -n "$(POD)" || { echo "usage: make e2e POD=<pod host> [FIRMWARE=app.elf] [USB=/dev/…] [REV=v3]"; exit 2; }
# tests/examples too: it is the first thing a new user runs, so it must not rot.
$(REV_ENV) BENCHPOD_E2E_USB="$(USB)" $(PYTHON) -m pytest -v -rs \
packages/embeddedci/tests/e2e packages/embeddedci/tests/examples \
--benchpod-connection=$(POD) $(FIRMWARE_OPT)
$(REV_ENV) $(PYTHON) -m pytest -v -rs packages/embeddedci-mcp/tests/test_e2e_mcp.py \
--benchpod-connection=$(POD) $(FIRMWARE_OPT)
$(REV_ENV) $(PYTHON) -m pytest -v -rs packages/embeddedci-openhtf/tests/test_e2e_openhtf.py \
--benchpod-connection=$(POD) $(FIRMWARE_OPT)
e2e-cloud:
@test -n "$(CLOUD_DEVICE)" || { echo "usage: BENCHPOD_API_KEY=eci_… make e2e-cloud CLOUD_DEVICE=<name>"; exit 2; }
BENCHPOD_E2E_CLOUD_DEVICE="$(CLOUD_DEVICE)" BENCHPOD_LIFT_DAC_LIMITS=$(LIFT_DAC_LIMITS) \
$(PYTHON) -m pytest -v -rs packages/embeddedci/tests/e2e/test_e2e_cloud.py \
--benchpod-connection=embeddedci:$(CLOUD_DEVICE)