Files
qwenpaw/tests/integration/test_chrome_plugin_bundle.py
agent-radar 1a3a4ccde1
Creator App Tests / PR Spam Gate (push) Skipped
Frontend Tests / PR Spam Gate (push) Skipped
NPM Format (website & console) / PR Spam Gate (push) Skipped
Pre-commit Checks / PR Spam Gate (push) Skipped
QwenPaw Creator Plugin Release / check-version (push) Canceled after 0s
QwenPaw Creator Plugin Release / upload-oss (push) Canceled after 0s
Tests / PR Spam Gate (push) Skipped
CodeQL / CodeQL (python) (push) Canceled after 0s
CodeQL / CodeQL (typescript) (push) Canceled after 0s
Creator App Tests / Creator Backend Tests (push) Canceled after 0s
Creator App Tests / Creator UI Build & Tests (push) Canceled after 0s
E2E Smoke Tests / Playwright UI Smoke (push) Canceled after 0s
Frontend Tests / Detect console changes (push) Canceled after 0s
NPM Format (website & console) / website format check (push) Canceled after 0s
NPM Format (website & console) / console format check (push) Canceled after 0s
Pre-commit Checks / Pre-commit (push) Canceled after 0s
QwenPaw Data Plugin Release / check-version (push) Canceled after 0s
Tests / Detect code changes (push) Canceled after 0s
Frontend Tests / Vitest Unit Tests (push) Canceled after 0s
Frontend Tests / Frontend Summary (push) Canceled after 0s
QwenPaw Data Plugin Release / upload-oss (push) Canceled after 0s
Tests / Maintainer Approval (push) Canceled after 0s
Tests / Unit Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - fallback (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p2 (push) Canceled after 0s
Tests / Coverage Report (push) Canceled after 0s
Tests / Test Summary (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:01:50 +08:00

65 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
"""Chrome plugin integration contracts grouped by runtime boundary."""
from __future__ import annotations
import json
from pathlib import Path
import pytest
# test_chrome_selfcontained_plugin.py
PLUGIN = Path("plugins/bundle/chrome")
def _python_files() -> list[Path]:
return [
path
for path in PLUGIN.rglob("*.py")
if "node_modules" not in path.parts
]
@pytest.mark.integration
@pytest.mark.p1
def test_chrome_plugin_bundle_is_self_contained() -> None:
required = (
"assets/extensions/chrome/manifest.json",
"assets/extensions/chrome/service_worker.js",
"assets/scripts/nm_host.py",
"api/routes.py",
"extension_setup.py",
"plugin.py",
"transport/state.py",
)
for relative_path in required:
path = PLUGIN / relative_path
assert path.is_file() and path.stat().st_size > 0
assert not (PLUGIN / "main.py").exists()
assert not (PLUGIN / "action_runtime").exists()
assert not (PLUGIN / "backend").exists()
assert not (PLUGIN / "engine_impl.py").exists()
@pytest.mark.integration
@pytest.mark.p1
def test_chrome_plugin_manifest_uses_standard_plugin_entries() -> None:
manifest = json.loads((PLUGIN / "plugin.json").read_text(encoding="utf-8"))
extension_manifest = json.loads(
(PLUGIN / "assets/extensions/chrome/manifest.json").read_text(
encoding="utf-8",
),
)
assert manifest["entry"] == {
"backend": "plugin.py",
"frontend": "dist/index.js",
}
assert "setup" not in manifest
assert "meta" not in manifest
assert (PLUGIN / "dist/index.js").stat().st_size > 0
assert "browser_core_release" not in extension_manifest