Skip to content

Commit

Permalink
test: replace travis-multirunner with @puppeter/browsers
Browse files Browse the repository at this point in the history
following what was done in adapter which is now back to supporting
Firefox stable. Also ignore CHROME_BIN environment variable to download
the actual Chrome version, see
  webrtcHacks/adapter#1157
  • Loading branch information
fippo committed Apr 21, 2024
1 parent 7ac95ca commit d2996bf
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 66 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/interop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
browserB: [firefox, chrome]
bver: ['unstable']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: BROWSER=${{matrix.browserA}} BVER=${{matrix.bver}} ./node_modules/travis-multirunner/setup.sh
- run: BROWSER=${{matrix.browserB}} BVER=${{matrix.bver}} ./node_modules/travis-multirunner/setup.sh
- run: sudo rm /usr/bin/chromedriver /usr/bin/geckodriver # remove preinstalled github chromedriver/geckodriver from $PATH
- run: Xvfb :99 &
- run: BROWSER_A=${{matrix.browserA}} BROWSER_B=${{matrix.browserB}} BVER=${{matrix.bver}} DISPLAY=:99.0 node_modules/.bin/jest --retries=3 test/interop/
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: npm run eslint
- run: npm run stylelint
Expand All @@ -20,10 +20,9 @@ jobs:
browser: [chrome]
version: [stable]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: BROWSER=${{matrix.browser}} BVER=${{matrix.version}} ./node_modules/travis-multirunner/setup.sh
- run: sudo rm /usr/bin/chromedriver # remove preinstalled github chromedriver from $PATH
- run: Xvfb :99 &
- run: BROWSER=${{matrix.browser}} BVER=${{matrix.version}} DISPLAY=:99.0 npm run jest -- --retries=3
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "webrtc-samples",
"private": true,
"version": "1.0.0",
"description": "Project checking for WebRTC GitHub samples repo",
"keywords": [
"webrtc",
"demos",
"samples",
"javascript"
"webrtc"
],
"homepage": "https://github.com/webrtc/samples",
"homepage": "https://webrtc.github.io/samples/",
"bugs": {
"url": "https://github.com/webrtc/samples/issues"
},
Expand All @@ -22,21 +20,21 @@
"start": "http-server . -c-1",
"test": "npm run eslint && npm run stylelint",
"eslint": "eslint 'test/**.js' 'src/content/**/*.js'",
"jest": "jest --testTimeout 5000 --maxWorkers=1 'src/content/**/test.js'",
"jest": "node test/download-browsers.js && jest --testTimeout 5000 --maxWorkers=1 test/download.test.js src/content/",
"stylelint": "stylelint 'src/**/*.css'"
},
"eslintIgnore": [
"'**/third_party/*.js'"
],
"devDependencies": {
"@puppeteer/browsers": "^2.2.0",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-jest": "^27.4.0",
"http-server": "^14.1.0",
"jest": "^29.7.0",
"selenium-webdriver": "^4.12.0",
"selenium-webdriver": "^4.19.0",
"stylelint": "^14.5.3",
"stylelint-config-recommended": "^7.0.0",
"travis-multirunner": "^5.0.1"
"stylelint-config-recommended": "^7.0.0"
}
}
4 changes: 2 additions & 2 deletions src/content/datachannel/basic/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const path = '/src/content/datachannel/basic/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('datachannel basic', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/datachannel/channel/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/datachannel/channel/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('datachannel and broadcast channels', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/datachannel/datatransfer/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/datachannel/datatransfer/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('datachannel datatransfer', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/datachannel/filetransfer/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/datachannel/filetransfer/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('datachannel filetransfer', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/devices/input-output/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const path = '/src/content/devices/input-output/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('input-output', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/getusermedia/gum/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/getusermedia/gum/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('getUserMedia', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/getusermedia/resolution/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const path = '/src/content/getusermedia/resolution/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('getUserMedia resolutions', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/insertable-streams/endtoend-encryption/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/insertable-streams/endtoend-encryption/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('insertable streams e2ee', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/audio/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const path = '/src/content/peerconnection/audio/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('audio-only peerconnection', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/change-codecs/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/change-codecs/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection with setCodecPreferences', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/channel/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/channel/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection and broadcast channels', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/dtmf/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const path = '/src/content/peerconnection/dtmf/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection dtmf', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/multiple/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/multiple/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('multiple peerconnections', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/munge-sdp/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/munge-sdp/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection sdp munging', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/negotiate-timing/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/negotiate-timing/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection with negotiation timing', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/pc1/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/pc1/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('simple peerconnection', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/restart-ice/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/restart-ice/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection ice restart', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/states/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/states/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection states', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/trickle-ice/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/trickle-ice/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('Trickle-Ice', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
4 changes: 2 additions & 2 deletions src/content/peerconnection/upgrade/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const path = '/src/content/peerconnection/upgrade/index.html';
const url = `${process.env.BASEURL ? process.env.BASEURL : ('file://' + process.cwd())}${path}`;

describe('peerconnection upgrade from audio-only to audio-video', () => {
beforeAll(() => {
driver = seleniumHelpers.buildDriver();
beforeAll(async () => {
driver = await seleniumHelpers.buildDriver();
});
afterAll(() => {
return driver.quit();
Expand Down
11 changes: 11 additions & 0 deletions test/download-browsers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const {buildDriver} = require('./webdriver');
// Download the browser(s).
async function download() {
if (process.env.browserA && process.env.browserB) {
(await buildDriver(process.env.browserA)).quit();
(await buildDriver(process.env.browserB)).quit();
} else {
(await buildDriver()).quit();
}
}
download();
4 changes: 2 additions & 2 deletions test/interop/connection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe(`basic interop test ${browserA} => ${browserB}`, function() {
browserLogging: true,
}
drivers = [
buildDriver(browserA, options),
buildDriver(browserB, options),
await buildDriver(browserA, options),
await buildDriver(browserB, options),
];
clients = drivers.map(driver => {
return {
Expand Down
Loading

0 comments on commit d2996bf

Please sign in to comment.