Files
EscapistsReintroduced/docs/evidence/playtest-refresh-2026-10-03-crash-start/prepare.py
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

22 lines
4.4 KiB
Python

from pathlib import Path
r=Path('/tmp/erri-playtest-crash-2020');old=Path('/tmp/erri-package-prep-1305');live=Path('/home/jakub/devel/escapistsrereintroduced')
for name in ['assemble.py','verify.py']:
s=(old/name).read_text().replace('2026-10-03-depot-mines','2026-10-03-crash-start').replace('/tmp/erri-package-depot-mines-1305','/tmp/erri-package-crash-start-2020').replace('/tmp/erri-source-depot-mines-1210.zip','/tmp/erri-source-crash-start-2020.zip').replace('/tmp/erri-packed-chat-depot-mines-1305','/tmp/erri-packed-crash-start-2020').replace('/tmp/erri-depot-mines-root-1116',str(live/'docs/evidence/crash-start-2026-10-03/validation')).replace('native-2026-10-03-crash-start','native-2026-10-03-crash-prison-default').replace('len(authored)==423 and len(actual)==364','len(authored)==437 and len(actual)==376').replace('packed-2026-10-02-owner-fixes','packed-2026-10-03-depot-mines')
s=s.replace('from pathlib import Path\n','from pathlib import Path\nimport argparse\n_args=argparse.ArgumentParser();_args.add_argument("--runner-log",type=Path);_args=_args.parse_args()\n',1)
s='\n'.join(line for line in s.splitlines() if "ERR DEPOT MINE STOCK" not in line and "excluded-live-additions.json" not in line and '/tmp/erri-playtest-review-1210/preflight.json' not in line)+'\n'
s=s.replace("shutil.copyfile('/tmp/erri-gameplay-root-1305/package.log',e/'runner-output.log.txt')", "if _args.runner_log: shutil.copyfile(_args.runner_log,e/'runner-output.log.txt')")
s=s.replace("shutil.copyfile('/tmp/erri-packed-crash-start-2020.log',se/'runner-output.log.txt')", "if _args.runner_log: shutil.copyfile(_args.runner_log,se/'runner-output.log.txt')")
if name=='assemble.py':
s=s.replace("assert attempt['native_exit_code']==0", "assert type(attempt['native_exit_code']) is int and attempt['native_exit_code']==0\nassert attempt['runner_error'] is None")
s=s.replace("assert route_runner['cleanup_confirmed'] and route_runner['source_unchanged_after_run']", "assert route_runner['cleanup_confirmed'] and route_runner['source_unchanged_after_run'] and route_runner['external_addons_unchanged_after_run']\nassert route_runner['result']=='smoke-completed'\nfrom native_report import analyze\nassert analyze((route/'console.log.txt').read_text(),route_report['log'])==route_report\nassert len(route_report['engine_errors'])==13\nassert digest(route/'launch-source-sha256.json')==route_runner['launch_source_sha256']\nassert json.loads((route/'launch-source-sha256.json').read_text())==authored")
s=s.replace("for p in (build,e):p.mkdir(exist_ok=False)", "assert not build.exists() and not build.is_symlink() and not e.exists() and not e.is_symlink()\nif _args.runner_log: assert _args.runner_log.is_file()\nfor p in (build,e):p.mkdir(exist_ok=False)")
s=s.replace("manifest=json.loads(z.read('BUNDLE-MANIFEST.json'))", "manifest=json.loads(z.read('BUNDLE-MANIFEST.json'))\n assert manifest['kind']=='DEVELOPMENT SOURCE BUNDLE' and manifest['native_build'] is False and manifest['release_package'] is False")
s=s.replace("assert runtime_inventory(build/'packages')==runtime", "assert runtime_inventory(build/'packages')==runtime\nassert source_inventory(f)==authored")
s=s.replace("shutil.copyfile(Path(__file__).with_name('suite_binding.py'),e/'suite_binding.py')", "shutil.copyfile(Path(__file__).with_name('suite_binding.py'),e/'suite_binding.py')\nshutil.copyfile(Path(__file__).with_name('binding-inputs.json'),e/'binding-inputs.json')")
else:
s=s.replace("assert runner['failure_observed_during_polling']", "assert runner['result']=='game-failed'\nassert runner['failure_observed_during_polling']")
s=s.replace("assert json.loads((r/'.build/playtest-source-2026-10-03-crash-start/frozen-source.json').read_text())==json.loads((r/'docs/evidence/native-2026-10-03-crash-prison-default/source-sha256.json').read_text())", "from source_bundle import inventory as source_inventory\nassert source_inventory(f)==json.loads((r/'docs/evidence/native-2026-10-03-crash-prison-default/source-sha256.json').read_text())")
s=s.replace("se.mkdir(exist_ok=False)", "if _args.runner_log: assert _args.runner_log.is_file()\nse.mkdir(exist_ok=False)")
s=s.replace("shutil.copyfile(Path(__file__).with_name('suite_binding.py'),se/'suite_binding.py')", "shutil.copyfile(Path(__file__).with_name('suite_binding.py'),se/'suite_binding.py')\nshutil.copyfile(Path(__file__).with_name('binding-inputs.json'),se/'binding-inputs.json')")
(r/name).write_text(s)