Render WebView content and qualify Archiver document previews in IntelliJ

This commit is contained in:
2026-11-24 17:54:36 +01:00
parent b04bd9d7ef
commit f9c3de2d2b
9 changed files with 653 additions and 175 deletions
+8 -8
View File
@@ -23,13 +23,13 @@ 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")
p.add_argument("--connection-form", action="store_true", help="Qualify the Archiver connection form")
p.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
forms = p.add_mutually_exclusive_group()
forms.add_argument("--connection-form", action="store_true", help="Qualify the Archiver connection form")
forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
args = p.parse_args()
if args.grid_docking and (not args.archiver or args.connection_form):
p.error("--grid-docking requires --archiver and a separate run from --connection-form")
if args.connection_form and not args.archiver:
p.error("--connection-form requires --archiver")
if (args.connection_form or args.grid_docking or args.saved_document) and not args.archiver:
p.error("Selecting an Archiver view requires --archiver")
if args.repeat < 1:
p.error("--repeat must be positive")
output = ROOT / "target/ide-workflow"
@@ -40,7 +40,7 @@ modes = ("classpath",) if args.archiver else (("classpath", "modulepath") if arg
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", *(["--grid-docking", str(args.grid_docking.resolve())] if args.grid_docking else []), *(["--connection-form"] if args.connection_form else []), *(["--archiver", str(args.archiver.resolve())] if args.archiver else []), "--mode", mode, "--java-home", args.java_home,
"--check", *(["--saved-document"] if args.saved_document else []), *(["--grid-docking", str(args.grid_docking.resolve())] if args.grid_docking else []), *(["--connection-form"] if args.connection_form else []), *(["--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, timeout=60)
if launch.returncode:
@@ -84,7 +84,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", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
for name in ("SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "invoice.png", "delivery.png", "saved-document-result", "tags-Pr.png", "tags-Re.png", "tags-Li.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
if (base / name).exists():
shutil.copyfile(base / name, evidence / name)
workers = descendant_workers(pid)
+18 -13
View File
@@ -19,13 +19,13 @@ p.add_argument("--idea-home", type=Path)
p.add_argument("--check", action="store_true", help="Install the disposable IDE qualification companion")
p.add_argument("--mode", choices=["classpath","modulepath"], default="classpath")
p.add_argument("--archiver", type=Path, help="Use a disposable copy of the Archiver project")
p.add_argument("--connection-form", action="store_true", help="Open and qualify the Archiver connection form")
p.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
forms = p.add_mutually_exclusive_group()
forms.add_argument("--connection-form", action="store_true", help="Open and qualify the Archiver connection form")
forms.add_argument("--grid-docking", type=Path, metavar="REFERENCE_FXML", help="Qualify the Archiver grid, dock layout and the supplied reference workspace")
forms.add_argument("--saved-document", action="store_true", help="Open the Archiver saved HTML and tag example")
args = p.parse_args()
if args.grid_docking and (not args.archiver or args.connection_form):
p.error("--grid-docking requires --archiver and a separate run from --connection-form")
if args.connection_form and not args.archiver:
p.error("--connection-form requires --archiver")
if (args.connection_form or args.grid_docking or args.saved_document) and not args.archiver:
p.error("Selecting an Archiver view requires --archiver")
base = Path(tempfile.mkdtemp(prefix="neitzel-designer-host-")).resolve()
project = base / "project"
if args.archiver:
@@ -39,6 +39,8 @@ if args.archiver:
view = "FolderTab"
shutil.copyfile(args.grid_docking, project / "src/main/resources/ReferenceWorkspace.fxml")
file = project / f"src/main/resources/de/neitzel/archiver/ui/{view}.fxml"
if args.saved_document:
file = project / "src/designer/resources/de/neitzel/archiver/preview/SavedDocument.fxml"
else:
subprocess.run([sys.executable, ROOT / "scripts/prepare-fixture-host.py", "--destination", project,
"--target-java-home", args.target_java_home, "--mode", args.mode], check=True)
@@ -64,17 +66,20 @@ else:
shutil.copyfile(ROOT / "designer-kit-ui/target/designer-kit-ui-0.1.0-SNAPSHOT-tests.jar", checks)
jars = [*(args.idea_home / "lib").glob("*.jar"), *(base / "plugins").rglob("*.jar"), *(args.idea_home / "plugins/platform-problemView-plugin").rglob("*.jar")]
sources = ROOT / "integration-tests/idea"
probe = "ArchiveWorkflowProbe" if args.archiver else "WorkflowProbe"
suite = "Archive"
if args.connection_form:
probe = "ConnectionWorkflowProbe"
if args.grid_docking:
probe = "GridDockWorkflowProbe"
suite = "Connection"
elif args.grid_docking:
suite = "GridDock"
elif args.saved_document:
suite = "SavedDocument"
probe = f"{suite}WorkflowProbe" if args.archiver else "WorkflowProbe"
files = [sources / "WorkflowProbe.java"]
if args.connection_form or args.saved_document:
files.append(sources / "FormWorkflowProbe.java")
if args.archiver:
files.append(sources / f"{probe}.java")
target_probe = "ConnectionTargetProbe" if args.connection_form else "ArchiveTargetProbe"
if args.grid_docking:
target_probe = "GridDockTargetProbe"
target_probe = f"{suite}TargetProbe"
agent_classes = base / "agent-classes"
agent_classes.mkdir()
subprocess.run([args.java_home / "bin/javac", "-cp", os.pathsep.join(map(str,jars)), "-d", agent_classes,