Edit and exercise Archiver CommandBindings in the IntelliJ designer

This commit is contained in:
2026-11-24 14:42:35 +01:00
parent 54e202014e
commit 98d37c6c3d
38 changed files with 1304 additions and 190 deletions
+5 -4
View File
@@ -22,6 +22,7 @@ p.add_argument("--target-java-home", type=Path, required=True)
p.add_argument("--idea-home", type=Path, required=True)
p.add_argument("--mode", choices=["all", "classpath", "modulepath"], default="all")
p.add_argument("--repeat", type=int, default=1, help="Consecutive independent runs per mode")
p.add_argument("--archiver", type=Path, help="Qualify ArchiveWindow.fxml in a disposable project copy")
args = p.parse_args()
if args.repeat < 1:
p.error("--repeat must be positive")
@@ -29,11 +30,11 @@ output = ROOT / "target/ide-workflow"
output.mkdir(parents=True, exist_ok=True)
batch = Path(tempfile.mkdtemp(prefix="runs-", dir=output))
print("Host evidence: " + str(batch), flush=True)
modes = ("classpath", "modulepath") if args.mode == "all" else (args.mode,)
modes = ("classpath",) if args.archiver else (("classpath", "modulepath") if args.mode == "all" else (args.mode,))
for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode in modes):
crashes = NativeCrashGuard(ROOT)
launch = subprocess.run([sys.executable, ROOT / "scripts/run-fixture-host.py", "intellij",
"--check", "--mode", mode, "--java-home", args.java_home,
"--check", *(["--archiver", str(args.archiver.resolve())] if args.archiver else []), "--mode", mode, "--java-home", args.java_home,
"--target-java-home", args.target_java_home, "--idea-home", args.idea_home],
cwd=ROOT, text=True, capture_output=True, check=True, timeout=60)
evidence = batch / f"{mode}-run-{run_number}"
@@ -43,7 +44,7 @@ for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode i
base = Path(re.search(r"Disposable host: (.+)", launch.stdout)[1])
pid = int(re.search(r"Host PID: (\d+)", launch.stdout)[1])
try:
until = time.monotonic() + 240
until = time.monotonic() + (480 if args.archiver else 240)
while time.monotonic() < until:
if (base / "FAILURE.txt").exists():
raise RuntimeError((base / "FAILURE.txt").read_text())
@@ -73,7 +74,7 @@ for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode i
shutil.copyfile(base / "intellij.png", output / (mode + ".png"))
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
finally:
for name in ("SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log"):
for name in ("SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png"):
if (base / name).exists():
shutil.copyfile(base / name, evidence / name)
workers = descendant_workers(pid)