Separate radio defence and harden player and objective lifecycles
This commit is contained in:
+41
-10
@@ -1,13 +1,44 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Summarize native smoke evidence without confusing it with gameplay acceptance."""
|
||||
from pathlib import Path
|
||||
import argparse,json,re,sys
|
||||
p=argparse.ArgumentParser(description=__doc__)
|
||||
p.add_argument('log',type=Path)
|
||||
p.add_argument('--require-completions',type=int,default=1)
|
||||
a=p.parse_args();s=a.log.read_text(errors='replace')
|
||||
completed=s.count('ERR SMOKE COMPLETE:')
|
||||
failures=[l.strip() for l in s.splitlines() if 'ERR SMOKE FAIL:' in l or 'Virtual Machine Exception' in l or re.search(r'\bSCRIPT\s+\(E\)',l) or "won't take damage and wont replicate" in l]
|
||||
report={'log':str(a.log),'smoke_completions':completed,'assertions_passed':len(re.findall('ERR SMOKE PASS:',s)),'script_or_runtime_failures':failures,'engine_errors':[l.strip() for l in s.splitlines() if re.search(r'\b(?:SCRIPT|WORLD|DEFAULT|RESOURCES|ENTITY|NETWORK|ENGINE)\s+\(E\)',l)],'missing_end_screen':[l.strip() for l in s.splitlines() if 'Could not find' in l and 'endscreen' in l],'scope':'scripted local Workbench integration only; no multiplayer, piloting or FPS claim'}
|
||||
print(json.dumps(report,indent=2))
|
||||
sys.exit(0 if completed>=a.require_completions and not failures and not report['engine_errors'] and not report['missing_end_screen'] else 1)
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
|
||||
|
||||
def analyze(log_text, log_name):
|
||||
failures = [line.strip() for line in log_text.splitlines()
|
||||
if 'ERR SMOKE FAIL:' in line or 'Virtual Machine Exception' in line
|
||||
or re.search(r'\bSCRIPT\s+\(E\)', line)
|
||||
or "won't take damage and wont replicate" in line]
|
||||
return {
|
||||
'log': str(log_name),
|
||||
'smoke_completions': log_text.count('ERR SMOKE COMPLETE:'),
|
||||
'assertions_passed': len(re.findall('ERR SMOKE PASS:', log_text)),
|
||||
'script_or_runtime_failures': failures,
|
||||
'engine_errors': [line.strip() for line in log_text.splitlines()
|
||||
if re.search(r'\b[A-Z][A-Z0-9_]*\s+\(E\)', line)],
|
||||
'missing_end_screen': [line.strip() for line in log_text.splitlines()
|
||||
if 'Could not find' in line and 'endscreen' in line],
|
||||
'scope': 'scripted local Workbench integration only; no multiplayer, piloting or FPS claim',
|
||||
}
|
||||
|
||||
|
||||
def clean(report, require_completions=1):
|
||||
return (report['smoke_completions'] >= require_completions
|
||||
and not report['script_or_runtime_failures']
|
||||
and not report['engine_errors'] and not report['missing_end_screen'])
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('log', type=Path)
|
||||
parser.add_argument('--require-completions', type=int, default=1)
|
||||
args = parser.parse_args()
|
||||
report = analyze(args.log.read_text(errors='replace'), args.log)
|
||||
print(json.dumps(report, indent=2))
|
||||
return 0 if clean(report, args.require_completions) else 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
raise SystemExit(main())
|
||||
|
||||
Reference in New Issue
Block a user