Hyang-Ah Hana Kim has uploaded this change for review.
tools/generate.go: read package.json once
One of the tests tools/generate.go run (in CI) is to check if
tools/goplssetting.Generate produces the content that is identical
with the current package.json. Before this CL, goplssetting.
Generate function called `jq` and let it read the given
package.json file directly from disk as the source data.
Then, tools/generate.go compared whether goplssetting.Generate
produced the same content as what it read when tools/generate.go
started.
This turned out to be problematic, because the VSCode integration
test we ran just before this tools/generate.go test may touch the
package.json file after the integration test finishes (i.e. the
VS Code instance started for testing tears down asynchronously).
This file update raced with tools/generate.go's run and resulted
in bogus gopls setting consistency test failures.
This CL changes tools/goplssetting.Generate to take the input
data as []byte, compute the new data based on the input data,
and later test the output against the input data. That way, we
avoid reading the file twice.
While we are here, fix a minor issue that caused to insert an
additional new line at the end of goToolsInformation.ts and
fail the lint test.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
M tools/generate.go
M tools/goplssetting/goplssetting.go
M tools/goplssetting/goplssetting_test.go
4 files changed, 69 insertions(+), 31 deletions(-)
diff --git a/build/all.bash b/build/all.bash
index 6fd0c3c..f599847 100755
--- a/build/all.bash
+++ b/build/all.bash
@@ -42,24 +42,27 @@
}
run_test() {
- echo "**** Run test ****"
df -h | grep shm
+
+ echo "**** Test build ****"
npm ci
npm run typecheck
npm run compile
- npm run unit-test
- npm test --silent
- npm run lint
-
- # BUG(github.com/golang/vscode-go/issues/2230): Disable test temporarily.
- # echo "**** Run settings generator ****"
- # go run tools/generate.go -w=false -gopls=true
echo "**** Check if vsce works ****"
vsce package
+ echo "**** Run test ****"
+ npm run unit-test
+ npm test --silent
+ npm run lint
+
echo "**** Run Go tests ****"
go test ./...
+
+ echo "**** Run settings generator ****"
+ go run tools/generate.go -w=false -gopls=true
+
# TODO(hyangah): see if go clean -modcache makes kokoro builder happy
go clean -modcache
}
diff --git a/tools/generate.go b/tools/generate.go
index d806abe..d636c8b 100644
--- a/tools/generate.go
+++ b/tools/generate.go
@@ -77,7 +77,7 @@
}
type Property struct {
- name string `json:"name,omitempty"` // Set by us.
+ name string // Set by us.
// Below are defined in package.json
Properties map[string]*Property `json:"properties,omitempty"`
@@ -132,7 +132,7 @@
}
if *updateGoplsSettingsFlag {
- newData, err := updateGoplsSettings(data, packageJSONFile, *debugFlag)
+ newData, err := newGoplsSettings(data, *debugFlag)
if err != nil {
log.Fatal(err)
}
@@ -154,22 +154,22 @@
if len(split) == 1 {
log.Fatalf("expected to find %q in %s, not found", gen, filename)
}
- var s []byte
+ var newContent []byte
if strings.HasSuffix(filename, ".ts") {
- s = bytes.Join([][]byte{
+ newContent = bytes.Join([][]byte{
split[0],
gen,
[]byte("\n\n"),
toAdd,
}, []byte{})
} else {
- s = bytes.Join([][]byte{
+ s := bytes.Join([][]byte{
bytes.TrimSpace(split[0]),
gen,
toAdd,
}, []byte("\n\n"))
+ newContent = append(s, '\n')
}
- newContent := append(s, '\n')
checkAndWrite(filename, oldContent, newContent)
}
@@ -264,6 +264,7 @@
if err != nil {
log.Fatal(err)
}
+ bytes.TrimSpace(data)
// TODO(suzmue): change input to json and avoid magic string printing.
toolsString := fmt.Sprintf(string(data), goplsVersion.Version, goplsVersion.Time[:len("YYYY-MM-DD")], goplsVersionPre.Version, goplsVersionPre.Time[:len("YYYY-MM-DD")])
@@ -547,8 +548,8 @@
return b.String()
}
-func updateGoplsSettings(oldData []byte, packageJSONFile string, debug bool) (newData []byte, _ error) {
- newData, err := goplssetting.Generate(packageJSONFile, debug)
+func newGoplsSettings(oldData []byte, debug bool) (newData []byte, _ error) {
+ newData, err := goplssetting.Generate(oldData, debug)
if err != nil { // failed to compute up-to-date gopls settings.
return nil, err
}
@@ -561,10 +562,6 @@
fmt.Println(`gopls settings section in package.json needs update. To update the settings, run "go run tools/generate.go -w -gopls".`)
os.Exit(1) // causes CI to break.
}
-
- if err := ioutil.WriteFile(packageJSONFile, newData, 0644); err != nil {
- return nil, err
- }
return newData, nil
}
diff --git a/tools/goplssetting/goplssetting.go b/tools/goplssetting/goplssetting.go
index ef568ce..07cfa84 100644
--- a/tools/goplssetting/goplssetting.go
+++ b/tools/goplssetting/goplssetting.go
@@ -20,11 +20,7 @@
// Generate reads package.json and updates the gopls settings section
// based on `gopls api-json` output. This function requires `jq` to
// manipulate package.json.
-func Generate(inputFile string, skipCleanup bool) ([]byte, error) {
- if _, err := os.Stat(inputFile); err != nil {
- return nil, err
- }
-
+func Generate(oldData []byte, skipCleanup bool) ([]byte, error) {
if _, err := exec.LookPath("jq"); err != nil {
return nil, fmt.Errorf("missing `jq`: %w", err)
}
@@ -62,7 +58,7 @@
return nil, err
}
- return rewritePackageJSON(f.Name(), inputFile)
+ return rewritePackageJSON(f.Name(), oldData)
}
// readGoplsAPI returns the output of `gopls api-json`.
@@ -154,13 +150,14 @@
}
}
-// rewritePackageJSON rewrites the input package.json by running `jq`
+// rewritePackageJSON rewrites the input JSON object (package.json) by running `jq`
// to update all existing gopls settings with the ones from the newSettings
// file.
-func rewritePackageJSON(newSettings, inFile string) ([]byte, error) {
+func rewritePackageJSON(newSettings string, oldData []byte) ([]byte, error) {
prog := `.contributes.configuration.properties+=$GOPLS_SETTINGS[0]`
- cmd := exec.Command("jq", "--slurpfile", "GOPLS_SETTINGS", newSettings, prog, inFile)
+ cmd := exec.Command("jq", "--slurpfile", "GOPLS_SETTINGS", newSettings, prog)
var stdout, stderr bytes.Buffer
+ cmd.Stdin = bytes.NewBuffer(oldData) // feed old data!
cmd.Stdout = &stdout
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
diff --git a/tools/goplssetting/goplssetting_test.go b/tools/goplssetting/goplssetting_test.go
index 4a91241..7367923 100644
--- a/tools/goplssetting/goplssetting_test.go
+++ b/tools/goplssetting/goplssetting_test.go
@@ -6,6 +6,7 @@
import (
"bytes"
+ "io/ioutil"
"os/exec"
"path/filepath"
"strings"
@@ -19,8 +20,12 @@
if _, err := exec.LookPath("jq"); err != nil {
t.Skipf("jq is not found (%v), skipping...", err)
}
- testfile := filepath.Join("..", "..", "package.json")
- got, err := Generate(testfile, false)
+ testFile := filepath.Join("..", "..", "package.json")
+ oldData, err := ioutil.ReadFile(testFile)
+ if err != nil {
+ t.Fatalf("read package.json failed: %v", err)
+ }
+ got, err := Generate(oldData, false)
if err != nil {
t.Fatalf("run failed: %v", err)
}
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Hyang-Ah Hana Kim uploaded patch set #2 to this change.
tools/generate.go: read package.json once
One of the tests tools/generate.go runs (in CI) is to check if
tools/goplssetting.Generate produces the content that is identical
with the current package.json. Before this CL, goplssetting.
Generate function called `jq` and let it read the given
package.json file directly from disk as the source data.
Then, tools/generate.go compared whether goplssetting.Generate
produced the same content as what it read when tools/generate.go
started.
This is problematic, because the VSCode integration
test we run just before this tools/generate.go test may touch the
package.json file while this tools/generate.go runs. (i.e. as
part of the asynchronous cleanup (!) of the VS Code process
started for testing).
This race resulted in bogus gopls setting consistency test
failures.
This CL changes tools/goplssetting.Generate to take the input
data as []byte, compute the new data based on the input data,
and later test the output against the input data. That way, we
avoid reading the file twice.
While we are here, fix a minor issue that caused to insert an
additional new line at the end of goToolsInformation.ts and
fail the lint test.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
M tools/generate.go
M tools/goplssetting/goplssetting.go
M tools/goplssetting/goplssetting_test.go
4 files changed, 71 insertions(+), 31 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho, Suzy Mueller.
Kokoro presubmit build finished with status: NOT_BUILT
Logs at: https://source.cloud.google.com/results/invocations/814ae0ae-7842-4e1b-9564-e27eab0f3a6b
Patch set 2:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho, Suzy Mueller.
Hyang-Ah Hana Kim uploaded patch set #3 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
4 files changed, 75 insertions(+), 32 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Jamal Carvalho, Suzy Mueller.
Patch set 3:Run-TryBot +1
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho, Suzy Mueller.
Kokoro presubmit build finished with status: NOT_BUILT
Logs at: https://source.cloud.google.com/results/invocations/f84cc912-1164-4bd3-81e4-be0b53fbc21b
Patch set 3:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho, Suzy Mueller.
Hyang-Ah Hana Kim uploaded patch set #4 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 34 insertions(+), 7 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho, Suzy Mueller.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/82e06863-f2bd-49f9-8663-656c7724eabf
Patch set 4:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Patch set 4:Code-Review +2
1 comment:
Commit Message:
Patch Set #4, Line 20: proble
problem
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
1 comment:
Patchset:
Seems like this change has introduced new test failures, though I don't immediately see how.
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
Hyang-Ah Hana Kim uploaded patch set #5 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 32 insertions(+), 5 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 6:Run-TryBot +1
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/bcd25ef1-94d5-48aa-b57c-b019f0f1ff18
Patch set 6:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim.
Hyang-Ah Hana Kim uploaded patch set #7 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 32 insertions(+), 5 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/3f739d44-335c-4406-8daa-774e70e48232
Patch set 7:TryBot-Result +1
Attention is currently required from: Hyang-Ah Hana Kim.
Hyang-Ah Hana Kim uploaded patch set #8 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result+1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 32 insertions(+), 5 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/f36ff8b3-e80d-4d21-985c-4c7c1c03fec1
Patch set 8:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/ab3ba043-f4fc-4e2b-a8aa-5578424aeaa5
Patch set 9:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim.
Hyang-Ah Hana Kim uploaded patch set #10 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 32 insertions(+), 5 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 10:Run-TryBot +1
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/d8727df9-15a1-4fc5-8009-8141fce4c6e6
Patch set 10:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
1 comment:
Patchset:
Seems like this change has introduced new test failures, though I don't immediately see how.
I am really puzzled... still investigating.
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Hyang-Ah Hana Kim uploaded patch set #11 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/all.bash
1 file changed, 34 insertions(+), 5 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Suzy Mueller.
Patch set 11:Run-TryBot +1
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/d6afa623-0d90-4c8e-b626-d0fa789bbd92
Patch set 11:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Hyang-Ah Hana Kim uploaded patch set #12 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result-1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Also, change Dockerfile to bring up the container
as non-root user (node created by the node container)
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/Dockerfile
M build/all.bash
2 files changed, 50 insertions(+), 18 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/6e0a2119-1f32-4534-a6e1-0d7aa99ca331
Patch set 12:TryBot-Result +1
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Hyang-Ah Hana Kim uploaded patch set #13 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Hyang-Ah Hana Kim, TryBot-Result+1 by kokoro
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the proble early is better.
Also, change Dockerfile to bring up the container
as non-root user (node created by the node container)
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
---
M build/Dockerfile
M build/all.bash
2 files changed, 42 insertions(+), 20 deletions(-)
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/db6b1ea5-7db5-4674-9fca-4b4f7979749d
Patch set 13:TryBot-Result +1
Attention is currently required from: Jamal Carvalho, Suzy Mueller.
1 comment:
Patchset:
I am really puzzled... still investigating.
Turned out it's the USER issue. The container runs as a root - I thought the default node container was running as a 'node' but it wasn't. (or changed?). As a result, all directories and files created during `go` command execution had root-only access. I don't know why but the vscode instance and npm scripts don't run as root and failed to access/write the directories. Explicitly specifying the user prevented this error. More over, 'go clean -modcache' added as a workaround for rsync permission issue (when turning down the container, kokoro was unhappy about the module cache entries written as root) is no longer necessary.
Dockerfile was updated. PTAL.
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim, Jamal Carvalho.
Patch set 13:Code-Review +2
1 comment:
Patchset:
Turned out it's the USER issue. […]
Wow, great job finding that!
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Jamal Carvalho.
1 comment:
Commit Message:
Patch Set #4, Line 20: proble
problem
Done
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.
Hyang-Ah Hana Kim submitted this change.
13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
build/all.bash: rearrange test order
VSCode modifies package.json while running in the
integration test. It reverts back the package.json
to original, but the revert file write can occur
asynchronously. That affects our document generator
tests following the integration test.
Change the test order so we run the document generator
test before.
Usually, integration test takes long. So, running
this quick documentation consistency test first and
reporting the problem early is better.
Also, change Dockerfile to bring up the container
as non-root user (node created by the node container)
Fixes golang/vscode-go#2230
Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/405905
Reviewed-by: Jamal Carvalho <ja...@golang.org>
Reviewed-by: Suzy Mueller <suz...@golang.org>
---
M build/Dockerfile
M build/all.bash
2 files changed, 45 insertions(+), 20 deletions(-)
diff --git a/build/Dockerfile b/build/Dockerfile
index 1ca02ee..0e4b9c9 100644
--- a/build/Dockerfile
+++ b/build/Dockerfile
@@ -2,7 +2,6 @@
ARG GOVERSION=1
FROM golang:${GOVERSION} AS gobuilder
-ENV GO111MODULE on
ENV GOBIN /gobin
# Install other Go tools tests depend on
@@ -12,10 +11,6 @@
FROM node:latest
-# Prepare a home directory under workspace.
-RUN mkdir -p /workspace/vscodego
-ENV HOME=/workspace/vscodego
-
# GO111MODULE=auto
RUN mkdir /go
COPY --from=gobuilder /gobin /go/bin
@@ -23,11 +18,12 @@
# Add the default GOPATH/bin to the PATH.
# Add the directories of the go tool chains to PATH.
-ENV PATH /workspace/vscodego/go/bin:/go/bin:/usr/local/go/bin:${PATH}
+ENV PATH /go/bin:/usr/local/go/bin:${PATH}
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update && apt-get install -qq -y libnss3 libgtk-3-dev libxss1 libasound2 xvfb libsecret-1-0 jq > /dev/null
RUN npm install -g typescript vsce
+USER node
WORKDIR /workspace
ENTRYPOINT ["build/all.bash"]
diff --git a/build/all.bash b/build/all.bash
index 4a1a7ed..c2f9d95 100755
--- a/build/all.bash
+++ b/build/all.bash
@@ -42,27 +42,26 @@
}
run_test() {
- echo "**** Run test ****"
df -h | grep shm
- npm ci
- npm run compile
- npm run unit-test
- npm test --silent
- npm run lint
- # BUG(github.com/golang/vscode-go/issues/2230): Disable test temporarily.
- # echo "**** Run settings generator ****"
- # go run tools/generate.go -w=false -gopls=true
-
- echo "**** Check if vsce works ****"
- vsce package
+ echo "**** Run settings generator ****"
+ go run ./tools/generate.go -w=false -gopls=true
echo "**** Run Go tests ****"
go test ./...
- # TODO(hyangah): see if go clean -modcache makes kokoro builder happy
- go clean -modcache
+
+ echo "**** Test build ****"
+ npm ci
+ npm run compile
+
+ echo "**** Run test ****"
+ npm run unit-test
+ npm test --silent
+
+ npm run lint
}
+
run_test_in_docker() {
echo "**** Building the docker image ***"
docker build -t vscode-test-env ${GOVERSION:+ --build-arg GOVERSION="${GOVERSION}"} -f ./build/Dockerfile .
To view, visit change 405905. To unsubscribe, or for help writing mail filters, visit settings.