Skip to content

Add xterm test to docker suite #32149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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