From: Anthony Fok Date: Fri, 23 Feb 2024 20:15:27 -0700 Subject: Set GO111MODULE=auto for TestZeroConfigAlgorithm Debian dh-golang is currently still using GO111MODULE=off which confuses many tests TestZeroConfigAlgorithm. Full test log: === RUN TestZeroConfigAlgorithm === RUN TestZeroConfigAlgorithm/basic_go.work_workspace session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, } === RUN TestZeroConfigAlgorithm/basic_go.mod_workspace session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoModView", + Type: s"AdHocView", Root: ".", Env: nil, }, } === RUN TestZeroConfigAlgorithm/basic_GOPATH_workspace === RUN TestZeroConfigAlgorithm/basic_AdHoc_workspace === RUN TestZeroConfigAlgorithm/multi-folder_workspace session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoModView", + Type: s"AdHocView", Root: "a", Env: nil, }, { - Type: s"GoModView", + Type: s"AdHocView", Root: "b", Env: nil, }, } === RUN TestZeroConfigAlgorithm/multi-module_workspace === RUN TestZeroConfigAlgorithm/zero-config_open_module session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ {Type: s"AdHocView", Root: "."}, { - Type: s"GoModView", + Type: s"AdHocView", Root: "a", Env: nil, }, } === RUN TestZeroConfigAlgorithm/zero-config_open_modules session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ {Type: s"AdHocView", Root: "."}, { - Type: s"GoModView", + Type: s"AdHocView", Root: "a", Env: nil, }, { - Type: s"GoModView", + Type: s"AdHocView", Root: "b", Env: nil, }, } === RUN TestZeroConfigAlgorithm/unified_workspace session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, + {Type: s"AdHocView", Root: "a"}, + {Type: s"AdHocView", Root: "b"}, } === RUN TestZeroConfigAlgorithm/go.work_from_env session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, + {Type: s"AdHocView", Root: "a"}, + {Type: s"AdHocView", Root: "b"}, } === RUN TestZeroConfigAlgorithm/independent_module_view session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, + {Type: s"AdHocView", Root: "a"}, { - Type: s"GoModView", + Type: s"AdHocView", Root: "b", - Env: []string{"GOWORK=off"}, + Env: nil, }, } === RUN TestZeroConfigAlgorithm/multiple_go.work session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, { - Type: s"GoWorkView", + Type: s"AdHocView", - Root: "b", + Root: "a", Env: nil, }, + {Type: s"AdHocView", Root: "b"}, + {Type: s"AdHocView", Root: "b/c"}, } === RUN TestZeroConfigAlgorithm/multiple_go.work,_c_unused session_test.go:281: selectViews() mismatch (-want +got): []cache.viewSummary{ { - Type: s"GoWorkView", + Type: s"AdHocView", Root: ".", Env: nil, }, + {Type: s"AdHocView", Root: "a"}, + {Type: s"AdHocView", Root: "b"}, { - Type: s"GoModView", + Type: s"AdHocView", Root: "b/c", - Env: []string{"GOWORK=off"}, + Env: nil, }, } Last-Update: 2024-02-04, 2024-02-23 --- gopls/internal/cache/session_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gopls/internal/cache/session_test.go b/gopls/internal/cache/session_test.go index 1b7472a..807f5c1 100644 --- a/gopls/internal/cache/session_test.go +++ b/gopls/internal/cache/session_test.go @@ -322,6 +322,9 @@ replace ( }, } + // workaround for Debian dh-golang using GO111MODULE=off for build + os.Setenv("GO111MODULE", "auto") + for _, test := range tests { ctx := context.Background() t.Run(test.name, func(t *testing.T) {