Round 2 candidate 7a585aa9606863a0d44a26094b585160914e3d8fd5f13436b56470cd69e6d867,
packet manifest 4292da90162c801a9c56716a0539f8fa072e67e93e4f4d9a0f1e107b84b652ea,
base 02ee7f640. Filbert approved round 2 in comment 28707. Committed by Sage
for Rocko, who has no git access; secrets grep clean, no binaries (one empty file).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
22 lines
1.4 KiB
Python
22 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Sage's owner-gate runner. Rocko has not run this without the test slot."""
|
|
import pathlib,subprocess,os,signal,sys,json
|
|
root=pathlib.Path(sys.argv[1] if len(sys.argv)>1 else '/mnt/storage/src/mosaic-stack-rocko-147-r1')
|
|
out=pathlib.Path(__file__).resolve().parent/'gate';out.mkdir(exist_ok=True)
|
|
steps=[]
|
|
# Touched packages; Sage may use the repository-wide landing gate instead.
|
|
for name in ['project','business','cli']:
|
|
files=[str(f.relative_to(root)) for f in sorted((root/'packages'/name/'tests').glob('*.test.mjs'))]
|
|
steps.append(('pkg-'+name,['node','--test','--test-concurrency=1','--test-reporter=spec',*files]))
|
|
for file in sorted((root/'scripts').glob('test-*.sh')):steps.append(('script-'+file.stem,['bash',str(file.relative_to(root))]))
|
|
results=[]
|
|
for name,command in steps:
|
|
env={**os.environ,'DOCKER_HOST':'unix:///nonexistent.sock'}
|
|
if name in ['script-test-task','script-test-release']:env.pop('DOCKER_HOST',None)
|
|
with (out/(name+'.log')).open('w') as log:
|
|
p=subprocess.Popen(command,cwd=root,env=env,stdout=log,stderr=subprocess.STDOUT,start_new_session=True)
|
|
try:rc=p.wait(timeout=1200)
|
|
except subprocess.TimeoutExpired:os.killpg(p.pid,signal.SIGKILL);p.wait();rc='timeout'
|
|
results.append(dict(suite=name,exit=rc,command=command));(out/'results.json').write_text(json.dumps(results,indent=2)+'\n');print(name,rc,flush=True)
|
|
if rc!=0:sys.exit(1)
|