Skip to content

The agent that grows with you

chore: remove Windows real-profile PROOF workflow + live test

Teknium00d563224996
diff --git a/.github/workflows/windows-realprofile-e2e.yml b/.github/workflows/windows-realprofile-e2e.yml
deleted file mode 100644
index 61e8ac7462a..00000000000
--- a/.github/workflows/windows-realprofile-e2e.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: Windows real-profile live E2E
-
-# ON-DEMAND PROOF (real-profile browsing, PR #95620 — Windows auto-close).
-#
-# Proves on a REAL windows-latest runner that consented auto-close makes
-# real-profile browsing work with a running Chrome (terminates the locking
-# process tree, lock releases, valid copy produced) and that the default
-# (autoclose off) fails fast rather than hanging.
-#
-# PROOF workflow — reverted before merge; must not land on main. Per-sha
-# concurrency + no cancel-in-progress so runs complete.
-
-on:
- push:
- branches:
- - "feat/real-profile-cdp"
-
-permissions:
- contents: read
-
-concurrency:
- group: windows-realprofile-e2e-${{ github.sha }}
- cancel-in-progress: false
-
-jobs:
- real-profile-e2e:
- name: real-profile auto-close live E2E (windows-latest)
- runs-on: windows-latest
- timeout-minutes: 15
- steps:
- - name: Checkout code
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
-
- - name: Install Google Chrome
- shell: pwsh
- run: choco install googlechrome --no-progress -y --ignore-checksums
-
- - name: Install uv
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # 8.2.0
- with:
- version: "0.9.28"
- enable-cache: true
- cache-dependency-glob: |
- pyproject.toml
- uv.lock
-
- - name: Set up Python 3.11
- uses: ./.github/actions/retry
- with:
- command: uv python install 3.11
-
- - name: Install dependencies
- uses: ./.github/actions/retry
- with:
- command: uv sync --locked --python 3.11 --extra dev
-
- - name: Run real-profile auto-close live E2E
- shell: bash
- run: |
- set -uo pipefail
- uv run --no-sync python -m pytest \
- tests/hermes_cli/test_real_profile_windows_live.py \
- -o addopts= -v -s -p no:cacheprovider
diff --git a/tests/hermes_cli/test_real_profile_windows_live.py b/tests/hermes_cli/test_real_profile_windows_live.py
deleted file mode 100644
index d30656e3f8f..00000000000
--- a/tests/hermes_cli/test_real_profile_windows_live.py
+++ /dev/null
@@ -1,153 +0,0 @@
-"""LIVE Windows E2E: consented auto-close makes real-profile work with a running browser.
-
-windows-latest only. Proves the end state: with browser.real_profile_autoclose
-on, a REAL running Chrome that share-locks its cookie DB is terminated by
-snapshot_real_profile, the lock releases, and a valid signed-in-shaped copy is
-produced. Also proves the default (autoclose off) fails fast, not hangs.
-
-PROOF branch evidence — reverted before merge; never lands on main.
-"""
-from __future__ import annotations
-
-import os
-import shutil
-import sqlite3
-import subprocess
-import sys
-import time
-from pathlib import Path
-
-import pytest
-
-pytestmark = pytest.mark.skipif(sys.platform != "win32", reason="Windows-only live E2E")
-
-_CHROME = (
- r"C:\Program Files\Google\Chrome\Application\chrome.exe",
- r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
-)
-
-
-def _find_chrome():
- for p in _CHROME:
- if os.path.isfile(p):
- return p
- return shutil.which("chrome") or shutil.which("chrome.exe")
-
-
-def _launch_chrome_on(user_data: Path):
- proc = subprocess.Popen(
- [_find_chrome(), "--headless=new", "--disable-gpu", "--no-first-run",
- "--no-default-browser-check", f"--user-data-dir={user_data}",
- "--remote-debugging-port=0", "about:blank"],
- stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
- )
- ck = None
- deadline = time.time() + 60
- while time.time() < deadline and not ck:
- for rel in (r"Default\Network\Cookies", r"Default\Cookies"):
- c = user_data / rel
- if c.is_file() and c.stat().st_size > 0:
- ck = c
- break
- time.sleep(1)
- return proc, ck
-
-
-def _raw_copy_fails(path: str) -> bool:
- try:
- shutil.copy2(path, path + ".rc"); os.unlink(path + ".rc"); return False
- except OSError:
- return True
-
-
-def test_autoclose_off_fails_fast(tmp_path):
- """Default (autoclose off): a running Chrome → fail fast (<30s) with the
- quit/autoclose guidance, never a hang, never a silent copy."""
- if not _find_chrome():
- pytest.skip("no chrome")
- sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
- import hermes_cli.browser_connect as bc
-
- ud = tmp_path / "ud"; ud.mkdir()
- proc, ck = _launch_chrome_on(ud)
- try:
- assert ck is not None, "no cookie db"
- if not _raw_copy_fails(str(ck)):
- pytest.skip("Chrome did not share-lock on this runner")
- orig = bc.real_profile_data_dir
- bc.real_profile_data_dir = lambda b, system=None: str(ud)
- bc._real_profile_autoclose = lambda: False
- try:
- t0 = time.time()
- dst, err = bc.snapshot_real_profile("chrome", src=str(ud))
- elapsed = time.time() - t0
- finally:
- bc.real_profile_data_dir = orig
- assert dst is None and err
- assert "quit" in err.lower() and "real_profile_autoclose" in err
- assert elapsed < 30, f"hung {elapsed:.0f}s — must fail fast"
- finally:
- proc.terminate()
- try: proc.wait(timeout=15)
- except subprocess.TimeoutExpired: proc.kill()
-
-
-def test_autoclose_on_closes_chrome_and_snapshots(tmp_path):
- """Consented auto-close: a running Chrome is terminated, the lock releases,
- and a valid cookie DB copy is produced — real-profile works WITH the browser
- initially running."""
- if not _find_chrome():
- pytest.skip("no chrome")
- sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
- import hermes_cli.browser_connect as bc
-
- ud = tmp_path / "ud"; ud.mkdir()
- proc, ck = _launch_chrome_on(ud)
- try:
- assert ck is not None, "no cookie db"
- if not _raw_copy_fails(str(ck)):
- pytest.skip("Chrome did not share-lock on this runner")
-
- orig = bc.real_profile_data_dir
- bc.real_profile_data_dir = lambda b, system=None: str(ud)
- bc._real_profile_autoclose = lambda: True
- # Isolate the snapshot store under tmp.
- orig_home = bc.get_hermes_home
- bc.get_hermes_home = lambda: tmp_path / "hh"
- try:
- dst, err = bc.snapshot_real_profile("chrome", src=str(ud))
- finally:
- bc.real_profile_data_dir = orig
- bc.get_hermes_home = orig_home
-
- assert err is None, f"auto-close snapshot failed: {err}"
- assert dst is not None
- # Cookie DB may be at the modern Network/ location or the legacy path,
- # depending on the Chrome build — accept either, but it MUST exist and
- # be a valid SQLite cookies DB.
- candidates = [
- Path(dst) / "Default" / "Network" / "Cookies",
- Path(dst) / "Default" / "Cookies",
- ]
- copy_ck = next((c for c in candidates if c.is_file()), None)
- assert copy_ck is not None, (
- "cookie DB not copied after auto-close; Default contents: "
- + repr(sorted(os.listdir(Path(dst) / "Default")) if (Path(dst) / "Default").is_dir() else "NO Default")
- )
- # Valid SQLite with the cookies table.
- con = sqlite3.connect(str(copy_ck))
- try:
- names = {r[0] for r in con.execute(
- "SELECT name FROM sqlite_master WHERE type='table'")}
- finally:
- con.close()
- assert "cookies" in names, f"copied DB missing cookies table: {names}"
- # The original Chrome should now be gone (we terminated its tree).
- assert proc.poll() is not None, "auto-close did not terminate Chrome"
- finally:
- try:
- if proc.poll() is None:
- proc.terminate(); proc.wait(timeout=15)
- except Exception:
- try: proc.kill()
- except Exception: pass