Skip to content

Commit 8eee11d

Browse files
committed
Add vscode docker test
1 parent 2af8ac7 commit 8eee11d

File tree

3 files changed

+76
-5
lines changed

3 files changed

+76
-5
lines changed

src/testRunner/externalCompileRunner.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,15 @@ ${sanitizeDockerfileOutput(result.stderr.toString())}`;
157157
}
158158

159159
function sanitizeDockerfileOutput(result: string): string {
160-
return stripAbsoluteImportPaths(sanitizeTimestamps(sanitizeVersionSpecifiers(stripRushStageNumbers(stripANSIEscapes(normalizeNewlines(result))))));
160+
return [
161+
normalizeNewlines,
162+
stripANSIEscapes,
163+
stripRushStageNumbers,
164+
sanitizeVersionSpecifiers,
165+
sanitizeTimestamps,
166+
sanitizeUnimportantGulpOutput,
167+
stripAbsoluteImportPaths,
168+
].reduce((result, f) => f(result), result);
161169
}
162170

163171
function normalizeNewlines(result: string): string {
@@ -172,17 +180,26 @@ function stripRushStageNumbers(result: string): string {
172180
return result.replace(/\d+ of \d+:/g, "XX of XX:");
173181
}
174182

183+
/**
184+
* Gulp's output order within a `parallel` block is nondeterministic (and there's no way to configure it to execute in series),
185+
* so we purge as much of the gulp output as we can
186+
*/
187+
function sanitizeUnimportantGulpOutput(result: string): string {
188+
return result.replace(/^.*(\] (Starting)|(Finished)).*$/gm, "").replace(/\n+/g, "\n");
189+
}
190+
175191
function sanitizeTimestamps(result: string): string {
176192
return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]")
177-
.replace(/\d+(\.\d+)? seconds?/g, "? seconds")
178-
.replace(/\d+(\.\d+)? minutes?/g, "")
179-
.replace(/\d+(\.\d+)?s/g, "?s");
193+
.replace(/\[\d?\d:\d\d:\d\d\]/g, "[XX:XX:XX]")
194+
.replace(/\d+(\.\d+)? sec(onds?)?/g, "? seconds")
195+
.replace(/\d+(\.\d+)? min(utes?)?/g, "")
196+
.replace(/\d+(\.\d+)?( m)?s/g, "?s");
180197
}
181198

182199
function sanitizeVersionSpecifiers(result: string): string {
183200
return result
184201
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx")
185-
.replace(/@\d+\.\d+\.\d+/g, "@X.X.X");
202+
.replace(/([@v])\d+\.\d+\.\d+/g, "$1X.X.X");
186203
}
187204

188205
/**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Exit Code: 1
2+
Standard output:
3+
yarn run vX.X.X
4+
$ gulp compile --max_old_space_size=4095
5+
[XX:XX:XX] Node flags detected: --max_old_space_size=4095
6+
[XX:XX:XX] Respawned to PID: 29
7+
[XX:XX:XX] Using gulpfile /vscode/gulpfile.js
8+
[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts(560,5): Type 'null' is not assignable to type 'string'.
9+
[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/menu/menubar.ts(742,7): Type '"underline" | null' is not assignable to type 'string'.
10+
Type 'null' is not assignable to type 'string'.
11+
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(208,33): Property 'locale' does not exist on type 'CompositionEvent'.
12+
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(225,33): Property 'locale' does not exist on type 'CompositionEvent'.
13+
[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts(560,5): Type 'null' is not assignable to type 'string'.
14+
[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/menu/menubar.ts(742,7): Type '"underline" | null' is not assignable to type 'string'.
15+
Type 'null' is not assignable to type 'string'.
16+
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(208,33): Property 'locale' does not exist on type 'CompositionEvent'.
17+
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(225,33): Property 'locale' does not exist on type 'CompositionEvent'.
18+
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
19+
20+
21+
22+
Standard error:
23+
[XX:XX:XX] 'compile' errored after
24+
[XX:XX:XX] Error: Found 4 errors
25+
at Stream.<anonymous> (/vscode/build/lib/reporter.js:74:29)
26+
at _end (/vscode/node_modules/through/index.js:65:9)
27+
at Stream.stream.end (/vscode/node_modules/through/index.js:74:5)
28+
at Stream.onend (internal/streams/legacy.js:42:10)
29+
at Stream.emit (events.js:203:15)
30+
at Stream.EventEmitter.emit (domain.js:466:23)
31+
at drain (/vscode/node_modules/through/index.js:34:23)
32+
at Stream.stream.queue.stream.push (/vscode/node_modules/through/index.js:45:5)
33+
at Stream.end (/vscode/node_modules/through/index.js:15:35)
34+
at _end (/vscode/node_modules/through/index.js:65:9)
35+
error Command failed with exit code 1.

tests/cases/docker/vscode/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# vscode only supports node 8 :(
2+
FROM node:10
3+
RUN apt-get update
4+
RUN apt-get install libsecret-1-dev libx11-dev libxkbfile-dev -y
5+
RUN npm i -g yarn
6+
RUN git clone https://github.com/microsoft/vscode.git /vscode
7+
WORKDIR /vscode
8+
RUN git pull
9+
COPY --from=typescript/typescript /typescript/typescript-*.tgz /typescript.tgz
10+
RUN mkdir /typescript
11+
RUN tar -xzvf /typescript.tgz -C /typescript
12+
WORKDIR /vscode/build
13+
RUN yarn add typescript@/typescript/package
14+
WORKDIR /vscode
15+
RUN yarn add typescript@/typescript/package
16+
RUN yarn
17+
ENTRYPOINT [ "yarn" ]
18+
# Build
19+
CMD [ "compile" ]

0 commit comments

Comments
 (0)