Skip to content

Commit 7df3953

Browse files
h9jianggopherbot
authored andcommitted
extension/tools/release: add env var to control test skipping
Some of the go test require extra tools. VSCODE_GO_TEST_ALL is used to control whether the test should be skipped or errored if the required tool is missing. For LUCI test, test is triggered by "go test ./..." meaning test will skip if the tool is missing. For docker test, test is triggered by "VSCODE_GO_TEST_ALL=true go test ./..." meaning the test can not be skipped. Choose "TEST_ALL" over "CAN_SKIP" to avoid double negative. For #3533 Change-Id: I7fdad5e872a377882aa274d27d88ae6ddffb613e Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/643855 Reviewed-by: Robert Findley <[email protected]> Commit-Queue: Hongxiang Jiang <[email protected]> Auto-Submit: Hongxiang Jiang <[email protected]> kokoro-CI: kokoro <[email protected]>
1 parent f10960f commit 7df3953

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build/all.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ run_test() {
5353
npm run compile
5454

5555
echo "**** Run Go tests ****"
56-
go test ./...
56+
VSCODE_GO_TEST_ALL="true" go test ./...
5757

5858
echo "**** Run test ****"
5959
npm run unit-test

extension/tools/release/release_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ func TestMain(m *testing.M) {
3939
}
4040

4141
func TestRelease(t *testing.T) {
42+
if _, err := exec.LookPath("npx"); err != nil {
43+
if value, found := os.LookupEnv("VSCODE_GO_TEST_ALL"); found && value == "true" {
44+
t.Errorf("required tool npx not found: %v", err)
45+
} else {
46+
t.Skipf("npx is not found (%v), skipping...", err)
47+
}
48+
}
4249
for _, fullCommand := range []string{
4350
"build-vscgo -out=/tmp/artifacts",
4451
"package -out=/tmp/artifacts",

0 commit comments

Comments
 (0)