Skip to content

Commit

Permalink
extension/tools/release: add env var to control test skipping
Browse files Browse the repository at this point in the history
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 <rfindley@google.com>
Commit-Queue: Hongxiang Jiang <hxjiang@golang.org>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
h9jiang authored and gopherbot committed Jan 23, 2025
1 parent f10960f commit 7df3953
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ run_test() {
npm run compile

echo "**** Run Go tests ****"
go test ./...
VSCODE_GO_TEST_ALL="true" go test ./...

echo "**** Run test ****"
npm run unit-test
Expand Down
7 changes: 7 additions & 0 deletions extension/tools/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ func TestMain(m *testing.M) {
}

func TestRelease(t *testing.T) {
if _, err := exec.LookPath("npx"); err != nil {
if value, found := os.LookupEnv("VSCODE_GO_TEST_ALL"); found && value == "true" {
t.Errorf("required tool npx not found: %v", err)
} else {
t.Skipf("npx is not found (%v), skipping...", err)
}
}
for _, fullCommand := range []string{
"build-vscgo -out=/tmp/artifacts",
"package -out=/tmp/artifacts",
Expand Down

0 comments on commit 7df3953

Please sign in to comment.