Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c20a302
wip
pirate Mar 18, 2026
189104f
Update abx_plugins/plugins/chrome/on_Snapshot__10_chrome_tab.daemon.b…
pirate Mar 18, 2026
884f56a
bump dep version
pirate Mar 18, 2026
371082c
fix executing hooks and centralize helpers
pirate Mar 18, 2026
f4ee82b
Update abx_plugins/plugins/chrome/on_Snapshot__10_chrome_tab.daemon.b…
pirate Mar 18, 2026
009c6bb
fix script exec
pirate Mar 18, 2026
393a55d
centralize CDP session creation
pirate Mar 18, 2026
3598d4c
setAutoAttach on connect
pirate Mar 18, 2026
6386801
fix failing tests
pirate Mar 18, 2026
35a2272
add new test
pirate Mar 18, 2026
e13c73b
more tests for chrome
pirate Mar 18, 2026
5a91514
rename waitForPageLoaded
pirate Mar 18, 2026
e732eb4
test: cover re-invoked external chrome adoption
pirate Mar 18, 2026
a969b44
fix: reuse explicit chrome cdp sessions in place
pirate Mar 18, 2026
c6bcfa5
tweak claude prompt
pirate Mar 18, 2026
c39a027
show stdout/stderr in ci output
pirate Mar 18, 2026
47510a5
update chrome plugin readme
pirate Mar 18, 2026
562a32e
more chrome deduping and cleanup
pirate Mar 18, 2026
03f6b67
Update abx_plugins/plugins/chrome/chrome_utils.js
pirate Mar 18, 2026
836e036
fix error strs
pirate Mar 18, 2026
79c36c8
more stderr/stdout in ci logs
pirate Mar 18, 2026
fcd3307
fix pid required
pirate Mar 18, 2026
9b8ec62
fix stale session recovery
pirate Mar 18, 2026
231310b
chrome teardown fixesgap
pirate Mar 18, 2026
5776f19
better pytest output handling
pirate Mar 18, 2026
86f2167
centralize more readyness checking
pirate Mar 19, 2026
8deba6f
fix tests that used interpreeter to run hooks unnecessarily
pirate Mar 19, 2026
1f3de6e
Update abx_plugins/plugins/ublock/tests/test_ublock.py
pirate Mar 19, 2026
3b30034
Update abx_plugins/plugins/wget/tests/test_wget.py
pirate Mar 19, 2026
b810246
Update abx_plugins/plugins/readability/tests/test_readability.py
pirate Mar 19, 2026
fdba8c3
Update abx_plugins/plugins/defuddle/tests/test_defuddle.py
pirate Mar 19, 2026
0f11909
Update abx_plugins/plugins/modalcloser/tests/test_modalcloser.py
pirate Mar 19, 2026
1a4ebc5
fix paths
pirate Mar 19, 2026
e6b969d
fixes
pirate Mar 19, 2026
1578d0f
Update abx_plugins/plugins/chrome/tests/test_chrome.py
pirate Mar 19, 2026
2fde2ca
check emitte drecord
pirate Mar 19, 2026
2d38e91
fix imports
pirate Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
needs: discover-tests
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
ABX_PYTEST_TEE_SUBPROCESS_OUTPUT: "1"

strategy:
fail-fast: false
Expand Down Expand Up @@ -135,7 +136,7 @@ jobs:

- name: Run test - ${{ matrix.test.name }}
run: |
uv run pytest -xvs "${{ matrix.test.path }}" --basetemp="$RUNNER_TEMP/pytest-out"
uv run pytest -xvs -rA "${{ matrix.test.path }}" --basetemp="$RUNNER_TEMP/pytest-out"
env:
TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}
CHROME_SANDBOX: "false"
Expand Down
Empty file modified abx_plugins/plugins/__init__.py
100644 → 100755
Empty file.
13 changes: 3 additions & 10 deletions abx_plugins/plugins/accessibility/on_Snapshot__39_accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ const {
} = require('../base/utils.js');
ensureNodeModuleResolution(module);
const puppeteer = require('puppeteer-core');
const {
waitForChromeSession,
connectToPage,
waitForPageLoaded,
} = require('../chrome/chrome_utils.js');
const { connectToPage } = require('../chrome/chrome_utils.js');

// Extractor metadata
const PLUGIN_NAME = 'accessibility';
Expand All @@ -52,18 +48,15 @@ async function extractAccessibility(url, timeoutMs) {
let browser = null;

try {
if (!(await waitForChromeSession(CHROME_SESSION_DIR, Math.min(timeoutMs, 1000), true))) {
return { success: false, error: 'No Chrome session found (chrome plugin must run first)' };
}

const connection = await connectToPage({
chromeSessionDir: CHROME_SESSION_DIR,
timeoutMs,
waitForNavigationComplete: true,
postLoadDelayMs: 200,
puppeteer,
});
browser = connection.browser;
const page = connection.page;
await waitForPageLoaded(CHROME_SESSION_DIR, timeoutMs * 4, 200);

// Get accessibility snapshot
const accessibilityTree = await page.accessibility.snapshot({ interestingOnly: true });
Expand Down
Empty file modified abx_plugins/plugins/accessibility/tests/__init__.py
100644 → 100755
Empty file.
16 changes: 5 additions & 11 deletions abx_plugins/plugins/accessibility/tests/test_accessibility.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def test_accessibility_extracts_page_outline(self, chrome_test_url):

# Run accessibility hook with the active Chrome session
result = subprocess.run(
[
"node",
str(ACCESSIBILITY_HOOK),
[str(ACCESSIBILITY_HOOK),
f"--url={test_url}",
f"--snapshot-id={snapshot_id}",
],
Expand Down Expand Up @@ -133,9 +131,7 @@ def test_accessibility_disabled_skips(self, chrome_test_url):
env["ACCESSIBILITY_ENABLED"] = "False"

result = subprocess.run(
[
"node",
str(ACCESSIBILITY_HOOK),
[str(ACCESSIBILITY_HOOK),
f"--url={test_url}",
f"--snapshot-id={snapshot_id}",
],
Expand All @@ -158,7 +154,7 @@ def test_accessibility_missing_url_argument(self):
snapshot_id = "test-missing-url"

result = subprocess.run(
["node", str(ACCESSIBILITY_HOOK), f"--snapshot-id={snapshot_id}"],
[str(ACCESSIBILITY_HOOK), f"--snapshot-id={snapshot_id}"],
cwd=str(self.temp_dir),
capture_output=True,
text=True,
Expand All @@ -174,7 +170,7 @@ def test_accessibility_missing_snapshot_id_argument(self, chrome_test_url):
test_url = chrome_test_url

result = subprocess.run(
["node", str(ACCESSIBILITY_HOOK), f"--url={test_url}"],
[str(ACCESSIBILITY_HOOK), f"--url={test_url}"],
cwd=str(self.temp_dir),
capture_output=True,
text=True,
Expand All @@ -191,9 +187,7 @@ def test_accessibility_with_no_chrome_session(self, chrome_test_url):
snapshot_id = "test-no-chrome"

result = subprocess.run(
[
"node",
str(ACCESSIBILITY_HOOK),
[str(ACCESSIBILITY_HOOK),
f"--url={test_url}",
f"--snapshot-id={snapshot_id}",
],
Expand Down
2 changes: 1 addition & 1 deletion abx_plugins/plugins/apt/on_Binary__13_apt_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# "rich-click",
# "abx-pkg",
# ]
# ///
Expand Down
Empty file modified abx_plugins/plugins/apt/tests/__init__.py
100644 → 100755
Empty file.
16 changes: 4 additions & 12 deletions abx_plugins/plugins/apt/tests/test_apt_provider.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def test_hook_script_exists(self):
def test_hook_skips_when_apt_not_allowed(self):
"""Hook should skip when apt not in allowed binproviders."""
result = subprocess.run(
[
sys.executable,
str(INSTALL_HOOK),
[str(INSTALL_HOOK),
"--name=wget",
"--binary-id=test-uuid",
"--machine-id=test-machine",
Expand All @@ -74,9 +72,7 @@ def test_hook_detects_apt(self):
"""Hook should detect apt binary when available."""
assert apt_available(), "apt not installed"
result = subprocess.run(
[
sys.executable,
str(INSTALL_HOOK),
[str(INSTALL_HOOK),
"--name=nonexistent-pkg-xyz123",
"--binary-id=test-uuid",
"--machine-id=test-machine",
Expand All @@ -94,9 +90,7 @@ def test_hook_handles_overrides(self):
overrides = json.dumps({"apt": {"install_args": ["custom-package-name"]}})

result = subprocess.run(
[
sys.executable,
str(INSTALL_HOOK),
[str(INSTALL_HOOK),
"--name=test-pkg",
"--binary-id=test-uuid",
"--machine-id=test-machine",
Expand All @@ -120,9 +114,7 @@ def test_detect_existing_binary(self):
assert apt_available(), "apt not installed"
# Check for a binary that's almost certainly installed (like 'ls' or 'bash')
result = subprocess.run(
[
sys.executable,
str(INSTALL_HOOK),
[str(INSTALL_HOOK),
"--name=bash",
"--binary-id=test-uuid",
"--machine-id=test-machine",
Expand Down
Empty file modified abx_plugins/plugins/archivedotorg/tests/__init__.py
100644 → 100755
Empty file.
12 changes: 3 additions & 9 deletions abx_plugins/plugins/archivedotorg/tests/test_archivedotorg.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def test_submits_to_archivedotorg():
env["ARCHIVEDOTORG_TIMEOUT"] = "45"

result = subprocess.run(
[
sys.executable,
str(ARCHIVEDOTORG_HOOK),
[str(ARCHIVEDOTORG_HOOK),
"--url",
TEST_URL,
"--snapshot-id",
Expand Down Expand Up @@ -77,9 +75,7 @@ def test_config_save_archivedotorg_false_skips():
env["ARCHIVEDOTORG_ENABLED"] = "False"

result = subprocess.run(
[
sys.executable,
str(ARCHIVEDOTORG_HOOK),
[str(ARCHIVEDOTORG_HOOK),
"--url",
TEST_URL,
"--snapshot-id",
Expand Down Expand Up @@ -115,9 +111,7 @@ def test_handles_timeout():
env["TIMEOUT"] = "1"

result = subprocess.run(
[
sys.executable,
str(ARCHIVEDOTORG_HOOK),
[str(ARCHIVEDOTORG_HOOK),
"--url",
TEST_URL,
"--snapshot-id",
Expand Down
Empty file modified abx_plugins/plugins/base/__init__.py
100644 → 100755
Empty file.
9 changes: 1 addition & 8 deletions abx_plugins/plugins/base/test_utils.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import json
import os
import subprocess
import sys
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -134,13 +133,7 @@ def run_hook(
if env is None:
env = os.environ.copy()

# Determine interpreter based on file extension
if hook_script.suffix == ".py":
cmd = [sys.executable, str(hook_script)]
elif hook_script.suffix == ".js":
cmd = ["node", str(hook_script)]
else:
cmd = [str(hook_script)]
cmd = [str(hook_script)]

cmd.extend([f"--url={url}", f"--snapshot-id={snapshot_id}"])
if extra_args:
Expand Down
Empty file modified abx_plugins/plugins/base/tests/__init__.py
100644 → 100755
Empty file.
Empty file modified abx_plugins/plugins/base/utils.js
100644 → 100755
Empty file.
Empty file modified abx_plugins/plugins/base/utils.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion abx_plugins/plugins/brew/on_Binary__12_brew_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# "rich-click",
# "abx-pkg",
# ]
# ///
Expand Down
Loading
Loading