Skip to content
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
30 changes: 30 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Playwright Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Nigiri
uses: vulpemventures/nigiri-github-action@v1
with:
use_liquid: false
use_ln: false
- name: Setup regtest environment
run: pnpm regtest
- name: Run Playwright tests
run: sleep 5 && xvfb-run npx playwright test
env:
CI: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ yarn-error.log*
.pnpm-store/
.pnpm-debug.log
.idea

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
/dev-dist/
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,33 @@ It correctly bundles React in production mode and optimizes the build for the be

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

### `pnpm run regtest`

Starts the regtest environment and sets up the arkd instance. Requires Docker to be installed and [Nigiri](https://nigiri.vulpem.com/) to be running.

### e2e tests

> note: e2e tests require a regtest environment to be running.
> `pnpm run regtest` to start and setup the regtest environment.

> note: e2e tests use playwright for ui testing, you may need to run
> `pnpm exec playwright install` once to download new browsers.

Run the tests with:

```bash
pnpm run test:e2e
```

Run the tests in interactive mode with:

```bash
pnpm run test:e2e --ui
```

Access the playwright code generator tool with:

```bash
pnpm run test:codegen
```
18 changes: 9 additions & 9 deletions arkd.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# First image used to build the sources
FROM golang:1.24.6 AS builder
FROM golang:1.25.3 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG VERSION=v8
ARG BRANCH=v8
ARG VERSION

ARG BRANCH=master

WORKDIR /app

RUN git clone https://github.com/arkade-os/arkd.git && \
cd arkd && git checkout ${BRANCH}
RUN git clone https://github.com/arkade-os/arkd.git && cd arkd && git checkout ${BRANCH}

RUN mkdir -p bin && cd arkd && \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags="-X 'main.Version=${VERSION}'" -o /app/bin/arkd ./cmd/arkd

RUN mkdir -p bin && cd arkd/pkg/ark-cli && \
RUN cd arkd/pkg/ark-cli && \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags="-X 'main.Version=${VERSION}'" -o /app/bin/ark main.go

# Second image, running the arkd executable
FROM alpine:3.20
FROM alpine:3.22

RUN apk update && apk upgrade && rm -rf /var/cache/apk/*
RUN apk update && apk upgrade

WORKDIR /app

Expand All @@ -36,4 +36,4 @@ ENV ARK_WALLET_DATADIR=/app/wallet-data
VOLUME /app/data
VOLUME /app/wallet-data

ENTRYPOINT [ "arkd" ]
ENTRYPOINT [ "arkd" ]
15 changes: 6 additions & 9 deletions arkdwallet.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# First stage: build the ark-wallet-daemon binary
FROM golang:1.24.6 AS builder
FROM golang:1.25.3 AS builder

ARG VERSION
ARG TARGETOS
ARG TARGETARCH

ARG BRANCH=v8
ARG BRANCH=master

WORKDIR /app

RUN git clone https://github.com/arkade-os/arkd.git && \
cd arkd && \
git checkout ${BRANCH}
RUN git clone https://github.com/arkade-os/arkd.git && cd arkd && git checkout ${BRANCH}

RUN mkdir -p bin && \
cd arkd && \
RUN mkdir -p bin && cd arkd && \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags="-X 'main.Version=${VERSION}'" -o /app/bin/arkd-wallet ./cmd/arkd-wallet/main.go

# Second stage: minimal runtime image
FROM alpine:3.20
FROM alpine:3.22

RUN apk update && apk upgrade

Expand All @@ -32,4 +29,4 @@ ENV ARK_WALLET_DATADIR=/app/wallet-data

VOLUME /app/wallet-data

ENTRYPOINT [ "arkd-wallet" ]
ENTRYPOINT [ "arkd-wallet" ]
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
"@scure/btc-signer": "2.0.1",
"@sentry/react": "^9.15.0",
"decimal.js": "^10.5.0",
"dexie": "^4.0.11",
"dexie-react-hooks": "^1.1.7",
"dompurify": "^3.2.6",
"light-bolt11-decoder": "^3.2.0",
"nostr-tools": "^2.12.0",
Expand All @@ -35,10 +33,18 @@
"test": "vitest run",
"test:ui": "vitest run --ui",
"test:coverage": "vitest run --coverage",
"lint": "eslint --ext .ts,.tsx src",
"test:e2e": "playwright test",
"test:codegen": "playwright codegen localhost:3002",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"format": "prettier --write src",
"format:check": "prettier --check src",
"git-info": "node scripts/git-commit-info.js"
"git-info": "node scripts/git-commit-info.js",
"regtest": "pnpm regtest:down && pnpm regtest:build && pnpm regtest:up && pnpm regtest:setup",
"regtest:build": "docker compose -f test.docker-compose.yml build",
"regtest:up": "docker compose -f test.docker-compose.yml up -d",
"regtest:down": "docker compose -f test.docker-compose.yml down -v",
"regtest:setup": "node src/test/setup-arkd.js"
},
"eslintConfig": {
"extends": [
Expand All @@ -59,6 +65,7 @@
},
"devDependencies": {
"@eslint/compat": "^1.3.2",
"@playwright/test": "^1.56.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
Expand Down Expand Up @@ -89,10 +96,5 @@
"engines": {
"node": ">=20",
"pnpm": ">=8"
},
"pnpm": {
"overrides": {
"rollup": "4.44.2"
}
}
}
33 changes: 33 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
testDir: './src/test/e2e',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 5 : 0,
workers: 1,
reporter: 'list',
use: {
baseURL: 'http://localhost:3002',
headless: true,
viewport: { width: 1280, height: 800 },
trace: 'on-first-retry',
permissions: ['clipboard-read', 'clipboard-write'],
actionTimeout: 30000,
navigationTimeout: 30000,
},
webServer: {
command: 'pnpm start',
port: 3002,
},
projects: [
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 7'] },
},
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
}
],
});
Loading