Skip to content

Commit 84fe4e7

Browse files
committed
.github/workflows: add go1.19rc2 to long/smoke tests
go1.19 release will be soon. try the latest rc. Change-Id: Iacc1280e4c6ada1bbd663180fe9ee37e23eb5520 Change-Id: Iacc1280e4c6ada1bbd663180fe9ee37e23eb5520 GitHub-Last-Rev: e8a238b GitHub-Pull-Request: #2376 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/419594 Reviewed-by: Nooras Saba‎ <saba@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
1 parent d114767 commit 84fe4e7

File tree

7 files changed

+39
-46
lines changed

7 files changed

+39
-46
lines changed

.github/workflows/test-long-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
os: [ubuntu-latest, windows-latest, macos-latest]
1919
version: ['stable', 'insiders']
20-
go: ['1.16', '1.17', '1.18']
20+
go: ['1.16', '1.17', '1.18', '1.19.0-rc.2']
2121

2222
steps:
2323
- name: Clone repository

.github/workflows/test-long.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest, windows-latest] # TODO: reenable macos-latest
1818
version: ['stable']
19-
go: ['1.16', '1.17', '1.18']
19+
go: ['1.16', '1.17', '1.18', '1.19.0-rc.2']
2020

2121
steps:
2222
- name: Clone repository

.github/workflows/test-smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup Go
3131
uses: actions/setup-go@v3
3232
with:
33-
go-version: '1.18'
33+
go-version: '1.19.0-rc.2'
3434
check-latest: true
3535
cache: true
3636

docs/debugging-legacy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ in your launch configuration. This property supports multiple tags, which you ca
143143

144144
### Specifying other build flags
145145

146-
The flags specified in `buildFlags` and `env.GOFLAGS` are passed to the Go compiler when building your program for debugging. Delve adds `-gcflags='all=-N -l'` to the list of build flags to disable optimizations. User specified buildFlags conflict with this setting, so the extension removes them ([Issue #117](https://github.com/golang/vscode-go/issues/117)). If you wish to debug a program using custom `-gcflags`, build the program using `go build` and launch using `exec` mode:
146+
The flags specified in `buildFlags` and `env.GOFLAGS` are passed to the Go compiler when building your program for debugging. Delve adds `-gcflags=all="-N -l"` to the list of build flags to disable optimizations. User specified buildFlags conflict with this setting, so the extension removes them ([Issue #117](https://github.com/golang/vscode-go/issues/117)). If you wish to debug a program using custom `-gcflags`, build the program using `go build` and launch using `exec` mode:
147147

148148
```json
149149
{

docs/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ Start a `dlv dap` server ready to accept a client request to launch or attach to
568568
$ dlv dap --listen=:12345
569569
```
570570

571-
Use the following `launch` configuration to tell `dlv` to execute a binary precompiled with `go build -gcflags='all=-N -l'`:
571+
Use the following `launch` configuration to tell `dlv` to execute a binary precompiled with `go build -gcflags=all="-N -l"`:
572572

573573
```json5
574574
{
@@ -655,7 +655,7 @@ The "debug test" CodeLens and the [test UI](features.md#test-and-benchmark) do n
655655

656656
### Starting a debug session fails with `decoding dwarf section info at offset 0x0: too short` or `could not open debug info` error.
657657

658-
These errors indicate that your binary was built with linker flags that stripped the symbol table (`-s`) or the DWARF debug information (`-w`), making debugging impossible. If the binary is built while launching the session, make sure your `launch.json` configuration does not contain `"buildFlags": "--ldflags '-s -w'"`. If you use `debug test` or Test Explorer, check `go.buildFlags` in `settings.json`. If the binary is built externally, check the command-line flags and do not use `go run`. Unlike `go build`, `go run` passes `-s -w` to the linker under the hood. If you try to attach to such a binary with a debugger, it will fail with one of the above errors (see Go Issue [24833](https://github.com/golang/go/issues/24833)). Instead let dlv build the binary for you or use `go build -gcflags='all=-N -l'`.
658+
These errors indicate that your binary was built with linker flags that stripped the symbol table (`-s`) or the DWARF debug information (`-w`), making debugging impossible. If the binary is built while launching the session, make sure your `launch.json` configuration does not contain `"buildFlags": "--ldflags '-s -w'"`. If you use `debug test` or Test Explorer, check `go.buildFlags` in `settings.json`. If the binary is built externally, check the command-line flags and do not use `go run`. Unlike `go build`, `go run` passes `-s -w` to the linker under the hood. If you try to attach to such a binary with a debugger, it will fail with one of the above errors (see Go Issue [24833](https://github.com/golang/go/issues/24833)). Instead let dlv build the binary for you or use `go build -gcflags=all="-N -l"`.
659659

660660
## Reporting Issues
661661

test/integration/extension.test.ts

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,18 @@ const testAll = (isModuleMode: boolean) => {
152152
const uri = vscode.Uri.file(path.join(fixturePath, 'gogetdocTestData', 'test.go'));
153153
const textDocument = await vscode.workspace.openTextDocument(uri);
154154

155-
const promises = testCases.map(([position, expected, expectedDoc, expectedParams]) =>
155+
const promises = testCases.map(([position, expected, expectedDocPrefix, expectedParams]) =>
156156
provider.provideSignatureHelp(textDocument, position, dummyCancellationSource.token).then((sigHelp) => {
157157
assert.ok(
158158
sigHelp,
159159
`No signature for gogetdocTestData/test.go:${position.line + 1}:${position.character + 1}`
160160
);
161161
assert.equal(sigHelp.signatures.length, 1, 'unexpected number of overloads');
162162
assert.equal(sigHelp.signatures[0].label, expected);
163-
assert.equal(sigHelp.signatures[0].documentation, expectedDoc);
163+
assert(
164+
sigHelp.signatures[0].documentation?.toString().startsWith(expectedDocPrefix),
165+
`expected doc starting with ${expectedDocPrefix}, got ${JSON.stringify(sigHelp.signatures[0])}`
166+
);
164167
assert.equal(sigHelp.signatures[0].parameters.length, expectedParams.length);
165168
for (let i = 0; i < expectedParams.length; i++) {
166169
assert.equal(sigHelp.signatures[0].parameters[i].label, expectedParams[i]);
@@ -190,7 +193,10 @@ const testAll = (isModuleMode: boolean) => {
190193
}
191194
assert(res);
192195
assert.equal(res.contents.length, 1);
193-
assert.equal((<vscode.MarkdownString>res.contents[0]).value, expectedHover);
196+
assert(
197+
(<vscode.MarkdownString>res.contents[0]).value.startsWith(expectedHover),
198+
`expected hover starting with ${expectedHover}, got ${JSON.stringify(res.contents[0])}`
199+
);
194200
})
195201
);
196202
return Promise.all(promises);
@@ -227,11 +233,7 @@ const testAll = (isModuleMode: boolean) => {
227233
this.skip();
228234
} // not working in module mode
229235

230-
const printlnDoc = `Println formats using the default formats for its operands and writes to
231-
standard output. Spaces are always added between operands and a newline is
232-
appended. It returns the number of bytes written and any write error
233-
encountered.
234-
`;
236+
const printlnDocPrefix = 'Println formats using the default formats for its operands and writes';
235237
const printlnSig = goVersion.lt('1.18')
236238
? 'Println(a ...interface{}) (n int, err error)'
237239
: 'Println(a ...any) (n int, err error)';
@@ -240,7 +242,7 @@ encountered.
240242
[
241243
new vscode.Position(19, 13),
242244
printlnSig,
243-
printlnDoc,
245+
printlnDocPrefix,
244246
[goVersion.lt('1.18') ? 'a ...interface{}' : 'a ...any']
245247
],
246248
[
@@ -278,10 +280,7 @@ encountered.
278280
return;
279281
}
280282

281-
const printlnDoc = `Println formats using the default formats for its operands and writes to standard output.
282-
Spaces are always added between operands and a newline is appended.
283-
It returns the number of bytes written and any write error encountered.
284-
`;
283+
const printlnDocPrefix = 'Println formats using the default formats for its operands and writes';
285284
const printlnSig = goVersion.lt('1.18')
286285
? 'Println(a ...interface{}) (n int, err error)'
287286
: 'Println(a ...any) (n int, err error)';
@@ -290,7 +289,7 @@ It returns the number of bytes written and any write error encountered.
290289
[
291290
new vscode.Position(19, 13),
292291
printlnSig,
293-
printlnDoc,
292+
printlnDocPrefix,
294293
[goVersion.lt('1.18') ? 'a ...interface{}' : 'a ...any']
295294
],
296295
[
@@ -323,11 +322,7 @@ It returns the number of bytes written and any write error encountered.
323322
this.skip();
324323
} // not working in module mode
325324

326-
const printlnDoc = `Println formats using the default formats for its operands and writes to
327-
standard output. Spaces are always added between operands and a newline is
328-
appended. It returns the number of bytes written and any write error
329-
encountered.
330-
`;
325+
const printlnDocPrefix = 'Println formats using the default formats for its operands and writes';
331326
const printlnSig = goVersion.lt('1.18')
332327
? 'Println func(a ...interface{}) (n int, err error)'
333328
: 'Println func(a ...any) (n int, err error)';
@@ -340,7 +335,7 @@ encountered.
340335
[new vscode.Position(28, 16), null, null], // inside a number
341336
[new vscode.Position(22, 5), 'main func()', '\n'],
342337
[new vscode.Position(40, 23), 'import (math "math")', null],
343-
[new vscode.Position(19, 6), printlnSig, printlnDoc],
338+
[new vscode.Position(19, 6), printlnSig, printlnDocPrefix],
344339
[
345340
new vscode.Position(23, 4),
346341
'print func(txt string)',
@@ -364,10 +359,7 @@ encountered.
364359
return;
365360
}
366361

367-
const printlnDoc = `Println formats using the default formats for its operands and writes to standard output.
368-
Spaces are always added between operands and a newline is appended.
369-
It returns the number of bytes written and any write error encountered.
370-
`;
362+
const printlnDocPrefix = 'Println formats using the default formats for its operands and writes';
371363
const printlnSig = goVersion.lt('1.18')
372364
? 'func Println(a ...interface{}) (n int, err error)'
373365
: 'func Println(a ...any) (n int, err error)';
@@ -388,7 +380,7 @@ It returns the number of bytes written and any write error encountered.
388380
'package math',
389381
'Package math provides basic constants and mathematical functions.\n\nThis package does not guarantee bit-identical results across architectures.\n'
390382
],
391-
[new vscode.Position(19, 6), printlnSig, printlnDoc],
383+
[new vscode.Position(19, 6), printlnSig, printlnDocPrefix],
392384
[
393385
new vscode.Position(27, 14),
394386
'type ABC struct {\n a int\n b int\n c int\n}',
@@ -878,19 +870,15 @@ It returns the number of bytes written and any write error encountered.
878870
this.skip(); // timeout on windows
879871
}
880872

881-
const printlnDoc = `Println formats using the default formats for its operands and writes to
882-
standard output. Spaces are always added between operands and a newline is
883-
appended. It returns the number of bytes written and any write error
884-
encountered.
885-
`;
873+
const printlnDocPrefix = 'Println formats using the default formats for its operands';
886874
const printlnSig = goVersion.lt('1.18')
887875
? 'func(a ...interface{}) (n int, err error)'
888876
: 'func(a ...any) (n int, err error)';
889877

890878
const provider = new GoCompletionItemProvider();
891879
const testCases: [vscode.Position, string, string | null, string | null][] = [
892880
[new vscode.Position(7, 4), 'fmt', 'fmt', null],
893-
[new vscode.Position(7, 6), 'Println', printlnSig, printlnDoc]
881+
[new vscode.Position(7, 6), 'Println', printlnSig, printlnDocPrefix]
894882
];
895883
const uri = vscode.Uri.file(path.join(fixturePath, 'baseTest', 'test.go'));
896884
const textDocument = await vscode.workspace.openTextDocument(uri);
@@ -912,15 +900,20 @@ encountered.
912900
if (!resolvedItemResult) {
913901
return;
914902
}
915-
if (resolvedItemResult instanceof vscode.CompletionItem) {
916-
if (resolvedItemResult.documentation) {
917-
assert.equal((<vscode.MarkdownString>resolvedItemResult.documentation).value, expectedDoc);
903+
const resolvedItem =
904+
resolvedItemResult instanceof vscode.CompletionItem
905+
? resolvedItemResult
906+
: await resolvedItemResult;
907+
if (resolvedItem?.documentation) {
908+
const got = (<vscode.MarkdownString>resolvedItem.documentation).value;
909+
if (expectedDoc) {
910+
assert(
911+
got.startsWith(expectedDoc),
912+
`expected doc starting with ${expectedDoc}, got ${got}`
913+
);
914+
} else {
915+
assert.equal(got, expectedDoc);
918916
}
919-
return;
920-
}
921-
const resolvedItem = await resolvedItemResult;
922-
if (resolvedItem) {
923-
assert.equal((<vscode.MarkdownString>resolvedItem.documentation).value, expectedDoc);
924917
}
925918
})
926919
);

test/integration/goDebug.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2091,7 +2091,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
20912091
async function buildGoProgram(cwd: string, outputFile: string): Promise<string> {
20922092
const goRuntimePath = getBinPath('go');
20932093
const execFile = util.promisify(cp.execFile);
2094-
const child = await execFile(goRuntimePath, ['build', '-o', outputFile, "--gcflags='all=-N -l'", '.'], {
2094+
const child = await execFile(goRuntimePath, ['build', '-o', outputFile, '--gcflags=all=-N -l', '.'], {
20952095
cwd
20962096
});
20972097
if (child.stderr.length > 0) {

0 commit comments

Comments
 (0)