From d81521e5ab7d200a9d3386e34d7580fa9a203039 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 14 May 2024 15:56:25 +0100 Subject: [PATCH] Improve tests to run on arm64 & smoketest seshat (#1668) --- .github/workflows/build_and_test.yaml | 27 ++++++++++++++---- playwright/e2e/launch/launch.spec.ts | 23 ++++++++++++++- ...ccessfully-and-support-seshat-1-linux.png} | Bin 3 files changed, 43 insertions(+), 7 deletions(-) rename playwright/snapshots/launch/launch.spec.ts/{App-launch-should-launch-and-render-the-welcome-view-successfully-1-linux.png => App-launch-should-launch-and-render-the-welcome-view-successfully-and-support-seshat-1-linux.png} (100%) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 3b8d708..82c8c53 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -104,7 +104,7 @@ jobs: matrix: include: - name: macOS Universal - os: macos + os: macos-latest artifact: macos executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element" # We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is @@ -114,26 +114,41 @@ jobs: rsync -a /Volumes/Element/Element.app ~/Applications/ && hdiutil detach /Volumes/Element - name: "Linux (amd64) (sqlcipher: system)" - os: ubuntu + os: ubuntu-latest artifact: linux-amd64-sqlcipher-system executable: "/opt/Element/element-desktop" prepare_cmd: "sudo apt install ./dist/*.deb" - name: "Linux (amd64) (sqlcipher: static)" - os: ubuntu + os: ubuntu-latest artifact: linux-amd64-sqlcipher-static executable: "/opt/Element/element-desktop" prepare_cmd: "sudo apt install ./dist/*.deb" + - name: "Linux (arm64) (sqlcipher: system)" + os: dind-l-arm64 + artifact: linux-arm64-sqlcipher-system + executable: "/opt/Element/element-desktop" + prepare_cmd: "sudo apt install -y ./dist/*.deb" - name: Windows (x86) - os: windows + os: windows-latest artifact: win-ia32 executable: "./dist/win-ia32-unpacked/Element.exe" - name: Windows (x64) - os: windows + os: windows-latest artifact: win-x64 executable: "./dist/win-unpacked/Element.exe" name: Test ${{ matrix.name }} - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} steps: + # Workaround for self-hosted runners lacking yarn + - name: Install Yarn + if: runner.environment == 'self-hosted' + run: | + sudo apt-get -qq update + sudo apt-get install -y curl + curl -fsSL --create-dirs -o $HOME/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js + chmod +x $HOME/bin/yarn + echo "$HOME/bin" >> $GITHUB_PATH + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/playwright/e2e/launch/launch.spec.ts b/playwright/e2e/launch/launch.spec.ts index 216dd9f..303314a 100644 --- a/playwright/e2e/launch/launch.spec.ts +++ b/playwright/e2e/launch/launch.spec.ts @@ -16,12 +16,33 @@ limitations under the License. import { test, expect } from "../../element-desktop-test"; +declare global { + interface Window { + mxPlatformPeg: { + get(): { + getEventIndexingManager(): + | { + supportsEventIndexing(): Promise; + } + | undefined; + }; + }; + } +} + test.describe("App launch", () => { test.slow(); - test("should launch and render the welcome view successfully", async ({ page }) => { + test("should launch and render the welcome view successfully and support seshat", async ({ page }) => { await page.locator("#matrixchat").waitFor(); await page.locator(".mx_Welcome").waitFor(); await expect(page).toHaveURL("vector://vector/webapp/#/welcome"); await expect(page).toHaveScreenshot(); + + const supported = await page.evaluate(async () => { + const indexManager = window.mxPlatformPeg.get()?.getEventIndexingManager(); + return await indexManager?.supportsEventIndexing(); + }); + + expect(supported).toBe(true); }); }); diff --git a/playwright/snapshots/launch/launch.spec.ts/App-launch-should-launch-and-render-the-welcome-view-successfully-1-linux.png b/playwright/snapshots/launch/launch.spec.ts/App-launch-should-launch-and-render-the-welcome-view-successfully-and-support-seshat-1-linux.png similarity index 100% rename from playwright/snapshots/launch/launch.spec.ts/App-launch-should-launch-and-render-the-welcome-view-successfully-1-linux.png rename to playwright/snapshots/launch/launch.spec.ts/App-launch-should-launch-and-render-the-welcome-view-successfully-and-support-seshat-1-linux.png