Repository navigation
Conversation
getConfigPath() fell back to the checkout's config/config.toml whenever CONFIG_PATH named a file not yet written. Backend tests point CONFIG_PATH at a fresh temp dir, so on any machine with a deployed config they read the real one and created profiles beside it: config/profiles/cold_flow/ and taken/ appeared in the checkout after npm test, and the calibration-profile tests failed on 'already exists' from the second run on. With CONFIG_PATH set, it is now the only candidate; the existing self-heal generates it from the profiles beside it. Unset, the lookup is unchanged. Production never sets CONFIG_PATH (the deploy scripts say so); the integration harness and replay_past_db.sh write their file first. config-path-explicit.test.ts puts a decoy where the fallback looks and fails on the old code.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running the DAQ backend's
npm teston a machine with a deployeddaq-server/config/config.tomlwrites into the checkout:config/profiles/cold_flow/andconfig/profiles/taken/appear. From the second run on,config-profile-create-calibration.test.tsfails withProfile "cold_flow" already exists. This leak has now turned up twice.Cause
The tests set
CONFIG_PATHto aconfig.tomlin a temp dir that they haven't written yet. WhenCONFIG_PATHnamed a missing file,getConfigPath()fell back tocwd/../../config/config.toml, which is the developer's real config, and the profile-creation handlers wrote next to it. A fresh clone has no generatedconfig.toml, so the tests passed there and CI never saw the problem.Fix
When
CONFIG_PATHis set, it's the only pathgetConfigPath()tries. If the file doesn't exist yet, the existing self-heal generates it from the profiles in the same folder. WhenCONFIG_PATHis unset, the lookup is unchanged.Nothing that runs the real stand changes:
CONFIG_PATH;sensor-backend.serviceandstart_systemd_sim.shsay so explicitly.test_integration.shandreplay_past_db.shboth write their config file before starting the backend.Test
config-path-explicit.test.tsputs a decoyconfig.tomlwhere the fallback looks and pointsCONFIG_PATHat a missing file that has a profile next to it. The test fails on the old code (it returns the decoy) and passes with the fix.With a real
config/config.tomlpresent, the full backend suite gives 357 passed and 1 failed, and nothing is written toconfig/profiles/. The failure isvideo.test.ts"on macOS is the Bonjour name", which also fails onmainand is unrelated.Merges cleanly with #223 (which moves this file to
star_server/; git follows the rename).