Skip to content

Commit 1cd7544

Browse files
committed
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 #2230 Change-Id: I14b2d260f66e8213bdca2125900b5213a45ba8d1 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/405905 Reviewed-by: Jamal Carvalho <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent 27ca045 commit 1cd7544

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

build/Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
ARG GOVERSION=1
33
FROM golang:${GOVERSION} AS gobuilder
44

5-
ENV GO111MODULE on
65
ENV GOBIN /gobin
76

87
# Install other Go tools tests depend on
@@ -12,22 +11,19 @@ RUN go run /scratch/installtools/main.go
1211

1312
FROM node:latest
1413

15-
# Prepare a home directory under workspace.
16-
RUN mkdir -p /workspace/vscodego
17-
ENV HOME=/workspace/vscodego
18-
1914
# GO111MODULE=auto
2015
RUN mkdir /go
2116
COPY --from=gobuilder /gobin /go/bin
2217
COPY --from=gobuilder /usr/local/go /usr/local/go
2318

2419
# Add the default GOPATH/bin to the PATH.
2520
# Add the directories of the go tool chains to PATH.
26-
ENV PATH /workspace/vscodego/go/bin:/go/bin:/usr/local/go/bin:${PATH}
21+
ENV PATH /go/bin:/usr/local/go/bin:${PATH}
2722
ENV DEBIAN_FRONTEND noninteractive
2823

2924
RUN apt-get -qq update && apt-get install -qq -y libnss3 libgtk-3-dev libxss1 libasound2 xvfb libsecret-1-0 jq > /dev/null
3025
RUN npm install -g typescript vsce
3126

27+
USER node
3228
WORKDIR /workspace
3329
ENTRYPOINT ["build/all.bash"]

build/all.bash

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,26 @@ go_binaries_info() {
4242
}
4343

4444
run_test() {
45-
echo "**** Run test ****"
4645
df -h | grep shm
46+
47+
echo "**** Run settings generator ****"
48+
go run ./tools/generate.go -w=false -gopls=true
49+
50+
echo "**** Run Go tests ****"
51+
go test ./...
52+
53+
echo "**** Test build ****"
4754
npm ci
4855
npm run compile
56+
57+
echo "**** Run test ****"
4958
npm run unit-test
5059
npm test --silent
51-
npm run lint
52-
53-
# BUG(github.com/golang/vscode-go/issues/2230): Disable test temporarily.
54-
# echo "**** Run settings generator ****"
55-
# go run tools/generate.go -w=false -gopls=true
5660

57-
echo "**** Check if vsce works ****"
58-
vsce package
59-
60-
echo "**** Run Go tests ****"
61-
go test ./...
62-
# TODO(hyangah): see if go clean -modcache makes kokoro builder happy
63-
go clean -modcache
61+
npm run lint
6462
}
6563

64+
6665
run_test_in_docker() {
6766
echo "**** Building the docker image ***"
6867
docker build -t vscode-test-env ${GOVERSION:+ --build-arg GOVERSION="${GOVERSION}"} -f ./build/Dockerfile .

0 commit comments

Comments
 (0)