diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7649620..2248ffa3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pyyaml>=6.0 pytest pytest-timeout pytest-asyncio + pip install "pyyaml>=6.0" pytest pytest-timeout pytest-asyncio # Install the `mcp` package so tests/test_mcp_server.py runs in CI. # The package is an optional runtime dep of mcp_server.py — users # who run the MCP integration install it themselves; CI installs diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..1c9a4ee0 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + integration: tests that hit the live test server or external integration surface diff --git a/static/ui.js b/static/ui.js index 54ec23b4..28f94817 100644 --- a/static/ui.js +++ b/static/ui.js @@ -906,7 +906,7 @@ async function _fetchLiveModels(provider, sel){ const added=_addLiveModelsToSelect(provider,data.models,sel); if(added>0){ if(typeof syncModelChip==='function') syncModelChip(); - console.log('[hermes] Live models loaded for',provider+':',added,'new models added'); + console.debug('[hermes] Live models loaded for',provider+':',added,'new models added'); } }catch(e){ console.debug('[hermes] Live model fetch failed for',provider,e.message); diff --git a/tests/test_ci_hygiene.py b/tests/test_ci_hygiene.py new file mode 100644 index 00000000..9d1d2688 --- /dev/null +++ b/tests/test_ci_hygiene.py @@ -0,0 +1,29 @@ +"""Small hygiene regression checks for CI and frontend console noise.""" + +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] + + +def test_github_actions_quotes_pyyaml_version_specifier(): + """Unquoted `pyyaml>=6.0` is parsed by the shell as stdout redirection.""" + workflow = ROOT / ".github" / "workflows" / "tests.yml" + text = workflow.read_text(encoding="utf-8") + + assert '"pyyaml>=6.0"' in text or "'pyyaml>=6.0'" in text + assert "pip install pyyaml>=6.0" not in text + + +def test_pytest_integration_marker_is_registered(): + config = ROOT / "pytest.ini" + text = config.read_text(encoding="utf-8") + + assert "markers" in text + assert "integration:" in text + + +def test_live_model_success_log_is_debug_not_default_console_log(): + ui = (ROOT / "static" / "ui.js").read_text(encoding="utf-8") + + assert "console.debug('[hermes] Live models loaded" in ui + assert "console.log('[hermes] Live models loaded" not in ui