Add native gameplay outcomes, recovery verification, and realm diagnostics
Core tests / core (push) Successful in 40s
Core tests / core (push) Successful in 40s
This commit is contained in:
@@ -81,11 +81,18 @@ except Exception as e:maintenance.append('Recovery check needs attention: '+type
|
||||
try:
|
||||
recovery_rows=[]
|
||||
try:
|
||||
for line in sql('SELECT id,guid,name,UNIX_TIMESTAMP(at),detail FROM acore_auth.azerothai_recovery_log ORDER BY id DESC LIMIT 100').splitlines():
|
||||
fields=line.split('\t',4)
|
||||
recovery_rows.append(dict(id=int(fields[0]),guid=int(fields[1]),name=fields[2],at=int(fields[3]),detail=fields[4]))
|
||||
for line in sql("SELECT l.id,l.guid,l.name,UNIX_TIMESTAMP(l.at),l.detail,COALESCE(r.status,IF(l.at>NOW()-INTERVAL 3 MINUTE,'pending','unverified')),COALESCE(UNIX_TIMESTAMP(r.checked_at),0),COALESCE(r.detail,'No verification recorded') FROM acore_auth.azerothai_recovery_log l LEFT JOIN acore_auth.azerothai_recovery_results r ON r.attempt_id=l.id ORDER BY l.id DESC LIMIT 100").splitlines():
|
||||
fields=line.split('\t')
|
||||
recovery_rows.append(dict(id=int(fields[0]),guid=int(fields[1]),name=fields[2],at=int(fields[3]),detail=fields[4],status=fields[5],checkedAt=int(fields[6]),result=fields[7]))
|
||||
except Exception as e:maintenance.append('Recovery history unavailable: '+type(e).__name__)
|
||||
request=urllib.request.Request(base+'/api/realm-insights',data=json.dumps({'at':time.time(),'recoveries':recovery_rows}).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer '+cfg['AUTONOMY_TOKEN']})
|
||||
spec=importlib.util.spec_from_file_location('realm_evidence',repo/'scripts/realm-evidence.py')
|
||||
evidence=importlib.util.module_from_spec(spec);spec.loader.exec_module(evidence)
|
||||
outcomes=None;perf=None
|
||||
try:outcomes=evidence.collect(sql,current)
|
||||
except Exception as e:maintenance.append('Gameplay counters unavailable: '+type(e).__name__)
|
||||
try:perf=evidence.performance()
|
||||
except Exception as e:maintenance.append('Profiler unavailable: '+type(e).__name__)
|
||||
request=urllib.request.Request(base+'/api/realm-insights',data=json.dumps({'at':time.time(),'recoveries':recovery_rows,'outcomes':outcomes,'performance':perf}).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer '+cfg['AUTONOMY_TOKEN']})
|
||||
with urllib.request.urlopen(request,timeout=20) as response:assert response.status==200
|
||||
maintenance.append('Realm report sampled')
|
||||
except Exception as e:maintenance.append('Realm report needs attention: '+type(e).__name__)
|
||||
|
||||
Reference in New Issue
Block a user