-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(e2e): set up tests on mainnet #6229
Changes from 28 commits
05e73ab
d8de590
e7ea3ea
c1a7f52
aa76258
6a504f5
1baaadd
c6a45df
109a159
54b8c6d
db7e0fd
a91898c
a173633
67cc45b
91372e5
6cef669
2baa2bd
0cefb3d
0876d4d
2a34cda
9f685f3
6745d5d
25e01d3
0efe530
2f9552d
a2388f7
3d6aee0
58d55e2
ba3c3ec
2c47c65
dfc681e
2602b2b
0881c28
aca37ad
70f1730
0b09568
e26e4de
3c6757f
40c3e2c
76159a4
107859b
c8c739e
693422a
2f47622
a92090d
12806e1
2c47ae5
f9fa7fd
f965d93
ee42ac9
0d8c381
b410f43
9b8aafe
054819d
19d75bd
83aa9ed
81f2de7
0631aca
e1bcf2b
88c711b
72a2fe0
8037cef
eb19296
36db417
a41d96a
427f1ba
c8b1014
f909346
1eb9487
438bd69
87179f5
0d7a861
d40b7c1
5ad0492
a5c6e1f
2badc5b
d77be26
f945fd5
228c7e0
4883f46
58372fd
23c6872
ff9c4e3
1689ab0
3af5770
b176dbf
9fde68d
3c2f6ff
2fd0c28
d837a85
202c026
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ on: | |
|
||
jobs: | ||
android: | ||
env: | ||
# `if` conditions can't directly access secrets, so we use a workaround | ||
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow | ||
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }} | ||
BASH_ENV: ~/.profile | ||
name: Android (SDK ${{ inputs.android-api-level }}) | ||
runs-on: | ||
- nscloud-ubuntu-22.04-amd64-16x64-with-cache | ||
|
@@ -17,6 +22,25 @@ jobs: | |
# If it takes longer it usually fails, so no need to pay for more | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: google-github-actions/auth@v2 | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
with: | ||
project_id: celo-mobile-mainnet | ||
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }} | ||
- name: Google Secrets | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
id: google-secrets | ||
uses: google-github-actions/[email protected] | ||
with: | ||
secrets: |- | ||
MuckT marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WALLET_CONNECT_PROJECT_ID_E2E:projects/1027349420744/secrets/WALLET_CONNECT_PROJECT_ID_E2E | ||
DEFAULT_RECIPIENT_MNEMONIC:projects/1027349420744/secrets/DEFAULT_RECIPIENT_MNEMONIC | ||
DEFAULT_RECIPIENT_PRIVATE_KEY:projects/1027349420744/secrets/DEFAULT_RECIPIENT_PRIVATE_KEY | ||
WALLET_MNEMONIC:projects/1027349420744/secrets/WALLET_MNEMONIC | ||
WALLET_PRIVATE_KEY:projects/1027349420744/secrets/WALLET_PRIVATE_KEY | ||
WALLET_SINGLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_SINGLE_VERIFIED_MNEMONIC | ||
WALLET_MULTIPLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_MULTIPLE_VERIFIED_MNEMONIC | ||
WALLET_12_WORDS_MNEMONIC:projects/1027349420744/secrets/WALLET_12_WORDS_MNEMONIC | ||
MuckT marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: actions/checkout@v4 | ||
- name: Set env | ||
run: | | ||
|
@@ -74,9 +98,6 @@ jobs: | |
run: yarn build:ts | ||
- name: Check E2E wallet balance | ||
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts | ||
- name: Create Android E2E .env File | ||
working-directory: e2e | ||
run: echo WALLET_CONNECT_PROJECT_ID_E2E=${{ secrets.WALLET_CONNECT_PROJECT_ID_E2E }} >> .env | ||
- name: Create Detox Build | ||
run: CELO_TEST_CONFIG=e2e yarn detox build -c android.release | ||
- name: Run Detox | ||
|
@@ -94,6 +115,15 @@ jobs: | |
--headless | ||
--retries 3 | ||
--device-boot-args="-snapshot ci_boot" | ||
env: | ||
WALLET_CONNECT_PROJECT_ID_E2E: ${{ steps.google-secrets.outputs.WALLET_CONNECT_PROJECT_ID_E2E }} | ||
DEFAULT_RECIPIENT_MNEMONIC: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_MNEMONIC }} | ||
DEFAULT_RECIPIENT_PRIVATE_KEY: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_PRIVATE_KEY }} | ||
WALLET_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MNEMONIC }} | ||
WALLET_PRIVATE_KEY: ${{ steps.google-secrets.outputs.WALLET_PRIVATE_KEY }} | ||
WALLET_SINGLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_SINGLE_VERIFIED_MNEMONIC }} | ||
WALLET_MULTIPLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MULTIPLE_VERIFIED_MNEMONIC }} | ||
WALLET_12_WORDS_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_12_WORDS_MNEMONIC }} | ||
- name: Publish Android JUnit Report | ||
if: always() | ||
uses: mikepenz/action-junit-report@v4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,21 @@ jobs: | |
name: balance-and-fund | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/auth@v2 | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this env be set in the first place, like how it's done in the above workflow? Otherwise I assume this will always evaluate to false? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 0d7a861, d40b7c1 and 5ad0492; example passing run: https://github.com/valora-inc/wallet/actions/runs/12039132275/job/33566304674. |
||
with: | ||
project_id: celo-mobile-mainnet | ||
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }} | ||
- name: Google Secrets | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
id: google-secrets | ||
uses: google-github-actions/[email protected] | ||
with: | ||
secrets: |- | ||
TEST_FAUCET_SECRET:projects/1027349420744/secrets/TEST_FAUCET_SECRET | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/yarn-install | ||
- name: Create E2E Fund .env File | ||
env: | ||
TEST_FAUCET_SECRET: ${{ secrets.TEST_FAUCET_SECRET }} | ||
working-directory: e2e | ||
run: echo TEST_FAUCET_SECRET=$TEST_FAUCET_SECRET >> .env | ||
- name: Run Balance and Fund | ||
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/fund-e2e-accounts.ts | ||
env: | ||
TEST_FAUCET_SECRET: ${{ steps.google-secrets.outputs.TEST_FAUCET_SECRET }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const E2E_TEST_WALLET = '0x6131a6d616a4be3737b38988847270a64bc10caa' | ||
export const E2E_TEST_WALLET_SECURE_SEND = '0x86b8f44386cb2d457db79c3dab8cf42f9d8a3fc0' | ||
export const E2E_TEST_FAUCET = '0xe5F5363e31351C38ac82DBAdeaD91Fd5a7B08846' | ||
export const E2E_TEST_WALLET = '0xebf95355cc5ea643179a02337f3f943fd8dd2bcb' | ||
export const E2E_TEST_WALLET_SECURE_SEND = '0x06f4b680c6cb1aeec4a3ce12c63ea18acb136aa3' | ||
export const E2E_TEST_FAUCET = '0xa694b396cd6f73e4003da8f97f4b12e498b3f2ec' | ||
export const REFILL_TOKENS = ['CELO', 'cUSD', 'cEUR'] |
MuckT marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
MuckT marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we currently use this in our iOS workflow, but for my own curiosity, when would this ever evaluate to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link has a bit more info about the workaround listed; however, I couldn't find an example where
SECRETS_AVAILABLE
would return false.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if secrets are not available, is there a reason to run the entire workflow over failing early? It seems like only some steps are behind the condition, but I assume if no secrets are available, the entire suite will fail right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could look into failing early, but that seems like an improvement that should be made in a separate stream of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we make an issue and add a TODO for this? seems like something we could easily forget