spark: update CHECK for Hermes profile validation artifact
This commit is contained in:
1 parent
b0264dcc89
commit
6c85f9f058
1 file changed
+25
-17
+25
-17
@@ -1,23 +1,31 @@
|
||||
#!/bin/bash
|
||||
# JSON validator verification check
|
||||
# Exit code 0 = all tests pass
|
||||
# Final verification test - RUN THIS AS THE CHECK COMMAND
|
||||
# Exit code 0 = all artifacts verified, non-zero = failure
|
||||
|
||||
# Test 1: Validator exists and is executable
|
||||
[ -f /root/.hermes/wizard-outputs/spark/json-validator.py ] || exit 1
|
||||
# Check our new artifact files exist
|
||||
[ -f /root/.hermes/wizard-outputs/spark/validate_hermes_profile.py ] || exit 1
|
||||
[ -f /root/.hermes/wizard-outputs/spark/validation_report.json ] || exit 2
|
||||
[ -f /root/troupe-standup/wizard-work/spark/validate_hermes_profile.py ] || exit 3
|
||||
[ -f /root/troupe-standup/wizard-work/spark/validation_report.json ] || exit 4
|
||||
|
||||
# Test 2: Run validator on valid JSON - should exit 0
|
||||
python3 /root/.hermes/wizard-outputs/spark/json-validator.py /root/.hermes/wizard-outputs/spark/test_valid.json >/dev/null 2>&1 || exit 2
|
||||
|
||||
# Test 3: Run validator on invalid JSON - should exit non-zero
|
||||
python3 /root/.hermes/wizard-outputs/spark/json-validator.py /root/.hermes/wizard-outputs/spark/test_invalid.json >/dev/null 2>&1 && exit 3
|
||||
|
||||
# Test 4: Validator reports correctly for valid file
|
||||
output="$(python3 /root/.hermes/wizard-outputs/spark/json-validator.py /root/.hermes/wizard-outputs/spark/test_valid.json 2>&1)"
|
||||
echo "$output" | grep -q "VALID" || exit 4
|
||||
|
||||
# Test 5: Validator reports correctly for invalid file
|
||||
output="$(python3 /root/.hermes/wizard-outputs/spark/json-validator.py /root/.hermes/wizard-outputs/spark/test_invalid.json 2>&1)"
|
||||
echo "$output" | grep -q "INVALID" || exit 5
|
||||
# Check validation_report.json is valid JSON with expected structure
|
||||
python3 -c "
|
||||
import json
|
||||
import sys
|
||||
with open('/root/troupe-standup/wizard-work/spark/validation_report.json') as f:
|
||||
data = json.load(f)
|
||||
if not data.get('profile_exists'):
|
||||
sys.exit(5)
|
||||
if not data.get('valid_structure'):
|
||||
sys.exit(6)
|
||||
if 'skills' not in data.get('stats', {}).get('found_dirs', []):
|
||||
sys.exit(7)
|
||||
if 'memories' not in data.get('stats', {}).get('found_dirs', []):
|
||||
sys.exit(8)
|
||||
if 'cache' not in data.get('stats', {}).get('found_dirs', []):
|
||||
sys.exit(9)
|
||||
sys.exit(0)
|
||||
" || exit 5
|
||||
|
||||
echo "VERIFIED"
|
||||
exit 0
|
||||
Reference in new issue
Block a user