test: tighten CI and console hygiene

(cherry picked from commit bd9e6df71c2e8a6f0902b9b7a348dc21c854141a)
This commit is contained in:
ai-ag2026
2026-05-11 12:02:34 +02:00
committed by nesquena-hermes
parent e37c69cf57
commit 98c9a3de72
4 changed files with 34 additions and 2 deletions

View File

@@ -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

3
pytest.ini Normal file
View File

@@ -0,0 +1,3 @@
[pytest]
markers =
integration: tests that hit the live test server or external integration surface

View File

@@ -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);

29
tests/test_ci_hygiene.py Normal file
View File

@@ -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