feat(profile): warn when a profile sets a key floci does not read (#37)

This commit is contained in:
Hector Ventura authored and GitHub committed 2026-10-08 22:47:51 -05:00
1 parent 01d6133548
commit 22668a1200
7 files changed
+125

No files matched your search

@@ -89,6 +89,23 @@ class MissingProfileTest {
assertTrue(out.toString().contains("enforced"), out.toString()); // help wraps the image value
}
/** BL-013: a misspelled key is still ignored, but no longer silently. */
@Test
void aMisspelledKeyIsReportedOnceAndTheProfileStillApplies() throws Exception {
writeProfile("typo-key", "container: floci-typo\npersist_dir: /data\n");
int[] exit = new int[1];
String err = captureStderr(() -> {
cli().parseArgs("start", "--profile", "typo-key");
return 0;
}, exit);
assertEquals(0, exit[0]);
assertTrue(err.contains("Profile 'typo-key' sets 'persist_dir'"), err);
assertTrue(err.contains("persistDir"), err);
assertEquals(1, err.split("Warning").length - 1, err);
}
@Test
void helpStillWorksWithABadProfile() {
int[] exit = new int[1];