[ci skip]lighthouse

This commit is contained in:
Christien Rioux 2025-03-13 10:04:43 -04:00
parent 33456c8437
commit e296319cc6
5 changed files with 239 additions and 973 deletions

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
"devDependencies": {
"@wdio/browser-runner": "^9.12.0",
"@wdio/cli": "^9.12.0",
"@wdio/devtools-service": "^8.42.0",
"@wdio/lighthouse-service": "^9.12.0",
"@wdio/mocha-framework": "^9.11.0",
"@wdio/spec-reporter": "^9.11.0",
"ts-node": "^10.9.1",

View file

@ -111,8 +111,54 @@ describe('VeilidRoutingContext', () => {
describe('DHT stress tests', () => {
//var _orig_log: (message?: any, ...optionalParams: any[]) => void;
//const logfilter = /\[[^\]]*\]\ webdriver.*/g;
before(async () => {
await browser.startTracing({})
// _orig_log = console.log;
// console.log = function log(message?: any, ...optionalParams: any[]): void {
// // if (typeof message === 'string' || message instanceof String) {
// // if (message.match(logfilter)) {
// // return;
// // }
// // }
// _orig_log.call(this, "ass");
// //_orig_log.call(this, message, ...optionalParams);
// };
await browser.startTracing({
'categories': [
// Exclude default categories. We'll be selective to minimize trace size
'-*',
// Used instead of 'toplevel' in Chrome 71+
'disabled-by-default-lighthouse',
// All compile/execute events are captured by parent events in devtools.timeline..
// But the v8 category provides some nice context for only <0.5% of the trace size
'v8',
// Same situation here. This category is there for RunMicrotasks only, but with other teams
// accidentally excluding microtasks, we don't want to assume a parent event will always exist
'v8.execute',
// For extracting UserTiming marks/measures
'blink.user_timing',
// Not mandatory but not used much
'blink.console',
// Most the events we need come in on these two
'devtools.timeline',
'disabled-by-default-devtools.timeline',
// Up to 450 (https://goo.gl/rBfhn4) JPGs added to the trace
'disabled-by-default-devtools.screenshot',
// This doesn't add its own events, but adds a `stackTrace` property to devtools.timeline events
'disabled-by-default-devtools.timeline.stack',
// Include screenshots for frame viewer
'disabled-by-default-devtools.screenshot'
]
});
})
it('should inspect in parallel without delay', async () => {
@ -172,9 +218,9 @@ describe('VeilidRoutingContext', () => {
const events = await browser.endTracing()
if (events) {
await browser.writeFile("profile-dht-stress-test.json", events);
await browser.writeFile("test_results/profile-dht-stress-test.json", events);
}
//console.log = _orig_log;
})
});

View file

@ -9,7 +9,7 @@
"expect-webdriverio",
"@wdio/mocha-framework",
"@wdio/browser-runner",
"@wdio/devtools-service",
"@wdio/lighthouse-service",
],
"skipLibCheck": true,
"noEmit": true,

View file

@ -130,7 +130,7 @@ export const config: WebdriverIO.Config = {
// Services take over a specific job you don't want to take care of. They enhance
// your test setup with almost no effort. Unlike plugins, they don't add new
// commands. Instead, they hook themselves up into the test process.
services: ['devtools', [FileService as any, {}]],
services: ['lighthouse', [FileService as any, {}]],
//
// Framework you want to run your specs with.
// The following are supported: Mocha, Jasmine, and Cucumber