mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
Merge pull request #5004 from cailynse/fix-runner-test
Make TestResourcesRepoNotFile Less Specific
This commit is contained in:
@@ -452,13 +452,14 @@ func TestResourcesRepoNotFile(t *testing.T) {
|
|||||||
|
|
||||||
err := localizer.Run(fsActual, testDir.String(), "", testDir.Join("dst"))
|
err := localizer.Run(fsActual, testDir.String(), "", testDir.Join("dst"))
|
||||||
|
|
||||||
const readmeErr = `yaml: line 28: mapping values are not allowed in this context`
|
const readmeErr = `mapping values are not allowed in this context`
|
||||||
fileErr := fmt.Sprintf(`invalid resource at file "%s": MalformedYAMLError: %s`, repo, readmeErr)
|
fileErr := fmt.Sprintf(`invalid resource at file "%s": MalformedYAMLError:`, repo)
|
||||||
rootErr := fmt.Sprintf(`unable to localize root "%s": unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization'`, repo)
|
rootErr := fmt.Sprintf(`unable to localize root "%s": unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization'`, repo)
|
||||||
var actualErr PathLocalizeError
|
var actualErr PathLocalizeError
|
||||||
require.ErrorAs(t, err, &actualErr)
|
require.ErrorAs(t, err, &actualErr)
|
||||||
require.Equal(t, repo, actualErr.Path)
|
require.Equal(t, repo, actualErr.Path)
|
||||||
require.EqualError(t, actualErr.FileError, fileErr)
|
require.ErrorContains(t, actualErr.FileError, readmeErr)
|
||||||
|
require.ErrorContains(t, actualErr.FileError, fileErr)
|
||||||
require.ErrorContains(t, actualErr.RootError, rootErr)
|
require.ErrorContains(t, actualErr.RootError, rootErr)
|
||||||
|
|
||||||
SetupDir(t, fsExpected, testDir.String(), kustomization)
|
SetupDir(t, fsExpected, testDir.String(), kustomization)
|
||||||
|
|||||||
Reference in New Issue
Block a user