Skip to content

Commit

Permalink
ci: enable speculos in ci & boolean to disable mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahman-ledger committed Apr 19, 2024
1 parent e013b14 commit a2ac609
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
test_filter:
description: Filter test pattern to execute only tests suites named according to pattern(s) separated by '|' (e.g. to execute accounts and settings describe blocks "Accounts @smoke" or "Accounts @smoke|Settings")
required: false
use_mocks:
description: Run the tests with the mocks
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }}
Expand Down Expand Up @@ -58,12 +62,31 @@ jobs:
skip_ruby: true
install_playwright: true
turborepo-server-port: ${{ steps.caches.outputs.port }}
- name: generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_BOT_APP_ID }}
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- name: Retrieving coin apps
uses: actions/checkout@v4
with:
ref: generated/ledger-live-bot
repository: LedgerHQ/coin-apps
token: ${{ steps.generate-token.outputs.token }}
path: coin-apps
- name: pull docker image
run: docker pull ghcr.io/ledgerhq/speculos:sha-e262a0c
shell: bash
- name: Run playwright tests [Linux => xvfb-run]
id: tests
run: |
export COINAPPS=$PWD/coin-apps
if [ "${{ inputs.use_mocks }}" = false ]; then export MOCK=0; fi
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright ${INPUTS_TEST_FILTER:+--grep} "${{ inputs.test_filter }}"
env:
INPUTS_TEST_FILTER: ${{ inputs.test_filter }}
SEED: ${{ secrets.SEED_QAA_B2C }}
- name: upload diffs to s3
if: ${{ !cancelled() }}
uses: LedgerHQ/ledger-live/tools/actions/upload-images@develop
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/fixtures/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const test = base.extend<TestFixtures>({
{
...process.env,
VERBOSE: true,
// MOCK: true,
MOCK: process.env.MOCK == "0" ? "" : "1",
MOCK_COUNTERVALUES: true,
HIDE_DEBUG_MOCK: true,
CI: process.env.CI || undefined,
Expand Down
1 change: 0 additions & 1 deletion apps/ledger-live-desktop/tests/utils/speculos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export async function startSpeculos(testName: string, spec: Specs[keyof Specs])

if (!appCandidates) {
appCandidates = await listAppCandidates(coinapps);
console.error(JSON.stringify(appCandidates, undefined, 2));
}

const { appQuery, dependency, onSpeculosDeviceCreated } = spec;
Expand Down

0 comments on commit a2ac609

Please sign in to comment.