Adopt ConfigKit overlays for pipeline selection
This commit is contained in:
@@ -256,12 +256,12 @@ func TestAssembledSplitBundleCommandsUseOneEffectiveFamilyConfiguration(t *testi
|
||||
if err := ConfigValidate(context.Background(), []string{"--config", pipelinePath, "--campaign-file", campaignPath}, &validated); err != nil {
|
||||
t.Fatalf("validate production base: %v", err)
|
||||
}
|
||||
if !strings.Contains(validated.String(), "profile=none") {
|
||||
t.Fatalf("validate output = %q, want unprofiled production base", validated.String())
|
||||
if !strings.Contains(validated.String(), "overlay=none") {
|
||||
t.Fatalf("validate output = %q, want production base", validated.String())
|
||||
}
|
||||
for _, command := range []func(context.Context, []string, io.Writer) error{ConfigShow, ConfigSources} {
|
||||
if err := command(context.Background(), []string{
|
||||
"--config", pipelinePath, "--campaign-file", campaignPath, "--profile", "testing",
|
||||
"--config", pipelinePath, "--campaign-file", campaignPath, "--overlay", "testing",
|
||||
}, io.Discard); err != nil {
|
||||
t.Fatalf("testing inspection command %T: %v", command, err)
|
||||
}
|
||||
@@ -278,13 +278,13 @@ func TestAssembledSplitBundleCommandsUseOneEffectiveFamilyConfiguration(t *testi
|
||||
|
||||
common := []string{
|
||||
"2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath,
|
||||
"--session", sessionPath, "--profile", "testing",
|
||||
"--session", sessionPath, "--overlay", "testing",
|
||||
}
|
||||
var planned bytes.Buffer
|
||||
if err := Plan(context.Background(), common, &planned); err != nil {
|
||||
t.Fatalf("plan testing bundle: %v", err)
|
||||
}
|
||||
if !strings.Contains(planned.String(), "profile=testing") {
|
||||
if !strings.Contains(planned.String(), "overlay=testing") {
|
||||
t.Fatalf("plan output = %q, want testing provenance", planned.String())
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ func TestAssembledSplitBundleCommandsUseOneEffectiveFamilyConfiguration(t *testi
|
||||
if !reflect.DeepEqual(capturedPlan.Names(), []string{"analyze"}) {
|
||||
t.Fatalf("bounded plan = %#v, want analyze only", capturedPlan.Names())
|
||||
}
|
||||
if profile, ok := config.SelectedPipelineProfile(capturedCfg.Pipeline); !ok || profile.Name != "testing" {
|
||||
if profile, ok := config.SelectedPipelineOverlay(capturedCfg.Pipeline); !ok || profile.Name != "testing" {
|
||||
t.Fatalf("captured profile = %#v, selected=%t", profile, ok)
|
||||
}
|
||||
if digest := config.EffectivePipelineDigest(capturedCfg.Pipeline); digest == "" || !strings.Contains(runOut.String(), "digest="+digest) {
|
||||
@@ -391,7 +391,7 @@ func loadAssembledSplitBundleConfig(t *testing.T, profile string) *config.Config
|
||||
pipelinePath, campaignPath, sessionPath := assembledSplitBundlePaths()
|
||||
options := config.SessionLoadOptions{}
|
||||
if profile != "" {
|
||||
options.Profile = &profile
|
||||
options.Overlay = &profile
|
||||
}
|
||||
cfg, err := config.LoadWithSessionOptions(pipelinePath, campaignPath, sessionPath, options)
|
||||
if err != nil {
|
||||
@@ -415,8 +415,8 @@ func assertAssembledProvenance(t *testing.T, store *manifest.LocalStore, summary
|
||||
t.Fatal(err)
|
||||
}
|
||||
value := session.EffectiveConfig
|
||||
profileMatches := value != nil && ((profile == "" && value.SelectedProfile == nil) ||
|
||||
(profile != "" && value.SelectedProfile != nil && value.SelectedProfile.Name == profile))
|
||||
profileMatches := value != nil && ((profile == "" && value.SelectedOverlay == nil) ||
|
||||
(profile != "" && value.SelectedOverlay != nil && value.SelectedOverlay.Name == profile))
|
||||
if !profileMatches || value.EffectiveConfigDigest != digest {
|
||||
t.Fatalf("effective configuration provenance = %#v, want profile=%q digest=%q", value, profile, digest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user