Migrate CLI inspection and resource context tests
This commit is contained in:
@@ -48,7 +48,7 @@ func TestCollectionCheckoutDiscoveryAcrossInvocations(t *testing.T) {
|
||||
}
|
||||
}
|
||||
config := filepath.Join(root, "app.yml")
|
||||
writeNativeFile(t, config, fmt.Sprintf("promptkit:\n configuration: %q\n", frameworkPath))
|
||||
writeNativeFile(t, config, "config:\n imports:\n - path: framework.yml\n required: true\n")
|
||||
input := filepath.Join(root, "transcript.md")
|
||||
if err := os.WriteFile(input, []byte("synthetic discovery transcript"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -71,6 +71,10 @@ func TestCollectionCheckoutDiscoveryAcrossInvocations(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if name == "support-repo" {
|
||||
schemaOutcome, _, schemaDiagnostics := executeNative(t, "promptkit", "show", "prepared", "support/structured", "--config="+config)
|
||||
if schemaOutcome.Status != 0 {
|
||||
t.Fatalf("checkout schema: %+v %q", schemaOutcome, schemaDiagnostics)
|
||||
}
|
||||
for _, want := range []string{"support/answer", "support/fast", "support-example", "Answer the support request", "synthetic discovery transcript"} {
|
||||
if !strings.Contains(out, want) {
|
||||
t.Fatalf("missing %q: %s", want, out)
|
||||
@@ -185,7 +189,7 @@ func TestMaintainedCollectionWorkflow(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, args := range [][]string{
|
||||
{"config", "diff", "--scope=app", "--config=" + config, "--against-config=" + config, `--set=/promptkit/schema_dir="left"`, `--against-set=/promptkit/schema_dir="right"`, "--check"},
|
||||
{"config", "diff", "--scope=app", "--config=" + config, "--against-config=" + config, `--set=/server/addr="left"`, `--against-set=/server/addr="right"`, "--check"},
|
||||
{"config", "diff", "--scope=promptkit", "--config=" + config, "--against-config=examples/config.yml", "--check"},
|
||||
} {
|
||||
outcome, output, diagnostics := executeNative(t, args...)
|
||||
|
||||
Reference in New Issue
Block a user