Commit 42d590c
committed
gopls/internal/test/integration: add a WriteGoSum run option
Working with go.sum files in integration tests was cumbersome, involving
temporarily modifying the test to call env.DumpGoSum(...), then copying
its output into the static go.sum file.
For some tests, we may actually want to check in a fixed go.sum file,
but the majority of the tests just want to avoid go.sum errors. To
support this use case, add a new RunOption that writes the go.sum file
before starting the test. Use this option in a test to illustrate its
usage.
Also, update DumpGoSum to use the faster "./..." pattern to create the
go.sum output. "..." matches all modules, but we only care about the
main module.
Change-Id: I32cca005e10411033422cf8fee64cbd56e83f64c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/575700
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>1 parent 53d35a5 commit 42d590c
File tree
4 files changed
+22
-5
lines changed- gopls/internal/test/integration
- misc
4 files changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
| |||
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
0 commit comments