From 029907962bbcbe847e533e6c5c530d4eab799c32 Mon Sep 17 00:00:00 2001 From: Jonny Spicer Date: Wed, 12 Aug 2026 22:33:09 -0700 Subject: [PATCH] fix: derive test_actual_config_files' expectations from default.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test ran the merger against the real config/ directory but asserted hardcoded San Francisco coordinates, duplicating data it did not own. 64ff0c9 (2026-03-23) "Replace site-specific defaults with generic placeholders" deliberately changed those values to Greenwich, and the test has failed ever since — unnoticed, because this repo's suite has never run in CI. The test's purpose, per its own docstring, is that the merger propagates the real config into tar1090.env; the particular coordinates are incidental. It now reads them from default.yml. Verified in both directions: changing default.yml's location no longer breaks the test, while breaking the merger's propagation still does. The sibling test_tar1090_env_uses_location_rx keeps its literal values — it writes its own fixture, so those are its data rather than a claim about the repo's config. --- config-merger/test/test_merge_config.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/config-merger/test/test_merge_config.py b/config-merger/test/test_merge_config.py index e331c71..d710d8e 100755 --- a/config-merger/test/test_merge_config.py +++ b/config-merger/test/test_merge_config.py @@ -382,12 +382,23 @@ def test_actual_config_files(self): with open(env_path) as f: env_content = f.read() - # Check expected values from default.yml (San Francisco location) - self.assertIn('RECEIVER_LAT=37.7644', env_content) - self.assertIn('RECEIVER_LON=-122.3954', env_content) - self.assertIn('RECEIVER_ALT=23', env_content) - self.assertIn('ADSBLOL_ENABLED=true', env_content) - self.assertIn('ADSBLOL_RADIUS=40', env_content) + # Read the expected values from default.yml rather than duplicating + # them. This test's purpose is that the merger propagates the real + # config into tar1090.env — not that the config holds any particular + # site. Hardcoding them meant 64ff0c9, which deliberately replaced the + # site-specific defaults with generic placeholders, silently broke this. + defaults = self.read_yaml(default_yml_path) + rx = defaults['location']['rx'] + tar1090 = defaults.get('tar1090', {}) + + self.assertIn(f"RECEIVER_LAT={rx['latitude']}", env_content) + self.assertIn(f"RECEIVER_LON={rx['longitude']}", env_content) + self.assertIn(f"RECEIVER_ALT={rx['altitude']}", env_content) + self.assertIn( + f"ADSBLOL_ENABLED={'true' if tar1090.get('adsblol_fallback') else 'false'}", + env_content, + ) + self.assertIn(f"ADSBLOL_RADIUS={tar1090['adsblol_radius']}", env_content) def test_tar1090_env_with_adsb_source(self): """Test that READSB_NET_CONNECTOR is included in .env when configured"""