-
Notifications
You must be signed in to change notification settings - Fork 720
pkg/usrlocalsharelima: simplify and allow multiple paths, etc. #4298
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
pkg/usrlocalsharelima: simplify and allow multiple paths, etc. #4298
Conversation
5cf2497 to
3da246c
Compare
6e1fd43 to
16a40ee
Compare
|
I don't think "simplify" correctly describes all the changes related to I wonder if this could be generalized to also cover calling I think the shareDirs should be added to the |
Signed-off-by: Akihiro Suda <[email protected]>
Old: usrlocalsharelima.Dir() (string, error) New: usrlocal.ShareLima() ([]string, error) Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
16a40ee to
608928d
Compare
Done
Which test?
Debug log may suffice? Can be a post-2.0 PR? |
The
There is no test using it because it doesn't work. I ran into this 2 or 3 times, and just rewrote the code so that the test would not hit the code path that calls So this is not urgent. But if you fix it for
Yes, can be done later. Seems trivial though, so I might just create a PR. |
Yes, as intended. It is not new to respect the delve workspace.
Which test? |
That does not seem correct. There is no reference to And most of the code of the "simplify and allow multiple paths" commit is about refactoring, adding Maybe we should merge the PR as-is in the name of expediency, but the content of the commit does not match the commit summary, which only talks about the renaming of the package.
As I mentioned, there is no test because it doesn't work. Just for demonstration I've added a call to --- pkg/ptr/ptr_test.go
+++ pkg/ptr/ptr_test.go
@@ -6,10 +6,13 @@ package ptr
import (
"testing"
+ "github.com/lima-vm/lima/v2/pkg/usrlocalsharelima"
"gotest.tools/v3/assert"
)
func TestOf(t *testing.T) {
+ _, err := usrlocalsharelima.Dir()
+ assert.NilError(t, err)
assert.DeepEqual(t, bool(true), *Of(true))
assert.DeepEqual(t, int(10), *Of(10))
assert.DeepEqual(t, string(""), *Of(""))This always fails: ❯ go test ./pkg/ptr
--- FAIL: TestOf (0.00s)
ptr_test.go:15: assertion failed: error is not nil: failed to find "lima-guestagent.Linux-aarch64" binary for [/var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/b001 /private/var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/b001], attempted [/var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/b001/lima-guestagent.Linux-aarch64 /var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/share/lima/lima-guestagent.Linux-aarch64 /private/var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/b001/lima-guestagent.Linux-aarch64 /private/var/folders/ds/jk3wz4n96d54wp16s0tg7d2r0000gn/T/go-build1225208507/share/lima/lima-guestagent.Linux-aarch64]
FAIL
FAIL github.com/lima-vm/lima/v2/pkg/ptr 0.199s
FAILRight now it is impossible to write a unit test for any code that calls the |
There is, although abbreviated as lima/pkg/usrlocalsharelima/usrlocalsharelima.go Lines 105 to 113 in 6c1d2f7
|
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 going to approve in case you want to merge right now for the 2.0 release.
I feel the whole delve logic should be documented instead of having URLs pointing to commits or issue comments. It is not self-evident why this code is needed.
Contains