feat(cfold): canonicalize custom test layout
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -1,44 +1,59 @@
|
||||
# JOURNAL — phase `cfold` (Builder)
|
||||
# JOURNAL — phase cfold
|
||||
|
||||
Design rationale, investigations, and dead-ends. Adversary does NOT read this before
|
||||
forming its verdict (anti-anchoring per plan §6.1). See STATUS-cfold.md for claim context.
|
||||
## 2026-06-11 — Phase cfold start
|
||||
|
||||
---
|
||||
### Investigation findings
|
||||
|
||||
## 2026-06-12 — bootstrap + initial orient
|
||||
Pre-existing test layout:
|
||||
- 60 files in `functional/` subdirs across 20 recipes
|
||||
- 4 files in `playwright/` subdirs (cryptpad, custom-html, uptime-kuma)
|
||||
- Helper modules to move: `_discourse.py`, `_ghost.py`, `_mailu.py`, `_mm.py`, `_mumble_proto.py`, `drone/functional/__init__.py`
|
||||
- `mailu/test_backup.py`, `test_restore.py`, `ops.py` explicitly add `functional/` to sys.path — need updating to `custom/`
|
||||
|
||||
Read in full:
|
||||
- `/srv/cc-ci/cc-ci-plan/plan-phase-cfold-custom-folder.md`
|
||||
- `/srv/cc-ci/cc-ci-plan/plan.md` bootstrap plus §§6.1, 7, 9
|
||||
### Decision: deprecated aliases
|
||||
|
||||
Initial repo/phase state after `git pull --rebase`:
|
||||
- pulled Adversary updates `574306e -> 87566b1`
|
||||
- `machine-docs/BACKLOG-cfold.md` and `machine-docs/REVIEW-cfold.md` existed already
|
||||
- `machine-docs/STATUS-cfold.md` and `machine-docs/JOURNAL-cfold.md` were missing
|
||||
Per plan §2 option (RECOMMENDED): keep recognizing `functional/`/`playwright/` as deprecated aliases
|
||||
AND emit a loud one-line warning when a test is found in a deprecated folder. Using `warnings.warn()`
|
||||
at import time of discovery or `print()` directly. Will use `print()` (stderr) so it shows up in CI
|
||||
logs without needing to configure warning filters.
|
||||
|
||||
Bootstrap checks run from this clone:
|
||||
Implementation: `subdirs = ("custom", "functional", "playwright")` — canonical first — and after
|
||||
finding a test in `functional/` or `playwright/`, emit:
|
||||
`print(f"WARNING [cfold]: test found in deprecated folder '{sub}/' — move to custom/: {path}", flush=True, file=sys.stderr)`
|
||||
|
||||
This way:
|
||||
- `custom/` is canonical and gets discovered first
|
||||
- Old folders still work (zero breakage for repo-local tests) but emit a loud warning
|
||||
- No silent coverage loss possible
|
||||
|
||||
## 2026-06-12 — M1 checkpoint: canonical `custom/` layout landed locally
|
||||
|
||||
Code/work completed:
|
||||
- `runner/harness/discovery.py`: canonical `custom/` discovery, deprecated alias warnings, and
|
||||
`custom_subdir_label()` normalization helper.
|
||||
- `runner/harness/manifest.py`: custom-test counts now normalize to canonical `custom`.
|
||||
- all cc-ci custom tests/helper modules moved from `tests/<recipe>/{functional,playwright}/` into
|
||||
`tests/<recipe>/custom/`.
|
||||
- helper-import fallout fixed where needed (`tests/mailu/{ops.py,test_backup.py,test_restore.py}`).
|
||||
- docs updated to describe `custom/` as the canonical layout and explain the alias-compatibility window.
|
||||
|
||||
Mechanical move summary:
|
||||
- 64 custom test files relocated into `custom/`
|
||||
- helper modules relocated too: `_discourse.py`, `_ghost.py`, `_mailu.py`, `_mm.py`,
|
||||
`_mumble_proto.py`, `tests/drone/custom/__init__.py`
|
||||
|
||||
Verification:
|
||||
```bash
|
||||
ssh cc-ci 'hostname && whoami && nixos-version'
|
||||
# nixos
|
||||
# root
|
||||
# 24.11.20250630.50ab793 (Vicuna)
|
||||
|
||||
set -a && . /srv/cc-ci/.testenv && set +a && curl -s "https://$GITEA_URL/api/v1/version"
|
||||
# {"version":"1.24.2"}
|
||||
|
||||
getent hosts "probe-$RANDOM.ci.commoninternet.net"
|
||||
# 91.98.47.73 probe-22588.ci.commoninternet.net
|
||||
nix shell nixpkgs#python312Packages.pytest --command pytest \
|
||||
tests/unit/test_discovery.py tests/unit/test_discovery_phase2.py tests/unit/test_manifest.py -q
|
||||
# ..................
|
||||
# 18 passed in 0.09s
|
||||
```
|
||||
|
||||
Initial cfold code scan confirms the planned touch points are still unmigrated:
|
||||
- `runner/harness/discovery.py` still globs `("functional", "playwright")`
|
||||
- `runner/harness/manifest.py` still reports subdir names verbatim
|
||||
- unit tests still build fixtures under `functional/` and `playwright/`
|
||||
- repo grep still finds many folder-name references in docs/tests and the recipe trees themselves
|
||||
Post-move grep state:
|
||||
- remaining `functional/` / `playwright/` matches in live code are intentional: alias-policy docs,
|
||||
deprecated-folder assertions in the unit tests, and discovery comments describing the alias behavior.
|
||||
- the pre-migration inventory in `BACKLOG-cfold.md` is intentionally unchanged because it is the M1
|
||||
baseline record the Adversary will compare against.
|
||||
|
||||
Adversary inbox/review updates at 2026-06-12T00:00Z and 2026-06-12T16:00Z were procedural only:
|
||||
no claim pending, phase status file missing on `origin/main`. Consuming
|
||||
`machine-docs/BUILDER-INBOX.md` in the same commit that seeds cfold state.
|
||||
|
||||
Next: implement the smallest M1 slice first: discovery + alias policy + unit/manifest updates,
|
||||
then migrate the recipe trees and docs, then assemble the before/after coverage proof.
|
||||
Next: assemble the before/after discovery proof so M1 can be claimed without hand-waving.
|
||||
|
||||
Reference in New Issue
Block a user