Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

E2E testing setup for desktop app #1560

Merged
merged 3 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ fi
use nix --max-jobs auto
watch_file shell.nix build/nix/**/*.nix

export APP_FOLDER_NAME="Mintter.dev"

# Redefining the ports in development
# to allow running release builds and dev builds at the same time.
# These values are passed to mintterd via flags when Electron spawns the mintterd process.
export VITE_BACKEND_HTTP_PORT="56001"
export VITE_BACKEND_GRPC_PORT="56002"
export VITE_BACKEND_P2P_PORT="56003"
export VITE_DESKTOP_P2P_PORT="56000"
export VITE_DESKTOP_HTTP_PORT="56001"
export VITE_DESKTOP_GRPC_PORT="56002"
export VITE_DESKTOP_APPDATA="Mintter.dev"
export VITE_DESKTOP_HOSTNAME="http://localhost"

export GRPC_HOST="http://localhost:57001"
export NEXT_PUBLIC_LN_HOST="https://ln.mintter.com"
export MINTTER_IS_GATEWAY="1"
export NEXT_TELEMETRY_DISABLED="1"

export VITE_MINTTER_GATEWAY_URL="https://mintter.com"

export VITE_APP_VERSION="0.0.100"
export GRPC_HOST="http://localhost:55002"
export NEXT_PUBLIC_LN_HOST="https://ln.testnet.mintter.com"
export NEXT_TELEMETRY_DISABLED="1"

export VITE_VERSION="0.0.100"

# Needed for the Go extension in VS Code to find the right toolchain.
export GOROOT="$(go env GOROOT)"

export VITE_HM_SENTRY_DESKTOP_DSN="https://8d3089ffb71045dc911bc66efbd3463a@o4504088793841664.ingest.sentry.io/4505527460429824"
export HM_SENTRY_DESKTOP_DSN="https://8d3089ffb71045dc911bc66efbd3463a@o4504088793841664.ingest.sentry.io/4505527460429824"

# NODE_ENV=test VITE_DESKTOP_P2P_PORT=5800 VITE_DESKTOP_HTTP_PORT=58001 VITE_DESKTOP_GRPC_PORT=58002 VITE_DESKTOP_APPDATA=appData.test.local
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

17 changes: 12 additions & 5 deletions .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
run: |
node scripts/set-desktop-version.mjs
env:
APP_VERSION: "${{ needs.get-version.outputs.version }}"
VITE_VERSION: "${{ needs.get-version.outputs.version }}"

- name: Build, package & make (Unix)
if: matrix.config.os != 'windows-latest-l'
Expand All @@ -114,11 +114,17 @@ jobs:
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
DAEMON_NAME: ${{ matrix.config.daemon_name }}
VITE_APP_VERSION: "${{ needs.get-version.outputs.version }}"
# VITE_APP_VERSION: "0.0.100"
VITE_VERSION: "${{ needs.get-version.outputs.version }}"
# VITE_VERSION: "0.0.100"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
timeout-minutes: 10
VITE_DESKTOP_P2P_PORT: "55000"
VITE_DESKTOP_HTTP_PORT: "55001"
VITE_DESKTOP_GRPC_PORT: "55002"
VITE_DESKTOP_DESKTOP_APPDATA: "Mintter"
horacioh marked this conversation as resolved.
Show resolved Hide resolved
VITE_DESKTOP_HOSTNAME: "http://localhost"
VITE_HM_SENTRY_DESKTOP_DSN: "${{ secrets.HM_SENTRY_SITE_DSN }}"
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"

- name: Build, package and make (Win32)
if: matrix.config.os == 'windows-latest-l'
Expand All @@ -127,8 +133,9 @@ jobs:
yarn desktop:make --arch=${{ matrix.config.arch }}
env:
DAEMON_NAME: "${{ matrix.config.daemon_name }}.exe"
VITE_APP_VERSION: "${{ needs.get-version.outputs.version }}"
VITE_VERSION: "${{ needs.get-version.outputs.version }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
VITE_HM_SENTRY_DESKTOP_DSN: "${{ secrets.HM_SENTRY_SITE_DSN }}"
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Upload Artifacts
Expand Down
152 changes: 152 additions & 0 deletions .github/workflows/test-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Desktop Test

permissions:
contents: write

on:
push:
# disabling this job until we can make tests run without relying on external services
branches: [none]
# push:
# branches:
# - main
# - e2e
# - release/*
# paths:
# - frontend/*
# - ".github/workflows/test-desktop.yml"

# pull_request:
# branches:
# - main
# - e2e
# - release/*
# paths:
# - frontend/*
# - ".github/workflows/test-desktop.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
AWS_REGION: us-east-1

jobs:
build-binaries:
name: Test on ${{ matrix.config.os }} @ ${{ matrix.config.arch }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: macos-latest-xl
arch: x64
goarch: amd64
daemon_name: x86_64-apple-darwin
- os: macos-latest-xl
arch: arm64
goarch: arm64
daemon_name: aarch64-apple-darwin
# - os: ubuntu-20.04
# arch: x64
# goarch: amd64
# daemon_name: x86_64-unknown-linux-gnu
- os: windows-latest-l
arch: x64
goarch: amd64
daemon_name: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v1

- uses: ./.github/actions/ci-setup
with:
matrix-os: ${{ matrix.config.os }}
# matrix-target: ${{ matrix.config.daemon_name }}
# matrix-arch: ${{ matrix.config.arch }}

- name: Build Backend (Unix)
if: matrix.config.os != 'windows-latest-l'
run: |
mkdir -p plz-out/bin/backend
go build -o plz-out/bin/backend/mintterd-${{ matrix.config.daemon_name }} ./backend/cmd/mintterd
env:
GOARCH: ${{ matrix.config.goarch }}
CGO_ENABLED: 1

- name: Build Backend (Windows)
if: matrix.config.os == 'windows-latest-l'
run: |
mkdir -p plz-out/bin/backend
go build -o plz-out/bin/backend/mintterd-${{ matrix.config.daemon_name }}.exe ./backend/cmd/mintterd
env:
GOOS: "windows"
GOARCH: ${{ matrix.config.goarch }}
CGO_ENABLED: 1

- name: Set temporal version in package.json
run: |
node scripts/set-desktop-version.mjs
env:
VITE_VERSION: "100.0.0"

- name: Build, package & make (Unix)
if: matrix.config.os != 'windows-latest-l'
run: |
yarn desktop:package --arch=${{ matrix.config.arch }}
env:
NODE_ENV: test
DAEMON_NAME: ${{ matrix.config.daemon_name }}
VITE_VERSION: "100.0.0"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
timeout-minutes: 10
VITE_DESKTOP_P2P_PORT: "58000"
VITE_DESKTOP_HTTP_PORT: "58001"
VITE_DESKTOP_GRPC_PORT: "58002"
VITE_DESKTOP_DESKTOP_APPDATA: "Mintter.test"
VITE_DESKTOP_HOSTNAME: "http://localhost"

- name: Build, package and make (Win32)
if: matrix.config.os == 'windows-latest-l'
run: |
$env:DEBUG='electron-osx-sign*,electron-notarize*'
yarn desktop:package --arch=${{ matrix.config.arch }}
env:
NODE_ENV: test
DAEMON_NAME: ${{ matrix.config.daemon_name }}
VITE_VERSION: "100.0.0"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
timeout-minutes: 10
VITE_DESKTOP_P2P_PORT: "58000"
VITE_DESKTOP_HTTP_PORT: "58001"
VITE_DESKTOP_GRPC_PORT: "58002"
VITE_DESKTOP_DESKTOP_APPDATA: "Mintter.test"
VITE_DESKTOP_HOSTNAME: "http://localhost"

- name: Validate code
run: |
yarn validate

- name: Install Playwright Browsers
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx playwright install

- name: Run Tests
run: yarn workspace @mintter/desktop e2e
env:
CI: "1"

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: playwright-report-${{ matrix.config.daemon_name }}
path: frontend/apps/desktop/playwright-report/**/*
# - name: Setup Pages
# uses: actions/configure-pages@v2
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# # Upload entire repository
# path: playwright-report/
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v1
145 changes: 0 additions & 145 deletions .github/workflows/testing-builds.yml

This file was deleted.

Loading