mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Rewrite remoteload_test integration tests (#4783)
* Better error message when git clone fails * support file:// URLs * rewrite remoteload_test * lint and test fix * fixes for kverey's comments * document file:// remote load * replace assert with require where appropriate * add tests for file:// without git suffix * fixes plus pr review from natasha * fixes for review, lint * revert changes to error handling * fix skipped test
This commit is contained in:
@@ -52,7 +52,7 @@ func (origin *Origin) Append(path string) *Origin {
|
||||
originCopy := origin.Copy()
|
||||
repoSpec, err := git.NewRepoSpecFromURL(path)
|
||||
if err == nil {
|
||||
originCopy.Repo = repoSpec.Host + repoSpec.OrgRepo
|
||||
originCopy.Repo = repoSpec.CloneSpec()
|
||||
absPath := repoSpec.AbsPath()
|
||||
path = absPath[strings.Index(absPath[1:], "/")+1:][1:]
|
||||
originCopy.Path = ""
|
||||
|
||||
@@ -31,14 +31,14 @@ func TestOriginAppend(t *testing.T) {
|
||||
},
|
||||
path: "github.com/kubernetes-sigs/kustomize/examples/multibases/dev/",
|
||||
expected: `path: examples/multibases/dev
|
||||
repo: https://github.com/kubernetes-sigs/kustomize
|
||||
repo: https://github.com/kubernetes-sigs/kustomize.git
|
||||
`,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
actual, err := test.in.Append(test.path).String()
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, actual, test.expected)
|
||||
assert.Equal(t, test.expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user