diff --git a/pkgs/id/nix/tests/e2e-test.nix b/pkgs/id/nix/tests/e2e-test.nix index 7fc97fdd5..f543334d0 100644 --- a/pkgs/id/nix/tests/e2e-test.nix +++ b/pkgs/id/nix/tests/e2e-test.nix @@ -78,8 +78,8 @@ f"chromium --headless --disable-gpu --no-sandbox --dump-dom " f"--timeout=15000 {BASE}/ 2>/dev/null" ) - assert "Files" in home_dom, f"[port {port}] Home page DOM missing 'Files': {home_dom[:500]}" - assert "new-file-name" in home_dom, f"[port {port}] Home page missing new file form" + assert "Home - id" in home_dom, f"[port {port}] Home page DOM missing title: {home_dom[:500]}" + assert "Browse files" in home_dom, f"[port {port}] Home page DOM missing files link" # ── Create a file for further tests ─────────────────────────────── create_resp = server.succeed( @@ -93,7 +93,7 @@ # ── Chromium renders the file in the list ───────────────────────── list_dom = server.succeed( f"chromium --headless --disable-gpu --no-sandbox --dump-dom " - f"--timeout=15000 {BASE}/ 2>/dev/null" + f"--timeout=15000 {BASE}/files 2>/dev/null" ) assert "browser-test.txt" in list_dom, f"[port {port}] Created file not in rendered list" @@ -138,14 +138,14 @@ # Verify it appears in primary's DOM primary_dom = server.succeed( "chromium --headless --disable-gpu --no-sandbox --dump-dom " - "--timeout=15000 http://localhost:4173/ 2>/dev/null" + "--timeout=15000 http://localhost:4173/files 2>/dev/null" ) assert "isolation-dom.txt" in primary_dom, "Isolation file missing from primary DOM" # Verify it does NOT appear in secondary's DOM secondary_dom = server.succeed( "chromium --headless --disable-gpu --no-sandbox --dump-dom " - "--timeout=15000 http://localhost:4174/ 2>/dev/null" + "--timeout=15000 http://localhost:4174/files 2>/dev/null" ) assert "isolation-dom.txt" not in secondary_dom, "Isolation FAILED: file leaked to secondary instance DOM" ''; diff --git a/pkgs/id/nix/tests/integration-test.nix b/pkgs/id/nix/tests/integration-test.nix index 8a465fa3c..b463c48c4 100644 --- a/pkgs/id/nix/tests/integration-test.nix +++ b/pkgs/id/nix/tests/integration-test.nix @@ -24,7 +24,10 @@ virtualisation.cores = 2; }; - globalTimeout = 300; # 5 minutes + # The complete cli_integration binary runs roughly 134 tests with two + # workers, and individual child processes may wait up to three minutes. + # Five minutes is enough for the VM to boot but not for the full suite. + globalTimeout = 1200; # 20 minutes for the full integration suite testScript = '' ID_BIN = "${idPackage}/bin/id" diff --git a/pkgs/id/nix/tests/serve-test.nix b/pkgs/id/nix/tests/serve-test.nix index 78899550f..851a21e29 100644 --- a/pkgs/id/nix/tests/serve-test.nix +++ b/pkgs/id/nix/tests/serve-test.nix @@ -59,9 +59,10 @@ """Run the full API test suite against a single instance.""" BASE = f"http://localhost:{port}" - # ── Home page renders ───────────────────────────────────────────── + # ── Discovery home page renders ──────────────────────────────────── html = server.succeed(f"curl -sf {BASE}/") - assert "Files" in html, f"[port {port}] Home page missing 'Files': {html[:200]}" + assert "Home - id" in html, f"[port {port}] Home page missing title: {html[:200]}" + assert "Browse files" in html, f"[port {port}] Home page missing files link: {html[:200]}" # ── Static assets served ────────────────────────────────────────── server.succeed(f"curl -sf -o /dev/null {BASE}/assets/manifest.json") @@ -78,7 +79,7 @@ file_hash = resp["hash"] # ── File appears in list ────────────────────────────────────────── - list_html = server.succeed(f"curl -sf {BASE}/") + list_html = server.succeed(f"curl -sf {BASE}/files") assert "hello.txt" in list_html, f"[port {port}] Created file not in file list" # ── File accessible by name ─────────────────────────────────────── @@ -157,11 +158,11 @@ assert iso.get("name") == "isolation-test.txt", f"Isolation file creation failed: {iso_resp}" # Verify it exists on primary - primary_html = server.succeed("curl -sf http://localhost:3000/") + primary_html = server.succeed("curl -sf http://localhost:3000/files") assert "isolation-test.txt" in primary_html, "Isolation file missing on primary" # Verify it does NOT exist on secondary - secondary_html = server.succeed("curl -sf http://localhost:3001/") + secondary_html = server.succeed("curl -sf http://localhost:3001/files") assert "isolation-test.txt" not in secondary_html, "Isolation FAILED: file leaked to secondary instance" ''; }