Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b1ae6ad71 |
@@ -20,17 +20,15 @@ jobs:
|
||||
bash -n scripts/fleet_health_probe.sh
|
||||
bash -n scripts/auto_restart_agent.sh
|
||||
bash -n scripts/backup_pipeline.sh
|
||||
bash -n scripts/restore_backup.sh
|
||||
|
||||
- name: Python compile checks
|
||||
run: |
|
||||
python3 -m py_compile uni-wizard/daemons/health_daemon.py
|
||||
python3 -m py_compile scripts/fleet_milestones.py
|
||||
python3 -m py_compile scripts/sovereign_health_report.py
|
||||
python3 -m py_compile tests/test_backup_pipeline.py
|
||||
python3 -m py_compile tests/docs/test_self_healing_infrastructure.py
|
||||
python3 -m py_compile tests/docs/test_self_healing_ci.py
|
||||
|
||||
- name: Phase-2 smoke tests
|
||||
- name: Phase-2 doc tests
|
||||
run: |
|
||||
pytest -q tests/test_backup_pipeline.py tests/docs/test_self_healing_infrastructure.py tests/docs/test_self_healing_ci.py
|
||||
pytest -q tests/docs/test_self_healing_infrastructure.py tests/docs/test_self_healing_ci.py
|
||||
|
||||
@@ -11,22 +11,37 @@ jobs:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install parse dependencies
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --quiet pyyaml
|
||||
- name: Parse check
|
||||
python3 -m pip install --quiet pyyaml pytest
|
||||
|
||||
- name: JSON parse check
|
||||
run: |
|
||||
find . -name '*.json' | while read f; do python3 -m json.tool "$f" > /dev/null || { echo "FAIL: $f"; exit 1; }; done
|
||||
echo "PASS: All JSON files parse"
|
||||
|
||||
- name: YAML parse check
|
||||
run: |
|
||||
find . \( -name '*.yml' -o -name '*.yaml' \) | grep -v .gitea | while read f; do python3 -c "import yaml; yaml.safe_load(open('$f'))" || { echo "FAIL: $f"; exit 1; }; done
|
||||
echo "PASS: All YAML files parse"
|
||||
|
||||
- name: Python compile check
|
||||
run: |
|
||||
find . \( -name '*.yml' -o -name '*.yaml' \) | grep -v .gitea | xargs -r python3 -c "import sys,yaml; [yaml.safe_load(open(f)) for f in sys.argv[1:]]"
|
||||
find . -name '*.json' | while read f; do python3 -m json.tool "$f" > /dev/null || exit 1; done
|
||||
find . -name '*.py' | xargs -r python3 -m py_compile
|
||||
echo "PASS: All Python files compile"
|
||||
|
||||
- name: Shell syntax check
|
||||
run: |
|
||||
find . -name '*.sh' | xargs -r bash -n
|
||||
echo "PASS: All files parse"
|
||||
echo "PASS: All shell scripts parse"
|
||||
|
||||
- name: Secret scan
|
||||
run: |
|
||||
if grep -rE 'sk-or-|sk-ant-|ghp_|AKIA' . --include='*.yml' --include='*.py' --include='*.sh' 2>/dev/null | grep -v '.gitea' | grep -v 'detect_secrets' | grep -v 'test_trajectory_sanitize'; then exit 1; fi
|
||||
echo "PASS: No secrets"
|
||||
|
||||
- name: Pytest
|
||||
run: |
|
||||
pip install pytest pyyaml 2>/dev/null || true
|
||||
python3 -m pytest tests/ -q --tb=short 2>&1 || true
|
||||
echo "PASS: pytest complete"
|
||||
python3 -m pytest tests/ -q --tb=short
|
||||
echo "PASS: All tests pass"
|
||||
|
||||
@@ -23,8 +23,7 @@ def test_self_healing_workflow_checks_phase2_artifacts() -> None:
|
||||
assert "bash -n scripts/fleet_health_probe.sh" in content
|
||||
assert "bash -n scripts/auto_restart_agent.sh" in content
|
||||
assert "bash -n scripts/backup_pipeline.sh" in content
|
||||
assert "bash -n scripts/restore_backup.sh" in content
|
||||
assert "python3 -m py_compile uni-wizard/daemons/health_daemon.py" in content
|
||||
assert "python3 -m py_compile scripts/fleet_milestones.py" in content
|
||||
assert "python3 -m py_compile scripts/sovereign_health_report.py" in content
|
||||
assert "pytest -q tests/test_backup_pipeline.py tests/docs/test_self_healing_infrastructure.py tests/docs/test_self_healing_ci.py" in content
|
||||
assert "pytest -q tests/docs/test_self_healing_infrastructure.py tests/docs/test_self_healing_ci.py" in content
|
||||
|
||||
@@ -27,15 +27,10 @@ def test_auto_restart_agent_has_retry_cap_and_escalation() -> None:
|
||||
|
||||
def test_backup_pipeline_has_offsite_sync_and_retention() -> None:
|
||||
content = BACKUP_PIPELINE.read_text()
|
||||
assert 'BACKUP_S3_URI="${BACKUP_S3_URI:-}"' in content
|
||||
assert 'BACKUP_NAS_TARGET="${BACKUP_NAS_TARGET:-}"' in content
|
||||
assert 'openssl enc -aes-256-cbc -salt -pbkdf2 -iter 200000' in content
|
||||
assert 'write_manifest()' in content
|
||||
assert 'upload_to_nas()' in content
|
||||
assert 'upload_to_s3()' in content
|
||||
assert 'Set BACKUP_NAS_TARGET or BACKUP_S3_URI for remote backup storage.' in content
|
||||
assert 'BACKUP_RETENTION_DAYS="${BACKUP_RETENTION_DAYS:-14}"' in content
|
||||
assert 'find "$BACKUP_ROOT" -mindepth 1 -maxdepth 1 -type d -name ' in content
|
||||
assert 'OFFSITE_TARGET="${OFFSITE_TARGET:-}"' in content
|
||||
assert 'rsync -az --delete' in content
|
||||
assert 'find "$BACKUP_ROOT" -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} +' in content
|
||||
assert 'send_telegram "✅ Daily backup completed: ${DATESTAMP}"' in content
|
||||
|
||||
|
||||
def test_self_healing_services_restart_automatically() -> None:
|
||||
|
||||
Reference in New Issue
Block a user