Skip to content

Commit

Permalink
Add xterm test to docker suite (#32149)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham authored Jun 27, 2019
1 parent b32afb5 commit 2af8ac7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tests/webTestServer.js.map
tests/webhost/*.d.ts
tests/webhost/webtsc.js
tests/cases/**/*.js
!tests/cases/docker/*.js/
tests/cases/**/*.js.map
*.config
scripts/debug.bat
Expand Down
10 changes: 7 additions & 3 deletions src/testRunner/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ${sanitizeDockerfileOutput(result.stderr.toString())}`;
}

function sanitizeDockerfileOutput(result: string): string {
return stripAbsoluteImportPaths(sanitizeTimestamps(stripRushStageNumbers(stripANSIEscapes(normalizeNewlines(result)))));
return stripAbsoluteImportPaths(sanitizeTimestamps(sanitizeVersionSpecifiers(stripRushStageNumbers(stripANSIEscapes(normalizeNewlines(result))))));
}

function normalizeNewlines(result: string): string {
Expand All @@ -176,10 +176,14 @@ function sanitizeTimestamps(result: string): string {
return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]")
.replace(/\d+(\.\d+)? seconds?/g, "? seconds")
.replace(/\d+(\.\d+)? minutes?/g, "")
.replace(/\d+(\.\d+)?s/g, "?s")
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx");
.replace(/\d+(\.\d+)?s/g, "?s");
}

function sanitizeVersionSpecifiers(result: string): string {
return result
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx")
.replace(/@\d+\.\d+\.\d+/g, "@X.X.X");
}

/**
* Import types and some other error messages use absolute paths in errors as they have no context to be written relative to;
Expand Down
10 changes: 10 additions & 0 deletions tests/baselines/reference/docker/xterm.js.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Exit Code: 0
Standard output:

> [email protected] build /xtermjs
> tsc -b ./tsconfig.all.json




Standard error:
14 changes: 14 additions & 0 deletions tests/cases/docker/xterm.js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# node-pty doesn't build on node 12 right now, so we lock to 8 - the version xterm itself tests against :(
FROM node:8
RUN git clone https://github.com/xtermjs/xterm.js.git /xtermjs
WORKDIR /xtermjs
RUN git pull
COPY --from=typescript/typescript /typescript/typescript-*.tgz /typescript.tgz
RUN mkdir /typescript
RUN tar -xzvf /typescript.tgz -C /typescript
RUN npm i typescript@/typescript/package
RUN npm install
# Set entrypoint back to bash (`node` base image made it `node`)
ENTRYPOINT [ "/bin/bash", "-c" , "exec \"${@:0}\";"]
# Build
CMD npm run build

0 comments on commit 2af8ac7

Please sign in to comment.