test: tighten CI and console hygiene
(cherry picked from commit bd9e6df71c2e8a6f0902b9b7a348dc21c854141a)
This commit is contained in:
committed by
nesquena-hermes
parent
e37c69cf57
commit
98c9a3de72
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
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.
|
# 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
|
# The package is an optional runtime dep of mcp_server.py — users
|
||||||
# who run the MCP integration install it themselves; CI installs
|
# who run the MCP integration install it themselves; CI installs
|
||||||
|
|||||||
3
pytest.ini
Normal file
3
pytest.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
markers =
|
||||||
|
integration: tests that hit the live test server or external integration surface
|
||||||
@@ -906,7 +906,7 @@ async function _fetchLiveModels(provider, sel){
|
|||||||
const added=_addLiveModelsToSelect(provider,data.models,sel);
|
const added=_addLiveModelsToSelect(provider,data.models,sel);
|
||||||
if(added>0){
|
if(added>0){
|
||||||
if(typeof syncModelChip==='function') syncModelChip();
|
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){
|
}catch(e){
|
||||||
console.debug('[hermes] Live model fetch failed for',provider,e.message);
|
console.debug('[hermes] Live model fetch failed for',provider,e.message);
|
||||||
|
|||||||
29
tests/test_ci_hygiene.py
Normal file
29
tests/test_ci_hygiene.py
Normal 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
|
||||||
Reference in New Issue
Block a user