Remove the secrets directory flag and update fixtures

This commit is contained in:
2026-11-23 14:23:53 +00:00
parent a4491a8517
commit 6175945230
30 changed files with 146 additions and 334 deletions

View File

@@ -10,6 +10,7 @@ import (
"testing"
"gitea.maximumdirect.net/eric/narratio/internal/config"
configkit "go.maximumdirect.net/configkit"
)
func TestExecuteConfigUsesInvocationPipelineLoader(t *testing.T) {
@@ -21,9 +22,9 @@ func TestExecuteConfigUsesInvocationPipelineLoader(t *testing.T) {
t.Run(subcommand, func(t *testing.T) {
calls := 0
deps := commandDependencies{
loadPipelineConfig: func(path string, opts config.PipelineLoadOptions) (*config.PipelineConfig, error) {
loadPipelineSource: func(source configkit.Source, opts config.PipelineLoadOptions) (*config.PipelineConfig, error) {
calls++
return config.LoadPipelineWithOptions(path, opts)
return config.LoadPipelineSourceWithOptions(source, opts)
},
}
var stdout, stderr bytes.Buffer
@@ -134,11 +135,12 @@ func TestNativeBundleInspectionAndExecutionAgree(t *testing.T) {
}
secrets := filepath.Join(bundle, "secrets")
mustWriteSecretFile(t, filepath.Join(secrets, secretName), secretValue)
configureTestSecrets(t, pipeline, secrets)
t.Chdir(root)
campaign := filepath.Join(bundle, "campaigns", "sample-campaign", "campaign.yml")
common := []string{"--campaign-file", campaign, "--secrets-dir", secrets}
common := []string{"--campaign-file", campaign}
for _, operation := range []string{"validate", "show", "sources"} {
args := []string{"config", operation, "--secrets-dir", secrets}
args := []string{"config", operation}
out := nativeInspectionForTest(t, args)
if strings.Contains(out, secretValue) {
t.Fatalf("%s exposed credential value", operation)
@@ -151,7 +153,7 @@ func TestNativeBundleInspectionAndExecutionAgree(t *testing.T) {
if !strings.Contains(catalog, "character_meta_arannis") {
t.Fatal("domain catalog omitted concrete family member")
}
diff := nativeInspectionForTest(t, []string{"config", "diff", "--details", "--against-overlay", "testing", "--secrets-dir", secrets, "--format", "json"})
diff := nativeInspectionForTest(t, []string{"config", "diff", "--details", "--against-overlay", "testing", "--format", "json"})
if !strings.Contains(diff, "/audita/proposal_profile") || strings.Contains(diff, secretValue) {
t.Fatalf("unexpected diff: %s", diff)
}