Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,34 @@ image ([a build](docs/develop/building.md#a-build)); from a checkout of overpres
- **Releases only by the workflow** (*Actions*, *Packages*, *Run workflow* on `main`); a tag pushed by hand
releases nothing, and released tags never move ([a release](docs/develop/releasing.md#a-release)).

## Testing policy

Tests are a maintenance liability unless they provide meaningful regression protection.

- Write the minimum number of tests necessary to verify meaningful behavior.
- Test behavior and contracts, not implementation details.
- Do not test static text, labels, constants, styling, or hardcoded configuration unless explicitly required by a
specification.
- Do not write tests asserting the absence of intentionally removed features, files, functions, or fields unless
their absence is an active security or compatibility requirement.
- Remove obsolete tests when their corresponding functionality is intentionally removed.
- Do not test private helpers, trivial getters, or framework functionality without a concrete reason.
- Do not duplicate coverage already provided by existing tests.
- Do not reproduce production logic inside test assertions.
- Do not add tests solely to increase coverage metrics.
- Prefer extending or consolidating existing tests over creating new ones.
- Never remove or weaken tests merely to make a failing build pass.

Before adding a test, answer:

1. What concrete regression would this test detect?
2. Would this regression matter to a user or system consumer?
3. Is this behavior already covered?
4. Would the test survive a behavior-preserving refactor?

If a test cannot be justified, do not write it. Adding zero tests is an acceptable outcome. Before completing a task,
review all new and modified tests and remove unnecessary, redundant, brittle, or obsolete assertions.

## Changes

A branch and a pull request against `main`, titled as a conventional commit; merged by rebase or squash once `ci`
Expand Down
6 changes: 3 additions & 3 deletions common/overpressure-base/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# session's user may start (its polkit rule), and its daily check. The preset enables the services and the timer;
# the tests run in the build.
pkgname=overpressure-base
pkgver=2026.12.2
pkgrel=2
pkgver=2026.12.4
pkgrel=1
pkgdesc="overpressure's installed system: preinit, storage and recovery policy, USB link"
arch=(any)
url="https://github.com/overpressure/overpressure/blob/main/docs/runtime.md"
Expand Down Expand Up @@ -71,7 +71,7 @@ sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396'
'42e864cce089ddec10704c74a404d4713e9b1371284e88e29c8a396f43e0bf42'
'7e2e20deeb0a824f77178be78dd3b52ba3b0eea92723b634279adc2c5e0d38b7'
'3daf42f9b44dfcf6d4ae65018d633198503fa9071596c443a188fe37ec379d78'
'c7dd064ee8c73ae16f18be269c41411820408678cd467e4324cd2414a3b3897e'
'fe7fb9ba139be31b4bb9aca8ae35373b5ff21ce4bc5c47b2b9d8f880f0f39071'
'f5f3580f84c53379b59a4de7aa206ba88975a439939a4b8eded66bd5dcced147'
'7983dff5891f654806fdf7b0ac36683df4b13d8ae291e439c3a90ee5abb5ab4e'
'b45bf0dbde89f82a75cd782acce1773f1e2b7d2b0322d66be50c71782dac0eea'
Expand Down
11 changes: 0 additions & 11 deletions common/overpressure-base/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@ def test_the_session_starts_the_three_steps_and_nothing_else(self):
self.assertEqual(rule.count("polkit.Result.YES"), 1)
self.assertNotIn("Result.AUTH", rule)

def test_the_package_installs_them(self):
pkgbuild = (HERE / "PKGBUILD").read_text(encoding="utf-8")
for name in (
"overpressure-update@.service",
"overpressure-update-check.service",
"overpressure-update-check.timer",
"50-overpressure-update.rules",
):
self.assertIn(f" {name}", pkgbuild)
self.assertIn('"$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules"', pkgbuild)


if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions phoenix/pico4-audio/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# the microphone muted while the headset is off the head. The preset enables the audio target; the tests
# run in the build.
pkgname=pico4-audio
pkgver=2026.12.3
pkgver=2026.12.4
pkgrel=1
pkgdesc="PICO 4 audio: the ADSP, its audio process, the sound card's routes and calibration, the microphone mute"
arch=(any)
Expand Down Expand Up @@ -44,7 +44,7 @@ sha256sums=('5789e02ea04b1a1100faabd0805891703a8916d00be1ff90f428c16db831308f'
'6e73ec6b6f791a857336992b81c95eaafdc8b221f64eb3f8e090c6bd2bb39c3f'
'e6cce0d239fc1389d007aecb5a00d121076deb72963a79149edf05a009c9c38f'
'939fd8440eaede54fdbd64642493befc72d6d64cd500834912f2a56aec116b2f'
'ecba7a9a64a70f6e0cb81f9e537175441ed903dce6ebe46cc55c50953f534b89'
'af547eeb877d2d837285cb6bbd6c7aa2f0d5f1c27b6c924ddd3e619a68607150'
'179f021b124a78032d57233419710aafd98bbc313e36a2e57599c51be0f05766')

build() {
Expand Down
8 changes: 0 additions & 8 deletions phoenix/pico4-audio/test_audiocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@ def test_export_plays_the_sami_device_unless_plain(self):
topologies[bool(flag)] = struct.unpack_from("<I", out.read_bytes(), 16 + 16 + 4)[0]
self.assertEqual(topologies, {False: 0x20000001, True: 0x11000003})

def test_paths_match_pico_os(self):
# audio_platform_info.xml and audio_io_policy.conf: speaker 15/deep buffer, handset mic 4/record.
by_name = {p["name"]: p for p in audiocal.PATHS}
self.assertEqual((by_name["speaker"]["acdb_id"], by_name["speaker"]["app_type"]), (15, 0x11130))
self.assertEqual((by_name["handset-mic"]["acdb_id"], by_name["handset-mic"]["app_type"]), (4, 0x11132))
self.assertEqual(by_name["speaker"]["backend"], "WSA_CDC_DMA_RX_0")
self.assertEqual(by_name["handset-mic"]["backend"], "TX_CDC_DMA_TX_3")


if __name__ == "__main__":
unittest.main()
7 changes: 3 additions & 4 deletions phoenix/pico4-base/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# clock, the panel probe, zram swap and the PICO 4's policy files. The preset enables the services; the tests
# run in the build.
pkgname=pico4-base
pkgver=2026.12.1
pkgver=2026.12.4
pkgrel=1
pkgdesc="PICO 4 system: preinit hooks (the way into the recovery), charger mode, Wi-Fi and Bluetooth addresses, clock, panel probe"
arch=(any)
Expand Down Expand Up @@ -44,7 +44,7 @@ source=(50-pico4-wifi-address.conf
controller-tables
wlan-address
vrdevice_path
test_clock.py test_config.py test_qca6390.py
test_clock.py test_qca6390.py
test_charger.sh
test_recovery_key.sh
50-pico4-base.preset)
Expand Down Expand Up @@ -76,14 +76,13 @@ sha256sums=('a4671220f5b6aa835752b9d43439895ab33fec8cb4ef6604b7675a447ebeee70'
'c2b47f379380857cd47df25225bbba90268f6aaea75e6b97add802913c1be322'
'e1b7bf74abc4b10665eb3ccdd83ab43d050a432e834d870be9faef0fa3fe9152'
'55878f20ae9a671b8097681faa9001f81701e8095b72dd2f582e9c9f924d11ae'
'41c7e01d2f0936915598b2844642e2c0b3ccdeace606fffba1cd368f8d7d63d7'
'2b1d293a8b30e06617ac87ac16e2ab82b5d09a4f7fc4c4e7c7c86f193ee35474'
'ae94fd605c024946c86508864e15dfcebf04a0d14008913fe4f17c15ecce8e59'
'42e89d4c69d82e07b3a58854ad7f2fe9dacef3b3d8fa0f7e5a4a2641468fcad0'
'e144487e69f248d0aea93f1b90b0fa5f7e81069effd565760900f2cf4cce9d6e')

build() {
python3 -B -m unittest test_clock test_config test_qca6390
python3 -B -m unittest test_clock test_qca6390
bash test_charger.sh
bash test_recovery_key.sh
}
Expand Down
71 changes: 0 additions & 71 deletions phoenix/pico4-base/test_config.py

This file was deleted.

6 changes: 3 additions & 3 deletions phoenix/pico4-checks/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# reads), the suspend check, the support bundle and the link's samples after
# boot. The preset enables the link samples; the tests run in the build.
pkgname=pico4-checks
pkgver=2026.11.25
pkgver=2026.12.4
pkgrel=1
pkgdesc="PICO 4 checks: the system's and the VR session's acceptance checks, the support bundle"
arch=(any)
Expand Down Expand Up @@ -32,8 +32,8 @@ sha256sums=('83c000aeb2f6834844c79b5dbac32b76f866f0431461bf89b92415eaff29f8b6'
'454156206a62fa0b7dea261238feb5e7350013382397891c680feb1ce7bf9ee0'
'6e4f6fcd37d067aafd2fb16cbe2544cbfb16c18d762b8f0dba7c34689147762e'
'43a502265d0d94d117b4e30bad443348238a904948334e3ad634e822d87ed63a'
'f07de3d3b4df5f17c154ed24cbce1475b7abd7827222604c185a018920ab4d11'
'f0eaf22820c981198a319c89b00967b91c8bd2e3a3b286cba7e4a10469db286a'
'6bbc067d6511aa176a310ea0cd4ef938b79b85c092ef819c256c8961e8d5f8b4'
'8a76b8b211ba652de37c28884584baeaffb29597d363e04aa80221f15fefd2ab'
'71f8feb17dc54eb08505042fd5f7fd685b8f31c9c6acd44c5b2885dbe2dd5600'
'bad444faaafc81249c69d06807c9c863ab0c63dee2e945b39a2694ce4541c44f')

Expand Down
9 changes: 0 additions & 9 deletions phoenix/pico4-checks/test_msm_frame_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ def test_a_little_margin_fails_the_check_and_the_web_helpers_share_is_reported(s
end["job_margin_ms"]["p99"] = 6.3
self.assertEqual(perf.verdict(end, 60.0)["status"], "passed")

def test_the_web_helpers_share_is_reported_and_judges_nothing(self):
flips = [100 + i * REFRESH for i in range(901)]
end = stats.parse(trace(flips, 901, [(700, 5.9)]), {700})
end["job_margin_ms"] = {"p50": 7.1, "p99": 6.3, "frames": 900, "without_a_job": 0}
for share in (0.0, 12.5):
end["web_helper_gpu_percent"] = share
v = perf.verdict(end, 60.0)
self.assertEqual((v["status"], v["web_helper_gpu_percent"]), ("passed", share))

def test_the_web_helpers_threads_count_apart_from_the_compositors(self):
flips = [100 + i * REFRESH for i in range(91)]
lines = trace(flips, 91, [(700, 5.9), (800, 500.0)])
Expand Down
6 changes: 2 additions & 4 deletions phoenix/pico4-checks/test_session_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def test_the_window_passes(self):
self.assertAlmostEqual(v["late_percent"], 100 * 2 / 2700, places=2)
self.assertEqual(v["gpu_ms"]["mean"], 3.1)
self.assertEqual(v["limits"]["commit_hz_min"], 85.5)
# Up to the agreed limit of 90 °C; 90.5 °C fails (the heat case below).
self.assertEqual(perf.verdict(FRAMES, 90.0)["status"], "passed")

def test_each_limit_fails_on_its_own(self):
cases = [
Expand Down Expand Up @@ -97,10 +99,6 @@ def test_command_line(self):
).stdout
self.assertEqual(json.loads(out)["status"], "failed")

def test_up_to_the_agreed_limit_of_90_c_passes(self):
self.assertEqual(perf.verdict(FRAMES, 90.0)["status"], "passed")
self.assertEqual(perf.verdict(FRAMES, 90.5)["failures"], ["hottest zone 90.5 °C, above 90.0 °C"])


if __name__ == "__main__":
unittest.main()
12 changes: 6 additions & 6 deletions phoenix/pico4-power/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# the key alone); the status LED as PICO OS sets it (status-led). The preset enables the four services; in a
# sleep the fan is off, as on PICO OS (systemd-sleep's hook pico4-fan.sleep); the tests run in the build.
pkgname=pico4-power
pkgver=2026.12.3
pkgrel=2
pkgver=2026.12.4
pkgrel=1
pkgdesc="PICO 4 fan control, battery guard, power key and status LED, as on PICO OS"
arch=(any)
url="https://github.com/overpressure/phoenix/blob/main/docs/cooling.md"
Expand All @@ -28,10 +28,10 @@ sha256sums=('81899ac36a3ca784da208b1426e6e6f7fe777ebc6ece8c99eda84e97acf892cd'
'09cb202f462560346e18f63e8a09bb1c53d19189547ac8b60639913695851908'
'd2c226f50a1c3029888921ff44c135d265952e6cfd488b7d91b3503d3c4939b3'
'e9ca686d1b78eed2e1f7ee7efdbc65e996d59400d1e14a84c3bda892736251c6'
'f0557038297791bba0fde3efc28d25a565f7ef338dc38cd65ff4dbea0fdada59'
'5f5df141aef42f012da84adb920ac3db4e4a8620bc1dd0059d88fc8579f43251'
'e403426890c10267a02693e04e06ddbbfc0be30fd3130aa089e2b80c921d1886'
'630cae3a000e3aaea81105a54c9842a3236fe40ac606e0335231b8900b6552d0')
'2933b30c10a5d20347705f7a7b54bcfc1cf5121dd040bc23815d209ca34479d1'
'5edf30f7fde72465d7f812df1213472d09e602bf6471db6d5da39d7280bf8209'
'9870a35718c891ad51ebe9da76c6dfa141874d0874fa4ebc555d9749137ef01e'
'140ff40f372872657c627deace5ca82532361c6b2d4b8c99d09dcacf46ea40a9')

build() {
python3 -B -m unittest test_fan test_battery_guard test_power_key test_status_led
Expand Down
8 changes: 0 additions & 8 deletions phoenix/pico4-power/test_battery_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
CHARGING, DISCHARGING, NOT_CHARGING, FULL = "Charging", "Discharging", "Not charging", "Full"


class ValuesTests(unittest.TestCase):
def test_the_stock_values(self):
# ExtBatteryServiceImpl: batteryLevel < 1, MIN_BATTERY_LEVEL_SHUTDOWN, postDelayed 60000.
self.assertEqual((tool.EMPTY, tool.SCREEN_OFF_LEVEL, tool.SCREEN_OFF_DELAY), (1, 4, 60.0))
# checkBatteryStatus's notice and shutdownIfOverTempLocked's limit, in tenths of °C.
self.assertEqual((tool.HOT_NOTICE, tool.HOT_SHUTDOWN), (580, 590))


class HotTests(unittest.TestCase):
def test_powers_off_above_59_degrees(self):
guard = tool.Guard()
Expand Down
10 changes: 0 additions & 10 deletions phoenix/pico4-power/test_fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,6 @@ def test_an_awake_mcu_is_never_woken(self):


class TableTest(unittest.TestCase):
def test_tables_match_the_stock_service(self):
# libpxrfanservice.so, FanControl::FanControl for product "Phoenix".
self.assertEqual(EARLY.thresholds, (90000, 85000, 70000, 60000, 55000, 50000))
self.assertEqual(EARLY.duties, (75, 60, 45, 30, 30, 30))
self.assertEqual(LATE.thresholds, (90000, 85000, 80500, 72000, 60000, 55000))
self.assertEqual(LATE.duties, (50, 45, 40, 35, 30, 0))

def run_steps(self, table: object, temps: list[float], last: int | None = None) -> list[int | None]:
out = []
for t in temps:
Expand Down Expand Up @@ -862,9 +855,6 @@ def test_wrong_length(self):
with self.assertRaises(ValueError):
fan.fan_info(reply(1, 2, 3))

def test_query_stays_on_the_allowlist(self):
self.assertEqual(fan.request(fan.GET_FAN_INFO).hex(), "a030000000" + "90")


class StateTest(unittest.TestCase):
def test_fresh_state_only(self):
Expand Down
10 changes: 0 additions & 10 deletions phoenix/pico4-power/test_power_key.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# SPDX-License-Identifier: Unlicense
"""The power key as on PICO OS (docs/install.md#power-key)."""

import configparser
import importlib.machinery
import importlib.util
import tempfile
import unittest
from pathlib import Path

HERE = Path(__file__).resolve().parent
DROPIN = HERE / "50-pico4-power-key.conf"
PATH = HERE / "powerkey"
_loader = importlib.machinery.SourceFileLoader("powerkey", str(PATH))
_spec = importlib.util.spec_from_loader("powerkey", _loader)
Expand All @@ -18,14 +16,6 @@
_loader.exec_module(tool)


class LogindTests(unittest.TestCase):
def test_logind_leaves_the_key_to_pico4_powerkey(self):
config = configparser.ConfigParser()
config.read_string(DROPIN.read_text(encoding="utf-8"))
self.assertEqual(config["Login"]["HandlePowerKey"], "ignore")
self.assertEqual(config["Login"]["HandlePowerKeyLongPress"], "ignore")


class DeviceTests(unittest.TestCase):
def test_the_pmic_key(self):
with tempfile.TemporaryDirectory() as tmp:
Expand Down
7 changes: 0 additions & 7 deletions phoenix/pico4-power/test_status_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ def test_temperature_blink_comes_first(self):
for temp in (449, 580, 1):
self.assertEqual(tool.battery_light(state(CHARGING, plugged=True, temp=temp)), tool.CHARGING, temp)

def test_stock_values(self):
self.assertEqual(tool.CHARGING, tool.Light(red=80, green=80))
self.assertEqual(tool.BLUE, tool.Light(blue=255))
self.assertEqual((tool.LOW_BLINK.on_ms, tool.LOW_BLINK.off_ms), (500, 1000))
self.assertEqual((tool.TEMP_BLINK.on_ms, tool.TEMP_BLINK.off_ms), (500, 2000))
self.assertEqual(tool.SHUTDOWN_BLINK, tool.Light(blue=255, on_ms=500, off_ms=1000))


class StockTests(unittest.TestCase):
def setUp(self):
Expand Down
4 changes: 2 additions & 2 deletions phoenix/pico4-slamd/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# (pico4-base's preinit, from the data partition's copy and the dsp partition); this package holds the
# root's own programs and its mount points. The image-processing tests run natively first.
pkgname=pico4-slamd
pkgver=2026.11.22
pkgver=2026.12.4
pkgrel=1
pkgdesc="PICO 4 head tracker host for PICO OS's libSlam in its bionic root"
arch=(aarch64)
Expand Down Expand Up @@ -34,7 +34,7 @@ sha256sums=('24d211e81a71dfd7c3e59a15f4adcb46c6c64c63f7e58576378e3cf8c0c309d5'
'608befe2639f75341ac4814027b8a68464dc66112bd284bbadd9040ba9b22014'
'f7fe40aa72ef0d7af23d3de894906e11630e5d36c2d3eb26018c465b6a303144'
'81435015c4f43e39480e7e82b88d3208ce5d8c7eea1127917972796bd92cb79b'
'3158cf7a88e8f8d50b63f9b49d28df2ca43cdd69daacbec632e3af964ea11730')
'295ad772a5be3b0d0daa4d709df53de504546d97f1449a19ba7c8e0f42365ea2')

build() {
python3 -B -m unittest test_slamd
Expand Down
Loading