Conversation open speed benchmarking for staging builds

Co-authored-by: Fedor Indutnyy <indutny@signal.org>
This commit is contained in:
trevor-signal
2023-07-20 18:37:56 -04:00
committed by GitHub
parent 46c063b203
commit 82e058f2b8
19 changed files with 338 additions and 66 deletions

View File

@@ -165,7 +165,7 @@ window.logAuthenticatedConnect = () => {
window.open = () => null;
// Playwright uses `eval` for `.evaluate()` API
if (!config.enableCI && config.environment !== 'test') {
if (config.ciMode !== 'full' && config.environment !== 'test') {
// eslint-disable-next-line no-eval, no-multi-assign
window.eval = global.eval = () => null;
}

View File

@@ -11,8 +11,11 @@ if (config.environment === 'test') {
console.log('Importing test infrastructure...');
require('./preload_test');
}
if (config.enableCI) {
console.log('Importing CI infrastructure...');
if (config.ciMode) {
console.log(
`Importing CI infrastructure; enabled in config, mode: ${config.ciMode}`
);
const { getCI } = require('../../CI');
window.SignalCI = getCI(window.getTitle());
}

View File

@@ -21,6 +21,7 @@ import { MessageController } from '../../util/MessageController';
import { Environment, getEnvironment } from '../../environment';
import { isProduction } from '../../util/version';
import { ipcInvoke } from '../../sql/channels';
import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen';
window.addEventListener('contextmenu', e => {
const node = e.target as Element | null;
@@ -69,6 +70,11 @@ if (!isProduction(window.SignalContext.getVersion())) {
},
sqlCall: (name: string, ...args: ReadonlyArray<unknown>) =>
ipcInvoke(name, args),
...(window.SignalContext.config.ciMode === 'benchmark'
? {
benchmarkConversationOpen,
}
: {}),
};
contextBridge.exposeInMainWorld('SignalDebug', SignalDebug);
@@ -80,7 +86,7 @@ if (getEnvironment() === Environment.Test) {
contextBridge.exposeInMainWorld('testUtilities', window.testUtilities);
}
if (process.env.SIGNAL_CI_CONFIG) {
if (window.SignalContext.config.ciMode === 'full') {
contextBridge.exposeInMainWorld('SignalCI', window.SignalCI);
}