-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix integration tests on windows #2912
Conversation
Signed-off-by: Ludvig Liljenberg <[email protected]>
…e TestResolveBundleReference TestInstall_stringParam Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
09bea31
to
db8914f
Compare
pkg/porter/archive.go
Outdated
@@ -336,6 +336,9 @@ func (ex *exporter) addImage(base bundle.BaseImage) error { | |||
// If the name contains a path separator, all path separators will be replaced with "-". | |||
func (ex *exporter) createArchiveFolder(name string) (string, error) { | |||
cleanedPath := strings.ReplaceAll(afero.UnicodeSanitize(name), string(os.PathSeparator), "-") | |||
cleanedPath = strings.ReplaceAll(cleanedPath, "/", "-") // this is needed because on windows, if the bundle name is from a reference | |||
// e.g. "ghcr.io/getporter/examples/porter-hello:v0.2.0", the name will be "examples/porter-hello", | |||
// so we still need to replace the / with -, which the above line doesn't do (on windows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why this respected the OS's PathSeparator to begin with...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just use '/', no need for checking PathSeparator here. I don't believe a bundle name will ever have the name example\\hello-porter
. https://github.com/getporter/porter/pull/2154/files
Signed-off-by: Ludvig Liljenberg <[email protected]>
f258080
to
45aec93
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job! I can't tell if I kicked off integration or not but I'll set this to merge if integ is happy
What does this change
Fixes integration tests so they pass on windows . Also fixes a bug where
porter archive
fails on windows due to not being able to create a temp directory, because it tried to create 2 nesting levels at once.One windows bug remains which is tracked separately, see #2917
What issue does it fix
Closes #2908
If there is not an existing issue, please make sure we have context on why this change is needed. See our Contributing Guide for examples of when an existing issue isn't necessary.
Notes for the reviewer
Please review agent.go. I have removed printing out the filecontents, because on windows there is no way to determine if a file is executable or not. I would like confirmation that this is ok (or not).
Checklist
Reviewer Checklist