Migrate acquisition fixtures to document-root controls

This commit is contained in:
2026-11-02 00:40:16 +00:00
parent ad5b859337
commit 54bdc24865
20 changed files with 258 additions and 223 deletions

View File

@@ -72,7 +72,7 @@ func TestNestedItemGlobsShareUnderlayNodeBudget(t *testing.T) {
t.Parallel()
directory := t.TempDir()
mainPath := writeImportFile(t, directory, "main.yml", `configkit:
mainPath := writeImportFile(t, directory, "main.yml", `config:
imports:
- glob: children/*.yml
destination: [children]
@@ -132,7 +132,7 @@ func TestImportedEmptyBodiesChargeEachDestinationWrapper(t *testing.T) {
t.Parallel()
filesystem := NewFilesystem("bundle", fstest.MapFS{
"main.yml": &fstest.MapFile{Data: []byte("configkit: {imports: [{path: fragment.yml}]}\n")},
"main.yml": &fstest.MapFile{Data: []byte("config: {imports: [{path: fragment.yml}]}\n")},
"fragment.yml": &fstest.MapFile{Data: []byte("{}\n")},
})
mainSource := filesystem.File("main.yml")
@@ -186,7 +186,7 @@ func TestImportedEmptyBodiesChargeFullRelativeDestinations(t *testing.T) {
t.Parallel()
directory := t.TempDir()
mainPath := writeImportFile(t, directory, "main.yml", `configkit:
mainPath := writeImportFile(t, directory, "main.yml", `config:
imports:
- path: empty.yml
destination: [groups, empty]
@@ -248,7 +248,7 @@ func TestGlobMatchesChargeTheirSharedRelativeDestination(t *testing.T) {
t.Parallel()
directory := t.TempDir()
mainPath := writeImportFile(t, directory, "main.yml", `configkit:
mainPath := writeImportFile(t, directory, "main.yml", `config:
imports:
- glob: fragments/*.yml
destination: [groups, empty]
@@ -316,7 +316,7 @@ func TestRelativeImportDestinationUsesAccumulatedDocumentDepth(t *testing.T) {
t.Parallel()
directory := t.TempDir()
mainPath := writeImportFile(t, directory, "main.yml", "configkit: {imports: [{path: fragment.yml, destination: [extra]}]}\n")
mainPath := writeImportFile(t, directory, "main.yml", "config: {imports: [{path: fragment.yml, destination: [extra]}]}\n")
writeImportFile(t, directory, "fragment.yml", "value: nested\n")
destination := Path{segments: make([]pathSegment, maxDocumentDepth)}
for index := range destination.segments {
@@ -351,11 +351,11 @@ func TestAbsentOptionalImportsDoNotChargeUnusedDeepDestinations(t *testing.T) {
}{
{
name: "optional missing path",
body: "configkit: {imports: [{path: missing.yml, destination: [unused]}]}\n",
body: "config: {imports: [{path: missing.yml, destination: [unused]}]}\n",
},
{
name: "optional unmatched glob",
body: "configkit: {imports: [{glob: empty/*.yml, destination: [unused]}]}\n",
body: "config: {imports: [{glob: empty/*.yml, destination: [unused]}]}\n",
setup: func(t *testing.T, directory string) {
if err := os.Mkdir(filepath.Join(directory, "empty"), 0o755); err != nil {
t.Fatal(err)