Add automated checks for desktop app runtime #233

- Add automation script for building, packaging, installing, executing
  and verifying Electron distrubtions across macOS, Ubuntu and Windows.
- Add GitHub workflow to run the script to test distributions using the
  script.
- Update README with new workflow status badge.
- Add application initialization log to desktop applications to be able
  to test against crashes before application initialization.
This commit is contained in:
undergroundwires
2023-08-21 01:35:19 +02:00
parent 0d15992d56
commit 04b3133500
25 changed files with 1120 additions and 6 deletions

View File

@@ -26,10 +26,7 @@ protocol.registerSchemesAsPrivileged([
{ scheme: 'app', privileges: { secure: true, standard: true } },
]);
log.transports.file.level = 'silly';
if (!process.env.IS_TEST) {
Object.assign(console, log.functions); // override console.log, console.warn etc.
}
setupLogger();
function createWindow() {
// Create the browser window.
@@ -131,6 +128,9 @@ function loadApplication(window: BrowserWindow) {
const updater = setupAutoUpdater();
updater.checkForUpdates();
}
// Do not remove [APP_INIT_SUCCESS]; it's a marker used in tests to verify
// app initialization.
log.info('[APP_INIT_SUCCESS] Main window initialized and content loading.');
}
function configureExternalsUrlsOpenBrowser(window: BrowserWindow) {
@@ -155,3 +155,10 @@ function getWindowSize(idealWidth: number, idealHeight: number) {
height = Math.min(height, idealHeight);
return { width, height };
}
function setupLogger(): void {
log.transports.file.level = 'silly';
if (!process.env.IS_TEST) {
Object.assign(console, log.functions); // override console.log, console.warn etc.
}
}