From e0db3f29e5cde4a429d9732b4ae531442faadd5f Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 7 Sep 2026 20:20:09 +0000 Subject: [PATCH] test(config): skip research-edition guards when AW_RESEARCH_EDITION=true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bundle's Research Edition release (v0.14.0b5-research, run 34155142876) failed on every job because release.yml runs patch -> build -> test: scripts/patch_research_edition_config.py flips research_enabled's default to true before `make test` runs, and two guards added in #138 assert the pristine (non-research) defaults: - test_research_edition_sed_target_is_intact asserts the literal `research_enabled = false` sed target is present and unindented — false by construction once the research patch has run. - test_parse_args_defaults_research_off_without_config asserts research is off by default — the research patch turns it on. Both guards are valuable on standard/PR CI (they catch accidental drift in config.py that would silently break the release patch or ship research defaults to normal users) and must stay in place there. They just shouldn't fire on the very build they exist to protect. Skip both via AW_RESEARCH_EDITION=true, which release.yml already sets at job level for research builds and which `make test` inherits. Verified locally: plain pytest still runs and passes both guards; with AW_RESEARCH_EDITION=true they skip cleanly (2 skipped, 0 failed); and with the research patch actually applied plus the env var set (the real release scenario), the full suite is green. Git-Session-Id: cb3d --- tests/test_config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 3c79231..62ab678 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,12 +1,20 @@ +import os import pathlib import re import sys import aw_core.dirs +import pytest import tomlkit from aw_watcher_window import config as config_module +# The Research Edition release build (release.yml) patches config.py with +# scripts/patch_research_edition_config.py before running `make test`, which +# flips research_enabled's default to true. The guards below assert the +# pristine (non-research) defaults and must not fire on that build. +RESEARCH_BUILD = os.environ.get("AW_RESEARCH_EDITION") == "true" + def _patch_config_dir(monkeypatch, tmp_path): """Point aw_core's config dir at tmp_path on all platforms. @@ -65,6 +73,10 @@ def test_research_options_are_read_when_user_sets_them(tmp_path, monkeypatch): assert args.research_app_category_map == {"Microsoft Outlook": "Communication"} +@pytest.mark.skipif( + RESEARCH_BUILD, + reason="research edition build patches this default on purpose (release.yml)", +) def test_research_edition_sed_target_is_intact(): """The Research Edition release build patches this file with sed. @@ -108,6 +120,10 @@ def test_research_edition_sed_target_is_intact(): assert tomlkit.parse(patched_defaults)["research_enabled"] is True +@pytest.mark.skipif( + RESEARCH_BUILD, + reason="research edition build patches this default on purpose (release.yml)", +) def test_parse_args_defaults_research_off_without_config(tmp_path, monkeypatch): """No research keys anywhere => disabled, with empty maps.""" _patch_config_dir(monkeypatch, tmp_path)