-
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
UnitTests fail on windows due to path formatting problems #2855
Conversation
{"uninstall", "uninstall", "/home/myuser/.porter/mixins/exec/exec uninstall"}, | ||
{"invoke", "status", "/home/myuser/.porter/mixins/exec/exec invoke --action status"}, | ||
{"version", "version --output json", "/home/myuser/.porter/mixins/exec/exec version --output json"}, | ||
{"build", "build", "/home/myuser/.porter/mixins/exec/exec build\n\\home\\myuser\\.porter\\mixins\\exec\\exec.exe build"}, |
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.
what is happening here?
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.
You can separate expected output by a newline character, so for this test there are two possible expected outputs which both pass
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.
oh interesting, might be easier to read if it is separated into array for the want command? maybe it isn't possible, not sure how the testing framework works.
@@ -225,6 +224,11 @@ func TestPublish_RefreshCachedBundle(t *testing.T) { | |||
require.NoError(t, err) | |||
origBunPathTime := file.ModTime() | |||
|
|||
if runtime.GOOS == "windows" { | |||
// see https://github.com/getporter/porter/issues/2858 | |||
time.Sleep(5 * time.Millisecond) |
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've seen this in k8s too
Will you add a github job that runs the unit tests on prs? (Maybe as a follow up?) |
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
…2855) * (feat) Fix Unit Tests to pass on Windows Signed-off-by: Ludvig Liljenberg <[email protected]> --------- Signed-off-by: Ludvig Liljenberg <[email protected]> Signed-off-by: Allan Guwatudde <[email protected]>
What does this change
Lots of tests fail on windows because paths are hardcoded using forward slash, and never expects a volume such as "C:".
What issue does it fix
Closes #2854 but leaves #2858 for later
Checklist
Reviewer Checklist