myxce/src/xceadmin/tests
Rongsong Shen 7982f28557
feat(xceadmin): validate percent-based limit values are in [0.0, 1.0] (bug-1833)
Adds an if/then JSON Schema (draft 2020-12) conditional constraint to
limits.schema.json's Limit definition: when percent is true, value
must be a number in [0.0, 1.0]. This is the class of authoring mistake
bug-1831/bug-1832 fixed manually (night_mem_pct: value: 50 instead of
0.5) -- now caught automatically at real `xceadmin config build` time
(the actual cluster.bin generation path deploy-ha.sh uses), not merely
by a unit test.

Empirically verified against the real jsonschema library this repo
uses: a violation surfaces with the exact same file/json_pointer/
constraint contract validate_yaml()'s existing ValidationError already
provides, so zero changes were needed to its error-reporting code.

While implementing this, the new constraint caught an identical
pre-existing defect in xceadmin's own checked-in "full" golden test
fixture (fixtures/full/configs/limits.yaml, night_mem_pct: value: 50)
-- fixed the same way, and regenerated the checked-in expected.bin
golden artifact to match the corrected input.

Added 3 tests to test_validation.py: reject an out-of-range percent
value, accept an in-range one, and confirm a non-percent value is
never range-checked regardless of magnitude.

Build gotcha discovered and documented (cerebrum.md): this repo has
two copies of every bundled schema -- src/configs/schema/ (canonical)
and src/xceadmin/src/xcecommon/schema_files/json/ (a gitignored local
mirror meson-build.sh always overwrites from the canonical copy on
every build). Only the canonical copy needed a source-controlled edit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-20 10:50:21 +00:00
..
fixtures feat(xceadmin): validate percent-based limit values are in [0.0, 1.0] (bug-1833) 2026-09-20 10:50:21 +00:00
_live_e2e_common.py test(xceadmin): add env-var override for live E2E binary discovery 2026-08-27 02:39:52 +00:00
conftest.py fix(admin-config-tool): unwrap Request reply envelope before decoding as RequestReply 2026-07-30 09:43:56 +00:00
test_cli.py feat(dirty-content-fingerprint): xceadmin shows fingerprint in --version 2026-08-21 09:20:27 +00:00
test_cli_scheduler_mock.py test(scheduler-core): xceadmin scheduler CLI end-to-end mock-server tests (task 10.6) 2026-08-06 08:12:12 +00:00
test_config_build.py feat(worker-rejoin-resync): wire config fields into xceadmin build (task 1.5) 2026-09-01 09:47:02 +00:00
test_config_dump.py feat(xceadmin): add 'config dump' command and size-string thresholds 2026-08-16 03:56:52 +00:00
test_config_push_mock.py feat(xceadmin): accept a comma-separated --controller failover list (bug-1821, bug-1822) 2026-09-17 03:53:35 +00:00
test_discovery.py feat(xceadmin): accept a comma-separated --controller failover list (bug-1821, bug-1822) 2026-09-17 03:53:35 +00:00
test_e2e_live_ha_push.py test(admin-config-tool): update standby-redirect E2E for bug-1700/1701 2026-08-29 12:10:28 +00:00
test_e2e_live_push.py test(xceadmin): add env-var override for live E2E binary discovery 2026-08-27 02:39:52 +00:00
test_errors.py feat(scheduler-core): build xceadmin scheduler recording client functions (task 10.3) 2026-08-06 04:43:40 +00:00
test_live_e2e_common.py test(xceadmin): add env-var override for live E2E binary discovery 2026-08-27 02:39:52 +00:00
test_mapping.py feat(worker-rejoin-resync): wire config fields into xceadmin build (task 1.5) 2026-09-01 09:47:02 +00:00
test_scheduler.py feat(xceadmin): accept a comma-separated --controller failover list (bug-1821, bug-1822) 2026-09-17 03:53:35 +00:00
test_schema.py feat(admin-config-tool): task 2.2 - xcecommon.schema 2026-07-22 04:43:16 +00:00
test_schema_bundling.py feat(admin-config-tool): tasks 5.1-5.3 - mapping/wire coverage confirmed, schema bundling fix 2026-07-22 09:51:42 +00:00
test_validation.py feat(xceadmin): validate percent-based limit values are in [0.0, 1.0] (bug-1833) 2026-09-20 10:50:21 +00:00
test_wire.py feat(admin-config-tool): drop ha/data/ entirely, match real client TLS 2026-07-22 14:50:51 +00:00