-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/npm_and_yarn/braces-3.0.3
- Loading branch information
Showing
52 changed files
with
2,054 additions
and
1,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ jobs: | |
./node_modules/.bin/nyc report --reporter=cobertura | ||
exit $EXIT_CODE | ||
test-unit-parallel: | ||
test-unit: | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
|
@@ -150,48 +150,7 @@ jobs: | |
- name: Unit tests | ||
run: yarn test-unit --forbid-only | ||
|
||
test-api-parallel: | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
node-version: [18] # just one as integration tests are about testing in browser | ||
runs-on: [ubuntu] # macos is flaky | ||
browser: [chromium, firefox] | ||
runs-on: ${{ matrix.runs-on }}-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }}.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }}.x | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: | | ||
yarn --frozen-lockfile | ||
yarn install-addons | ||
- name: Install playwright | ||
run: npx playwright install | ||
- name: Wait for build job | ||
uses: NathanFirmo/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
job: build | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: build-artifacts | ||
- name: Unzip artifacts | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}" | ||
else | ||
unzip -o compressed-build.zip | ||
fi | ||
ls -R | ||
- name: Integration tests (${{ matrix.browser }}) | ||
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only | ||
|
||
test-playwright-parallel: | ||
test-integration: | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
|
@@ -232,48 +191,11 @@ jobs: | |
- name: Build demo | ||
run: yarn build-demo | ||
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness | ||
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=core | ||
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core | ||
- name: Integration tests (addon-canvas) | ||
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-canvas | ||
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-canvas | ||
- name: Integration tests (addon-webgl) | ||
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl | ||
|
||
test-api: | ||
needs: build | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
node-version: [18] # just one as integration tests are about testing in browser | ||
runs-on: [windows] # macos is flaky | ||
browser: [chromium, firefox] | ||
runs-on: ${{ matrix.runs-on }}-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }}.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }}.x | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: | | ||
yarn --frozen-lockfile | ||
yarn install-addons | ||
- name: Install playwright | ||
run: npx playwright install | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: build-artifacts | ||
- name: Unzip artifacts | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}" | ||
else | ||
unzip -o compressed-build.zip | ||
fi | ||
ls -R | ||
- name: Integration tests (${{ matrix.browser }}) | ||
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only | ||
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl | ||
|
||
release-dry-run: | ||
needs: build | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2019 The xterm.js authors. All rights reserved. | ||
* @license MIT | ||
*/ | ||
|
||
import WebSocket = require('ws'); | ||
|
||
import test from '@playwright/test'; | ||
import { ITestContext, createTestContext, openTerminal, pollFor, timeout } from '../../../out-test/playwright/TestUtils'; | ||
|
||
let ctx: ITestContext; | ||
test.beforeAll(async ({ browser }) => { | ||
ctx = await createTestContext(browser); | ||
await openTerminal(ctx); | ||
}); | ||
test.afterAll(async () => await ctx.page.close()); | ||
|
||
test.describe('Search Tests', () => { | ||
|
||
test.beforeEach(async () => { | ||
await ctx.proxy.reset(); | ||
}); | ||
|
||
test('string', async function(): Promise<any> { | ||
const port = 8080; | ||
const server = new WebSocket.Server({ port }); | ||
server.on('connection', socket => socket.send('foo')); | ||
await ctx.page.evaluate(`window.term.loadAddon(new window.AttachAddon(new WebSocket('ws://localhost:${port}')))`); | ||
await pollFor(ctx.page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foo'); | ||
server.close(); | ||
}); | ||
|
||
test('utf8', async function(): Promise<any> { | ||
const port = 8080; | ||
const server = new WebSocket.Server({ port }); | ||
const data = new Uint8Array([102, 111, 111]); | ||
server.on('connection', socket => socket.send(data)); | ||
await ctx.page.evaluate(`window.term.loadAddon(new window.AttachAddon(new WebSocket('ws://localhost:${port}')))`); | ||
await pollFor(ctx.page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foo'); | ||
server.close(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { PlaywrightTestConfig } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
testDir: '.', | ||
timeout: 10000, | ||
projects: [ | ||
{ | ||
name: 'ChromeStable', | ||
use: { | ||
browserName: 'chromium', | ||
channel: 'chrome' | ||
} | ||
}, | ||
{ | ||
name: 'FirefoxStable', | ||
use: { | ||
browserName: 'firefox' | ||
} | ||
}, | ||
{ | ||
name: 'WebKit', | ||
use: { | ||
browserName: 'webkit' | ||
} | ||
} | ||
], | ||
reporter: 'list', | ||
webServer: { | ||
command: 'npm run start-server-only', | ||
port: 3000, | ||
timeout: 120000, | ||
reuseExistingServer: !process.env.CI | ||
} | ||
}; | ||
export default config; |
Oops, something went wrong.