-
Notifications
You must be signed in to change notification settings - Fork 285
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
WSL: Implement docker plugin integration in go #5924
WSL: Implement docker plugin integration in go #5924
Conversation
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.
Unit tests fail on WIndows.
First, every time I run it I get this message:
For this generation to compile you need to have some packages in your go.mod:
* github.com/go-openapi/runtime
* github.com/jessevdk/go-flags
I still see this even after running go mod tidy
in src/go/wsl-helper
. Maybe it needs to be run somewhere else?
Then the tests fail with a large number of lines of errors, starting like so:
--- FAIL: TestContainersCreate (0.06s)
--- FAIL: TestContainersCreate/bind (0.03s)
containers_create_windows_test.go:57:
Error Trace: C:/Users/eric/rancher-desktop/src/go/wsl-helper/pkg/dockerproxy/mungers/containers_create_windows_test.go:57
Error: Received unexpected error:
could not translate bind path C:\Users\eric\AppData\Local\Temp\TestContainersCreatebind3996221649\001: error getting WSL path: exec: "wsl": executable file not found in %PATH%
Test: TestContainersCreate/bind
--- FAIL: TestContainersCreate/mount (0.03s)
containers_create_windows_test.go:92:
Error Trace: C:/Users/eric/rancher-desktop/src/go/wsl-helper/pkg/dockerproxy/mungers/containers_create_windows_test.go:92
Error: Received unexpected error:
could not translate mount path C:\Users\eric\AppData\Local\Temp\TestContainersCreatemount2728444168\001: error getting WSL path: exec: "wsl": executable file not found in %PATH%
Test: TestContainersCreate/mount
FAIL
FAIL github.com/rancher-sandbox/rancher-desktop/src/go/wsl-helper/pkg/dockerproxy/mungers 0.333s
ok github.com/rancher-sandbox/rancher-desktop/src/go/wsl-helper/pkg/dockerproxy/platform (cached)
ok github.com/rancher-sandbox/rancher-desktop/src/go/wsl-helper/pkg/dockerproxy/util (cached)
--- FAIL: TestRemoveHostFileEntry (0.00s)
hostfile_test.go:82:
Error Trace: C:/Users/eric/rancher-desktop/src/go/wsl-helper/pkg/host/hostfile_test.go:82
Error: Received unexpected error:
rename C:\Users\eric\AppData\Local\Temp\tmpRDHostsFile1155500918 C:\Users\eric\AppData\Local\Temp\TestRemoveHostFileEntry3891314604\001\hosts: Access is denied.
Test: TestRemoveHostFileEntry
This avoids assumptions about what is available inside the target distros (we no longer require /bin/sh and ln). Signed-off-by: Mark Yen <[email protected]>
On Windows, we must close the file before renaming on top of it. While this code isn't really used on Windows (it's only for Linux distros in WSL), there doesn't seem to be much harm in fixing it. Signed-off-by: Mark Yen <[email protected]>
7cf8e69
to
7e85f32
Compare
Fixed the second test failure (from |
|
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.
Works, tests pass when the r-d distro has been installed, and code is readable, so approved
This avoids assumptions about what is available inside the target distros (we no longer require
/bin/sh
andln
).This was spawned from #5832.