Skip to content

Commit baf5cb0

Browse files
aledbfclaude
andcommitted
test(cli): hold composeFeatureSets' lockfile read with a unit test
composeFeatureSets carried a mutate-lane marker for the runtime parity case up.compose-config-file-fspath-features-success, which kept every line of it out of mutation testing although unit tests hold all of them but the lockfileRead flag. TestComposeFeatureSets now checks the flag (set only when Features are processed with the lockfile on), and the marker is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 83b9ad4 commit baf5cb0

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎internal/cli/compose_up.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ type composeExtendResult struct {
297297
// returning nil when none are configured. The returned folder (TS dstFolder)
298298
// holds each Feature at its consecutiveId; it is kept because the compose build
299299
// override references it (TS keeps its features folder too).
300-
//
301-
// mutate-lane: TestParityMatrix - up.compose-config-file-fspath-features-success
302-
// processes a compose configuration's Features through it.
303300
func (r *upRunner) composeFeatureSets(ctx context.Context, cfg *config.DevContainer, loadResult *config.LoadResult) ([]*features.Set, string, error) {
304301
opts := r.opts
305302
if len(cfg.Features) > 0 {

‎internal/cli/compose_up_held_test.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ func TestComposeFeatureSets(t *testing.T) {
605605
if sets != nil || dir != "" || err != nil {
606606
t.Errorf("got %v, %q, %v; want nothing", sets, dir, err)
607607
}
608+
if h.r.lockfileRead {
609+
t.Error("lockfileRead with no Features; TS reads the lockfile only to process Features")
610+
}
608611
})
609612
t.Run("local feature", func(t *testing.T) {
610613
h := newComposeHarness(t)
@@ -619,6 +622,9 @@ func TestComposeFeatureSets(t *testing.T) {
619622
if got := sets[0].Features[0].ContainerEnv["HELLO"]; got != "from-host" {
620623
t.Errorf("containerEnv HELLO = %q, want the host variable substituted", got)
621624
}
625+
if !h.r.lockfileRead {
626+
t.Error("lockfileRead = false; processing Features reads the lockfile (TS getLockfilePath reads configFilePath.fsPath)")
627+
}
622628
if st, err := os.Stat(dir); err != nil || !st.IsDir() {
623629
t.Errorf("features folder %q: %v", dir, err)
624630
}
@@ -642,6 +648,9 @@ func TestComposeFeatureSets(t *testing.T) {
642648
if _, _, err := h.r.composeFeatureSets(ctx, cfg, lr); err != nil {
643649
t.Fatal(err)
644650
}
651+
if h.r.lockfileRead {
652+
t.Error("lockfileRead with --no-lockfile")
653+
}
645654
if _, err := os.Stat(filepath.Join(h.dc, "devcontainer-lock.json")); !os.IsNotExist(err) {
646655
t.Errorf("lockfile written with --no-lockfile: %v", err)
647656
}

0 commit comments

Comments
 (0)