From e4fec9e4e068876b30649d0897e8724bd83b40af Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Wed, 15 Apr 2026 20:45:42 -0700 Subject: [PATCH] =?UTF-8?q?test:=20skip=20onboarding=20config=20tests=20wh?= =?UTF-8?q?en=20PyYAML=20unavailable,=20remove=20duplicate=20definition=20?= =?UTF-8?q?=E2=80=94=20v0.50.60?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merges #564. Adds PyYAML skip guards to two onboarding tests. Removes duplicate _HAS_YAML/_needs_yaml block. No production code changed. 1319 tests pass. --- CHANGELOG.md | 5 +++++ static/index.html | 2 +- tests/test_onboarding_existing_config.py | 21 ++++++++++----------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e33cf..4a2b6e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Hermes Web UI -- Changelog +## [v0.50.60] — 2026-04-16 + +### Changed +- **Test robustness** — two onboarding setup tests (`test_setup_allowed_with_confirm_overwrite`, `test_setup_allowed_when_no_config_exists`) now skip gracefully when PyYAML is not installed in the test environment, matching the pattern already used in `test_onboarding_mvp.py`. No production code changed. (PR #564) + ## [v0.50.59] — 2026-04-16 ### Fixed diff --git a/static/index.html b/static/index.html index 9a1f7aa..6d02137 100644 --- a/static/index.html +++ b/static/index.html @@ -553,7 +553,7 @@
System
Instance version and access controls.
- v0.50.59 + v0.50.60
diff --git a/tests/test_onboarding_existing_config.py b/tests/test_onboarding_existing_config.py index e644b66..952bcee 100644 --- a/tests/test_onboarding_existing_config.py +++ b/tests/test_onboarding_existing_config.py @@ -20,6 +20,14 @@ from unittest import mock import pytest +# Skip tests that call apply_onboarding_setup → _save_yaml_config when PyYAML is missing +try: + import yaml as _yaml + _HAS_YAML = True +except ImportError: + _HAS_YAML = False +_needs_yaml = pytest.mark.skipif(not _HAS_YAML, reason="PyYAML not installed — onboarding setup tests require it") + # --------------------------------------------------------------------------- # Unit tests — no live server needed, test logic directly via imports # --------------------------------------------------------------------------- @@ -139,6 +147,7 @@ class TestApplyOnboardingSetupGuard: ) assert result.get("requires_confirm") is True + @_needs_yaml def test_setup_allowed_with_confirm_overwrite(self): """With confirm_overwrite=True, setup may proceed (will hit real logic).""" import api.onboarding as mod @@ -163,6 +172,7 @@ class TestApplyOnboardingSetupGuard: finally: fake_config_path.unlink(missing_ok=True) + @_needs_yaml def test_setup_allowed_when_no_config_exists(self): """Fresh install: no config.yaml → setup proceeds normally (no blocking error).""" import api.onboarding as mod @@ -232,17 +242,6 @@ requires_server = pytest.mark.skipif( ) -try: - import yaml as _yaml - _HAS_YAML = True -except ImportError: - _HAS_YAML = False - -_needs_yaml = pytest.mark.skipif( - not _HAS_YAML, reason="PyYAML not installed" -) - - @requires_server class TestOnboardingGateIntegration: """Live-server integration tests for the onboarding gate fix."""