|
|
@@ -66,36 +66,6 @@ def chrome_installed():
|
|
|
pytest.fail(f'install-browsers exited 0 but no chromium dirs found in {browsers}')
|
|
|
|
|
|
|
|
|
-def test_refresh_all_flags_match_config():
|
|
|
- """ENABLED flags in refresh-all.ts must match disabled in config.json, with full coverage."""
|
|
|
- ts_path = _ts_dir() / 'scripts' / 'refresh-all.ts'
|
|
|
- src = ts_path.read_text()
|
|
|
-
|
|
|
- # Parse: ENABLED: Record<string, boolean> = { key: true/false, ... }
|
|
|
- block = re.search(r'const ENABLED[^=]*=\s*\{([^}]+)\}', src)
|
|
|
- assert block, 'Could not find ENABLED block in refresh-all.ts'
|
|
|
- ts_flags: dict[str, bool] = {}
|
|
|
- for m in re.finditer(r'(\w+)\s*:\s*(true|false)', block.group(1)):
|
|
|
- ts_flags[m.group(1)] = m.group(2) == 'true'
|
|
|
-
|
|
|
- cfg_services = get_config().services
|
|
|
- cfg_keys = set(cfg_services.keys())
|
|
|
- ts_keys = set(ts_flags.keys())
|
|
|
-
|
|
|
- missing = cfg_keys - ts_keys
|
|
|
- assert not missing, f'Services in config.json missing from refresh-all.ts ENABLED: {missing}'
|
|
|
-
|
|
|
- extra = ts_keys - cfg_keys
|
|
|
- assert not extra, f'Services in refresh-all.ts ENABLED not in config.json: {extra}'
|
|
|
-
|
|
|
- mismatches = {
|
|
|
- k for k in cfg_keys
|
|
|
- if ts_flags[k] != (not cfg_services[k].disabled)
|
|
|
- }
|
|
|
- assert not mismatches, (
|
|
|
- f'ENABLED flags in refresh-all.ts do not match config.json disabled for: {mismatches}\n'
|
|
|
- + '\n'.join(f' {k}: ts={ts_flags[k]} config_disabled={cfg_services[k].disabled}' for k in sorted(mismatches))
|
|
|
- )
|
|
|
|
|
|
|
|
|
def test_install_chrome(chrome_installed):
|