Conversation open speed benchmarking for staging builds
Co-authored-by: Fedor Indutnyy <indutny@signal.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user