Migrate examples to shared native configuration
This commit is contained in:
@@ -147,3 +147,17 @@ func TestNativeScopesAndHelpUseSharedLoading(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaintainedSecretsExample(t *testing.T) {
|
||||
t.Setenv("SCRIPTORIUM_EXAMPLE_TOKEN", "")
|
||||
root, err := filepath.Abs(filepath.Join("..", "..", ".."))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Chdir(root)
|
||||
var out, diagnostic bytes.Buffer
|
||||
outcome := Execute(context.Background(), commandkit.Identity{Name: "scriptorium"}, []string{"config", "validate", "--scope=promptkit", "--config=examples/config.secrets.yml"}, &out, &diagnostic)
|
||||
if outcome.Status != 0 || os.Getenv("SCRIPTORIUM_EXAMPLE_TOKEN") != "" {
|
||||
t.Fatalf("example: %+v %q", outcome, diagnostic.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user