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:
@@ -15,6 +15,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'api'))
|
||||
|
||||
ROOT = os.path.join(os.path.dirname(__file__), '..')
|
||||
INIT_PW_FILE = os.path.normpath(os.path.join(ROOT, 'data', 'api', '.admin_initial_password'))
|
||||
TEST_PW_FILE = os.path.normpath(os.path.join(ROOT, 'data', 'api', '.test_admin_pass'))
|
||||
|
||||
|
||||
def _generate_password(length: int = 20) -> str:
|
||||
@@ -88,13 +89,19 @@ def main() -> None:
|
||||
|
||||
_set_password(password)
|
||||
|
||||
# Also update the initial password file so show-admin-password works
|
||||
# Write the initial password file (API reads it on first start, then deletes it)
|
||||
os.makedirs(os.path.dirname(INIT_PW_FILE), exist_ok=True)
|
||||
with open(INIT_PW_FILE, 'w') as f:
|
||||
f.write(password)
|
||||
|
||||
# Write the persistent test password file (never deleted by the API)
|
||||
with open(TEST_PW_FILE, 'w') as f:
|
||||
f.write(password)
|
||||
os.chmod(TEST_PW_FILE, 0o600)
|
||||
|
||||
_print_banner(password)
|
||||
print(f'\n Also saved to: {INIT_PW_FILE}')
|
||||
print(f' Test file: {TEST_PW_FILE} (persists across API restarts)')
|
||||
print(' Restart the API container for the change to take effect:')
|
||||
print(' docker restart cell-api')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user