diff --git a/docs/milestones/M05/M05_run1.md b/docs/milestones/M05/M05_run1.md index 3f2864ceb..8392ae81e 100644 --- a/docs/milestones/M05/M05_run1.md +++ b/docs/milestones/M05/M05_run1.md @@ -162,4 +162,21 @@ No failures. All jobs passed. |-------|--------|--------| | Smoke Tests | 22876253113 | ✓ success | | Linter | 22876253091 | ✓ success | -| Quality Tests | — | Pending (push to main) | +| Quality Tests | 22877674534 | ✗ failed (test_opts_override) | + +--- + +## 11. Quality Run 1 — Post-Merge (22877674534) + +**Status:** Failed +**Cause:** `test_opts_override.py` — 2 failures + +### Failure + +When `opts.load()` gets `FileNotFoundError` (no config.json), it sets `opts.data = {}`. +`temporary_opts` only applies overrides for keys in `opts.data`, so no overrides are applied and `samples_save` stays at its default (True). + +### Fix + +Ensure a minimal config exists before loading webui so `opts.data` is populated. +Updated `test/conftest.py` `initialize` fixture to create `config.json` with `{"samples_save": True}` when missing. diff --git a/test/conftest.py b/test/conftest.py index 13e88206c..31050ed28 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -45,4 +45,16 @@ def mask_basic_image_base64() -> str: @pytest.fixture(scope="session") def initialize() -> None: + """Load webui; ensure config exists so opts.data is populated for quality tests.""" + import json + import os + + from modules.shared_cmd_options import cmd_opts + + config_path = cmd_opts.ui_settings_file + if not os.path.exists(config_path): + os.makedirs(os.path.dirname(config_path) or ".", exist_ok=True) + with open(config_path, "w", encoding="utf-8") as f: + json.dump({"samples_save": True}, f) + import webui # noqa: F401