fix: e2e/integration test infrastructure and Makefile test targets

- Fix make test: was pointing to non-existent api/tests/, now runs unit tests
  correctly with --ignore=e2e --ignore=integration
- Remove dead phase test targets (test-phase1..4, test-all-phases) that all
  referenced cd api && pytest tests/ (non-existent path)
- Add .test_admin_pass file: reset_admin_password.py now writes a persistent
  test password file alongside .admin_initial_password; the API never deletes
  it (unlike .admin_initial_password which is consumed on first startup)
- Update both integration/conftest.py and e2e/helpers/admin_password.py to
  read .test_admin_pass before .admin_initial_password — so tests work after
  make restart without needing PIC_ADMIN_PASS env var
- Add AI collaboration rules to CLAUDE.md (auto-loaded every session)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 08:27:27 -04:00
parent 420dced9ff
commit 9677755b4f
5 changed files with 46 additions and 37 deletions
+9 -8
View File
@@ -35,18 +35,19 @@ TEST_PEERS = (
TEST_PEER_PASSWORD = 'IntegrationTest123!'
_DATA_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', 'data', 'api'))
def _resolve_admin_pass() -> str:
if ADMIN_PASS:
return ADMIN_PASS
# Try reading from the initial password file (present on first run before bootstrap)
candidate = os.path.join(
os.path.dirname(__file__), '..', '..', 'data', 'api', '.admin_initial_password'
)
candidate = os.path.normpath(candidate)
if os.path.exists(candidate):
return open(candidate).read().strip()
for fname in ('.test_admin_pass', '.admin_initial_password'):
candidate = os.path.join(_DATA_DIR, fname)
if os.path.exists(candidate):
return open(candidate).read().strip()
raise RuntimeError(
"Admin password unknown. Set PIC_ADMIN_PASS env var or run make setup first."
"Admin password unknown. Set PIC_ADMIN_PASS env var or run: "
"make reset-test-admin-pass PIC_TEST_ADMIN_PASS=<password>"
)