diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 2d677d7f..6569bb45 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -49,6 +49,7 @@ jobs: - linux - windows strategy: + fail-fast: false matrix: include: - name: macOS Universal diff --git a/playwright/e2e/launch/launch.spec.ts b/playwright/e2e/launch/launch.spec.ts index 3b231ff2..78fca814 100644 --- a/playwright/e2e/launch/launch.spec.ts +++ b/playwright/e2e/launch/launch.spec.ts @@ -55,4 +55,16 @@ test.describe("App launch", () => { }), ).resolves.not.toBeNull(); }); + + test.describe("--no-update", () => { + test.use({ + extraArgs: ["--no-update"], + }); + + // XXX: this test works fine locally but in CI the app start races with the test plumbing up the stdout/stderr pipes + // which means the logs are missed, disabling for now. + test.skip("should respect option", async ({ page, stdout }) => { + expect(stdout.data.toString()).toContain("Auto update disabled via command line flag"); + }); + }); }); diff --git a/playwright/element-desktop-test.ts b/playwright/element-desktop-test.ts index f3bf535b..3d8d4f54 100644 --- a/playwright/element-desktop-test.ts +++ b/playwright/element-desktop-test.ts @@ -11,12 +11,37 @@ import fs from "node:fs/promises"; import path, { dirname } from "node:path"; import os from "node:os"; import { fileURLToPath } from "node:url"; +import { PassThrough } from "node:stream"; + +/** + * A PassThrough stream that captures all data written to it. + */ +class CapturedPassThrough extends PassThrough { + private _chunks = []; + + public constructor() { + super(); + super.on("data", this.onData); + } + + private onData = (chunk): void => { + this._chunks.push(chunk); + }; + + public get data(): Buffer { + return Buffer.concat(this._chunks); + } +} interface Fixtures { app: ElectronApplication; tmpDir: string; extraEnv: Record; extraArgs: string[]; + + // Utilities to capture stdout and stderr for tests to make assertions against + stdout: CapturedPassThrough; + stderr: CapturedPassThrough; } const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -24,6 +49,16 @@ const __dirname = dirname(fileURLToPath(import.meta.url)); export const test = base.extend({ extraEnv: {}, extraArgs: [], + + // eslint-disable-next-line no-empty-pattern + stdout: async ({}, use) => { + await use(new CapturedPassThrough()); + }, + // eslint-disable-next-line no-empty-pattern + stderr: async ({}, use) => { + await use(new CapturedPassThrough()); + }, + // eslint-disable-next-line no-empty-pattern tmpDir: async ({}, use) => { const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-")); @@ -31,7 +66,7 @@ export const test = base.extend({ await use(tmpDir); await fs.rm(tmpDir, { recursive: true }); }, - app: async ({ tmpDir, extraEnv, extraArgs }, use) => { + app: async ({ tmpDir, extraEnv, extraArgs, stdout, stderr }, use) => { const args = ["--profile-dir", tmpDir]; const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"]; @@ -49,8 +84,8 @@ export const test = base.extend({ args: [...args, ...extraArgs], }); - app.process().stdout.pipe(process.stdout); - app.process().stderr.pipe(process.stderr); + app.process().stdout.pipe(stdout).pipe(process.stdout); + app.process().stderr.pipe(stderr).pipe(process.stderr); await app.firstWindow(); diff --git a/src/electron-main.ts b/src/electron-main.ts index 16134924..6b243f75 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -436,8 +436,9 @@ app.on("ready", async () => { }); }); - if (argv["no-update"]) { - console.log('Auto update disabled via command line flag "--no-update"'); + // Minimist parses `--no-`-prefixed arguments as booleans with value `false` rather than verbatim. + if (argv["update"] === false) { + console.log("Auto update disabled via command line flag"); } else if (global.vectorConfig["update_base_url"]) { console.log(`Starting auto update with base URL: ${global.vectorConfig["update_base_url"]}`); void updater.start(global.vectorConfig["update_base_url"]); diff --git a/src/i18n/strings/cy.json b/src/i18n/strings/cy.json index 81f04c58..416a3879 100644 --- a/src/i18n/strings/cy.json +++ b/src/i18n/strings/cy.json @@ -9,7 +9,7 @@ "edit": "Golygu", "minimise": "Lleihau", "paste": "Gludo", - "paste_match_style": "Gludo a Chyfateb Arddull", + "paste_match_style": "Arddull Gludo a Chyfateb", "quit": "Gadael", "redo": "Ail-wneud", "select_all": "Dewis y Cyfan", @@ -20,7 +20,7 @@ }, "common": { "about": "Ynghylch", - "brand_help": "%(brand)s Cymorth", + "brand_help": "Cymorth %(brand)s", "help": "Cymorth", "preferences": "Dewisiadau" }, @@ -40,18 +40,18 @@ "unhide": "Datguddio" }, "right_click_menu": { - "add_to_dictionary": "Ychwanegu i'r Geiriadur", + "add_to_dictionary": "Ychwanegu at y geiriadur", "copy_email": "Copïo cyfeiriad e-bost", "copy_image": "Copïo delwedd", "copy_image_url": "Copïo cyfeiriad delwedd", "copy_link_url": "Copïo cyfeiriad y ddolen", "save_image_as": "Cadw delwedd fel...", - "save_image_as_error_description": "Methodd y ddelwedd â chadw", - "save_image_as_error_title": "Wedi methu cadw'r ddelwedd" + "save_image_as_error_description": "Methodd cadw'r ddelwedd", + "save_image_as_error_title": "Methodd cadw'r ddelwedd" }, "view_menu": { "actual_size": "Maint Gwirioneddol", - "toggle_developer_tools": "Toggle Developer Tools", + "toggle_developer_tools": "Toglo Offer Datblygwyr", "toggle_full_screen": "Toglo Sgrin Lawn", "view": "Golwg" },