test(plugin): make expected paths OS-agnostic in installer tests

Build expected paths with filepath.Join so the TestPath assertions pass on Windows as well as Unix.

Signed-off-by: Yuhui Luo <92632263+lyh7c00@users.noreply.github.com>
pull/32569/head
Yuhui Luo 1 month ago committed by GitHub
parent 256c28145e
commit 85b60705a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -34,15 +34,15 @@ func TestPath(t *testing.T) {
}, { }, {
source: "https://github.com/jkroepke/helm-secrets", source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: "/helm/data/plugins", helmPluginsDir: "/helm/data/plugins",
expectPath: "/helm/data/plugins/helm-secrets", expectPath: filepath.Join("/helm/data/plugins", "helm-secrets"),
}, { }, {
source: "https://github.com/jkroepke/helm-secrets", source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: strings.Join([]string{"/helm/data/plugins", "/helm/data/extra"}, string(filepath.ListSeparator)), helmPluginsDir: strings.Join([]string{"/helm/data/plugins", "/helm/data/extra"}, string(filepath.ListSeparator)),
expectPath: "/helm/data/plugins/helm-secrets", expectPath: filepath.Join("/helm/data/plugins", "helm-secrets"),
}, { }, {
source: "https://github.com/jkroepke/helm-secrets", source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: string(filepath.ListSeparator) + "/helm/data/plugins", helmPluginsDir: string(filepath.ListSeparator) + "/helm/data/plugins",
expectPath: "/helm/data/plugins/helm-secrets", expectPath: filepath.Join("/helm/data/plugins", "helm-secrets"),
}, },
} }

Loading…
Cancel
Save