-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(e2e-contracts-test): make tests run on testnet (#1380)
- Closes #1376
- Loading branch information
1 parent
4a20b3d
commit 888334e
Showing
45 changed files
with
591 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: 'E2E Contract Tests' | ||
|
||
inputs: | ||
providerUrl: | ||
description: Provider URL (e.g. https://testnet.fuel.network/v1/graphql) | ||
required: true | ||
masterMnemonic: | ||
description: Mnemonic of the master wallet that will fund the tests | ||
required: true | ||
genesisSecret: | ||
description: Secret of genesis to fund the master wallet | ||
required: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
|
||
|
||
- name: Build Application | ||
shell: bash | ||
run: pnpm build:all | ||
env: | ||
## increase node.js m memory limit for building | ||
## with sourcemaps | ||
NODE_OPTIONS: "--max-old-space-size=4096" | ||
NODE_ENV: test | ||
|
||
# E2E tests running with Playwright | ||
- name: Install Playwright Browsers | ||
shell: bash | ||
run: npx playwright install --with-deps chromium | ||
|
||
- name: Run E2E Contract Tests | ||
shell: bash | ||
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts | ||
env: | ||
VITE_FUEL_PROVIDER_URL: ${{ inputs.providerUrl }} | ||
VITE_MASTER_WALLET_MNEMONIC: ${{ inputs.masterMnemonic }} | ||
VITE_WALLET_SECRET: ${{ inputs.genesisSecret }} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: | | ||
packages/app/playwright-report/ | ||
packages/app/playwright-html/ | ||
retention-days: 30 | ||
|
||
- name: Stop Test Node | ||
shell: bash | ||
run: pnpm node:clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Devnet tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
masterMnemonic: | ||
description: Mnemonic of the wallet that will fund the tests | ||
required: false | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests-e2e-contracts: | ||
name: E2E Contract Tests - Devnet | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: FuelLabs/github-actions/setups/node@master | ||
with: | ||
node-version: 18.18.0 | ||
pnpm-version: 8.15.7 | ||
- uses: FuelLabs/github-actions/setups/docker@master | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run PNPM install | ||
id: pnpm-cache | ||
run: | ||
pnpm recursive install --frozen-lockfile | ||
|
||
- name: Generate .env app | ||
run: cp packages/app/.env.example packages/app/.env | ||
|
||
- name: Generate .env e2e-contracts | ||
run: cp packages/e2e-contract-tests/.env.example packages/e2e-contract-tests/.env | ||
|
||
- name: Run E2E Contract Tests - Devnet | ||
uses: ./.github/actions/e2e-tests-contracts | ||
with: | ||
providerUrl: "https://devnet.fuel.network/v1/graphql" | ||
masterMnemonic: ${{ inputs.masterMnemonic || secrets.VITE_MASTER_WALLET_MNEMONIC }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Testnet tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
masterMnemonic: | ||
description: Mnemonic of the wallet that will fund the tests | ||
required: false | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests-e2e-contracts: | ||
name: E2E Contract Tests - Testnet | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: FuelLabs/github-actions/setups/node@master | ||
with: | ||
node-version: 18.18.0 | ||
pnpm-version: 8.15.7 | ||
- uses: FuelLabs/github-actions/setups/docker@master | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run PNPM install | ||
id: pnpm-cache | ||
run: | ||
pnpm recursive install --frozen-lockfile | ||
|
||
- name: Generate .env app | ||
run: cp packages/app/.env.example packages/app/.env | ||
|
||
- name: Generate .env e2e-contracts | ||
run: cp packages/e2e-contract-tests/.env.example packages/e2e-contract-tests/.env | ||
|
||
- name: Run E2E Contract Tests - Testnet | ||
uses: ./.github/actions/e2e-tests-contracts | ||
with: | ||
providerUrl: "https://testnet.fuel.network/v1/graphql" | ||
masterMnemonic: ${{ inputs.masterMnemonic || secrets.VITE_MASTER_WALLET_MNEMONIC }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node-version=18.14.1 | ||
node-version=18.18.0 | ||
strict-peer-dependencies=false | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.14.1 | ||
18.18.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"description": "Fuel Wallet", | ||
"author": "Fuel Labs <[email protected]> (https://fuel.network/)", | ||
"engines": { | ||
"node": ">=18.14.1", | ||
"node": ">=18.18.0", | ||
"pnpm": ">=8" | ||
}, | ||
"homepage": "https://github.com/FuelLabs/fuels-wallet", | ||
|
@@ -113,7 +113,9 @@ | |
"zod@<=3.22.2": ">=3.22.3", | ||
"nth-check": ">=2.1.1", | ||
"@adobe/css-tools@<4.3.2": ">=4.3.2", | ||
"@babel/traverse@<7.23.2": ">=7.23.2" | ||
"@babel/traverse@<7.23.2": ">=7.23.2", | ||
"braces@<3.0.3": ">=3.0.3", | ||
"ws": "8.17.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
VITE_CRX_NAME="Fuel Wallet Development" | ||
VITE_CRX_VERSION_API="https://fuellabs.github.io/fuels-wallet/latest.json" | ||
VITE_FUEL_PROVIDER_URL=https://testnet.fuel.network/v1/graphql | ||
VITE_FUEL_FAUCET_URL=https://faucet-testnet.fuel.network/ | ||
VITE_EXPLORER_URL=https://app.fuel.network/ | ||
VITE_MNEMONIC_WORDS=12 | ||
VITE_ADDR_OWNER=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298 | ||
GENESIS_SECRET=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298 | ||
VITE_AUTO_LOCK_IN_MINUTES=1 | ||
VITE_SENTRY_DSN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PORT=5173 | ||
VITE_FUEL_PROVIDER_URL="http://localhost:4000/v1/graphql" | ||
VITE_WALLET_SECRET=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298 | ||
VITE_WALLET_SECRET= # leave it empty to skip seed wallet | ||
VITE_MASTER_WALLET_MNEMONIC= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.