Skip to content

Commit

Permalink
update ctID to support puppeteer and firefox, #156
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed May 3, 2023
1 parent f7fec61 commit 146014f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = grunt => {
'Launches puppeteer clients to run tests for CT with the following options:\n' +
'--puppeteerClients=number : specify how many puppeteer clients to run with, defaults to 16\n' +
'--firefoxClients=number : specify how many playwright firefox clients to run with, defaults to 0\n' +
'--ctID=string : specify id to give to continuous-loop.html, in URL string, defaults to "Sparky%20Puppeteer"\n' +
'--ctID=string : specify id to give to continuous-loop.html, in URL string, defaults to "Sparky". Will have the platform appended like "ID%20Puppeteer"\n' +
'--serverURL=string : defaults to "https://sparky.colorado.edu/"\n',
() => {
const ContinuousServerClient = require( './server/ContinuousServerClient' );
Expand Down
2 changes: 1 addition & 1 deletion js/config/bayes.pm2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
cwd: '/data/share/phet/continuous-testing/ct-chrome-clients/aqua',
script: 'grunt',
time: true,
args: 'client-server --puppeteerClients=16 --ctID=Bayes%20Puppeteer'
args: 'client-server --puppeteerClients=16 --ctID=Bayes'
}
]
};
2 changes: 1 addition & 1 deletion js/server/ContinuousServerClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ContinuousServerClient {
// How many instances (worker threads) should be created?
numberOfPuppeteers: 8,
numberOfFirefoxes: 0,
ctID: 'Sparky%20Puppeteer',
ctID: 'Sparky',
serverURL: 'https://sparky.colorado.edu/',
...options
};
Expand Down
4 changes: 3 additions & 1 deletion js/server/playwrightCTClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const assert = require( 'assert' );
const playwrightLoad = require( '../../../perennial/js/common/playwrightLoad' );
const { parentPort } = require( 'worker_threads' ); // eslint-disable-line require-statement-match
const playwright = require( '../../../perennial/node_modules/playwright' );

process.on( 'SIGINT', () => process.exit() );

Expand All @@ -22,12 +23,13 @@ process.on( 'SIGINT', () => process.exit() );
server = server.endsWith( '/' ) ? server : `${server}/`;

// http so we don't need to overhead when running locally
const url = `${server}continuous-testing/aqua/html/continuous-loop.html?id=${ctID}`;
const url = `${server}continuous-testing/aqua/html/continuous-loop.html?id=${ctID}%20Playwright%20Firefox`;
const loadingMessage = `Loading ${url}`;
parentPort && parentPort.postMessage( loadingMessage );
// console.log( loadingMessage );

const error = await playwrightLoad( url, {
testingBrowserCreator: playwright.firefox, // hard coded to firefox at this time
waitAfterLoad: 10 * 60 * 1000, // 15 minutes
allowedTimeToLoad: 2 * 60 * 1000,
gotoTimeout: 1000000000, // a long time
Expand Down
2 changes: 1 addition & 1 deletion js/server/puppeteerCTClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ process.on( 'SIGINT', () => process.exit() );
server = server.endsWith( '/' ) ? server : `${server}/`;

// http so we don't need to overhead when running locally
const url = `${server}continuous-testing/aqua/html/continuous-loop.html?id=${ctID}`;
const url = `${server}continuous-testing/aqua/html/continuous-loop.html?id=${ctID}%20Puppeteer`;
const loadingMessage = `Loading ${url}`;
parentPort && parentPort.postMessage( loadingMessage );
// console.log( loadingMessage );
Expand Down

0 comments on commit 146014f

Please sign in to comment.