| 1 |
From: Anthony Fok <[email protected]> |
| 2 |
Date: Fri, 23 Feb 2024 20:15:27 -0700 |
| 3 |
Subject: Set GO111MODULE=auto for TestZeroConfigAlgorithm |
| 4 |
|
| 5 |
Debian dh-golang is currently still using GO111MODULE=off |
| 6 |
which confuses many tests TestZeroConfigAlgorithm. |
| 7 |
|
| 8 |
Full test log: |
| 9 |
|
| 10 |
=== RUN TestZeroConfigAlgorithm |
| 11 |
=== RUN TestZeroConfigAlgorithm/basic_go.work_workspace |
| 12 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 13 |
[]cache.viewSummary{ |
| 14 |
{ |
| 15 |
- Type: s"GoWorkView", |
| 16 |
+ Type: s"AdHocView", |
| 17 |
Root: ".", |
| 18 |
Env: nil, |
| 19 |
}, |
| 20 |
} |
| 21 |
=== RUN TestZeroConfigAlgorithm/basic_go.mod_workspace |
| 22 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 23 |
[]cache.viewSummary{ |
| 24 |
{ |
| 25 |
- Type: s"GoModView", |
| 26 |
+ Type: s"AdHocView", |
| 27 |
Root: ".", |
| 28 |
Env: nil, |
| 29 |
}, |
| 30 |
} |
| 31 |
=== RUN TestZeroConfigAlgorithm/basic_GOPATH_workspace |
| 32 |
=== RUN TestZeroConfigAlgorithm/basic_AdHoc_workspace |
| 33 |
=== RUN TestZeroConfigAlgorithm/multi-folder_workspace |
| 34 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 35 |
[]cache.viewSummary{ |
| 36 |
{ |
| 37 |
- Type: s"GoModView", |
| 38 |
+ Type: s"AdHocView", |
| 39 |
Root: "a", |
| 40 |
Env: nil, |
| 41 |
}, |
| 42 |
{ |
| 43 |
- Type: s"GoModView", |
| 44 |
+ Type: s"AdHocView", |
| 45 |
Root: "b", |
| 46 |
Env: nil, |
| 47 |
}, |
| 48 |
} |
| 49 |
=== RUN TestZeroConfigAlgorithm/multi-module_workspace |
| 50 |
=== RUN TestZeroConfigAlgorithm/zero-config_open_module |
| 51 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 52 |
[]cache.viewSummary{ |
| 53 |
{Type: s"AdHocView", Root: "."}, |
| 54 |
{ |
| 55 |
- Type: s"GoModView", |
| 56 |
+ Type: s"AdHocView", |
| 57 |
Root: "a", |
| 58 |
Env: nil, |
| 59 |
}, |
| 60 |
} |
| 61 |
=== RUN TestZeroConfigAlgorithm/zero-config_open_modules |
| 62 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 63 |
[]cache.viewSummary{ |
| 64 |
{Type: s"AdHocView", Root: "."}, |
| 65 |
{ |
| 66 |
- Type: s"GoModView", |
| 67 |
+ Type: s"AdHocView", |
| 68 |
Root: "a", |
| 69 |
Env: nil, |
| 70 |
}, |
| 71 |
{ |
| 72 |
- Type: s"GoModView", |
| 73 |
+ Type: s"AdHocView", |
| 74 |
Root: "b", |
| 75 |
Env: nil, |
| 76 |
}, |
| 77 |
} |
| 78 |
=== RUN TestZeroConfigAlgorithm/unified_workspace |
| 79 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 80 |
[]cache.viewSummary{ |
| 81 |
{ |
| 82 |
- Type: s"GoWorkView", |
| 83 |
+ Type: s"AdHocView", |
| 84 |
Root: ".", |
| 85 |
Env: nil, |
| 86 |
}, |
| 87 |
+ {Type: s"AdHocView", Root: "a"}, |
| 88 |
+ {Type: s"AdHocView", Root: "b"}, |
| 89 |
} |
| 90 |
=== RUN TestZeroConfigAlgorithm/go.work_from_env |
| 91 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 92 |
[]cache.viewSummary{ |
| 93 |
{ |
| 94 |
- Type: s"GoWorkView", |
| 95 |
+ Type: s"AdHocView", |
| 96 |
Root: ".", |
| 97 |
Env: nil, |
| 98 |
}, |
| 99 |
+ {Type: s"AdHocView", Root: "a"}, |
| 100 |
+ {Type: s"AdHocView", Root: "b"}, |
| 101 |
} |
| 102 |
=== RUN TestZeroConfigAlgorithm/independent_module_view |
| 103 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 104 |
[]cache.viewSummary{ |
| 105 |
{ |
| 106 |
- Type: s"GoWorkView", |
| 107 |
+ Type: s"AdHocView", |
| 108 |
Root: ".", |
| 109 |
Env: nil, |
| 110 |
}, |
| 111 |
+ {Type: s"AdHocView", Root: "a"}, |
| 112 |
{ |
| 113 |
- Type: s"GoModView", |
| 114 |
+ Type: s"AdHocView", |
| 115 |
Root: "b", |
| 116 |
- Env: []string{"GOWORK=off"}, |
| 117 |
+ Env: nil, |
| 118 |
}, |
| 119 |
} |
| 120 |
=== RUN TestZeroConfigAlgorithm/multiple_go.work |
| 121 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 122 |
[]cache.viewSummary{ |
| 123 |
{ |
| 124 |
- Type: s"GoWorkView", |
| 125 |
+ Type: s"AdHocView", |
| 126 |
Root: ".", |
| 127 |
Env: nil, |
| 128 |
}, |
| 129 |
{ |
| 130 |
- Type: s"GoWorkView", |
| 131 |
+ Type: s"AdHocView", |
| 132 |
- Root: "b", |
| 133 |
+ Root: "a", |
| 134 |
Env: nil, |
| 135 |
}, |
| 136 |
+ {Type: s"AdHocView", Root: "b"}, |
| 137 |
+ {Type: s"AdHocView", Root: "b/c"}, |
| 138 |
} |
| 139 |
=== RUN TestZeroConfigAlgorithm/multiple_go.work,_c_unused |
| 140 |
session_test.go:281: selectViews() mismatch (-want +got): |
| 141 |
[]cache.viewSummary{ |
| 142 |
{ |
| 143 |
- Type: s"GoWorkView", |
| 144 |
+ Type: s"AdHocView", |
| 145 |
Root: ".", |
| 146 |
Env: nil, |
| 147 |
}, |
| 148 |
+ {Type: s"AdHocView", Root: "a"}, |
| 149 |
+ {Type: s"AdHocView", Root: "b"}, |
| 150 |
{ |
| 151 |
- Type: s"GoModView", |
| 152 |
+ Type: s"AdHocView", |
| 153 |
Root: "b/c", |
| 154 |
- Env: []string{"GOWORK=off"}, |
| 155 |
+ Env: nil, |
| 156 |
}, |
| 157 |
} |
| 158 |
Last-Update: 2024-02-04, 2024-02-23 |
| 159 |
--- |
| 160 |
gopls/internal/cache/session_test.go | 3 +++ |
| 161 |
1 file changed, 3 insertions(+) |
| 162 |
|
| 163 |
diff --git a/gopls/internal/cache/session_test.go b/gopls/internal/cache/session_test.go |
| 164 |
index 1b7472a..807f5c1 100644 |
| 165 |
--- a/gopls/internal/cache/session_test.go |
| 166 |
+++ b/gopls/internal/cache/session_test.go |
| 167 |
@@ -322,6 +322,9 @@ replace ( |
| 168 |
}, |
| 169 |
} |
| 170 |
|
| 171 |
+ // workaround for Debian dh-golang using GO111MODULE=off for build |
| 172 |
+ os.Setenv("GO111MODULE", "auto") |
| 173 |
+ |
| 174 |
for _, test := range tests { |
| 175 |
ctx := context.Background() |
| 176 |
t.Run(test.name, func(t *testing.T) { |