mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
Modify tests to present expected data in unsorted order.
Modify all `build` tests to use the raw, non-sorted output of build. This makes every test provide coverage for how kustomize re-orders (or doesn't reorder) resources during processing. Going forward, the ordering of resources in _expected_ output should match the depth-first ordering specified in the `resources:` field used in the test's kustomization file. The only exception to this rule would be tests that actually confirmed some other output ordering, e.g. the test of the `LegacyOrderTransformer` plugin. Fixes #756 Related #821
This commit is contained in:
@@ -256,15 +256,15 @@ func TestIssue596AllowDirectoriesThatAreSubstringsOfEachOther(t *testing.T) {
|
||||
th := kusttest_test.NewKustTestHarness(t, "/app/overlays/aws-sandbox2.us-east-1")
|
||||
th.WriteK("/app/base", "")
|
||||
th.WriteK("/app/overlays/aws", `
|
||||
bases:
|
||||
resources:
|
||||
- ../../base
|
||||
`)
|
||||
th.WriteK("/app/overlays/aws-nonprod", `
|
||||
bases:
|
||||
resources:
|
||||
- ../aws
|
||||
`)
|
||||
th.WriteK("/app/overlays/aws-sandbox2.us-east-1", `
|
||||
bases:
|
||||
resources:
|
||||
- ../aws-nonprod
|
||||
`)
|
||||
m, err := th.MakeKustTarget().MakeCustomizedResMap()
|
||||
@@ -363,7 +363,7 @@ vars:
|
||||
objref:
|
||||
kind: Service
|
||||
name: apple
|
||||
bases:
|
||||
resources:
|
||||
- ../../base
|
||||
`)
|
||||
th.WriteK("/app/overlays/o2", `
|
||||
@@ -372,7 +372,7 @@ vars:
|
||||
objref:
|
||||
kind: Leafy
|
||||
name: kale
|
||||
bases:
|
||||
resources:
|
||||
- ../o1
|
||||
`)
|
||||
ra, err := th.MakeKustTarget().AccumulateTarget()
|
||||
@@ -416,7 +416,7 @@ vars:
|
||||
objref:
|
||||
kind: Service
|
||||
name: academy
|
||||
bases:
|
||||
resources:
|
||||
- ../../base
|
||||
`)
|
||||
th.WriteK("/app/overlays/o2", `
|
||||
@@ -425,7 +425,7 @@ vars:
|
||||
objref:
|
||||
kind: Leafy
|
||||
name: kale
|
||||
bases:
|
||||
resources:
|
||||
- ../o1
|
||||
`)
|
||||
_, err := th.MakeKustTarget().AccumulateTarget()
|
||||
|
||||
Reference in New Issue
Block a user