From 1ffc5dd1eae575f24219794e482361f01cf5b1c8 Mon Sep 17 00:00:00 2001 From: Isidro Date: Sat, 3 Feb 2024 21:45:58 -0600 Subject: [PATCH 1/4] ci: update variable accessibility --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index cb29dd3..ea7c2c5 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -58,7 +58,7 @@ jobs: working-directory: ./packages/contracts run: yarn install --immutable - name: Run Tests - run: forge test --root ./packages/contracts --fork-url https://eth-goerli.g.alchemy.com/v2/${{vars.ALCHEMY_API_KEY}} + run: forge test --root ./packages/contracts --fork-url https://eth-goerli.g.alchemy.com/v2/${{secrets.ALCHEMY_API_KEY}} run_app_unit_and_e2e_tests: runs-on: ubuntu-latest From 2126b4687a6c57b841c3b04b47d078df028ad47e Mon Sep 17 00:00:00 2001 From: Isidro Date: Sat, 3 Feb 2024 22:47:06 -0600 Subject: [PATCH 2/4] test: Add download test --- packages/app/package.json | 1 + packages/app/scripts/test-e2e.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index cfea0d8..5427814 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -24,6 +24,7 @@ "test": "jest --runInBand --testPathIgnorePatterns='e2e' --reporters=default --reporters=jest-junit", "start-e2e-test-server": "yarn serve", "test:e2e-ui": "CI=true jest ./tests/e2e-ui*.test.*", + "test:e2e-dl": "CI=true jest ./tests/e2e-dl*.test.*", "test:full-e2e": "bash scripts/test-e2e.sh", "test:e2e-zkp": "CI=true jest ./tests/e2e-dl-zkp.test.ts" }, diff --git a/packages/app/scripts/test-e2e.sh b/packages/app/scripts/test-e2e.sh index 7f38cb8..252a325 100644 --- a/packages/app/scripts/test-e2e.sh +++ b/packages/app/scripts/test-e2e.sh @@ -2,4 +2,4 @@ # Execute E2E test # This file is required in the CI -yarn start-e2e-test-server & yarn test:e2e-ui \ No newline at end of file +yarn start-e2e-test-server & yarn test:e2e-ui & yarn test:e2e-dl \ No newline at end of file From 3f259176a1315427276d8d406848b9b60e4b2d6a Mon Sep 17 00:00:00 2001 From: Isidro Date: Sun, 4 Feb 2024 09:50:13 -0600 Subject: [PATCH 3/4] test: Add puppet args and env variables --- .github/workflows/action.yml | 4 +++- packages/app/scripts/test-e2e.sh | 2 +- packages/app/tests/e2e-dl-zkp.test.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index ea7c2c5..cd1c824 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -62,6 +62,7 @@ jobs: run_app_unit_and_e2e_tests: runs-on: ubuntu-latest + environment: development steps: - uses: actions/checkout@v3 - name: Set Node.js 16.x @@ -70,7 +71,8 @@ jobs: node-version: 16 cache: 'yarn' env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' + VITE_CONTRACT_ADDRESS: ${{ vars.CONTRACT_ADDRESS }} + VITE_CIRCUIT_ARTIFACTS_URL: ${{ vars.CIRCUIT_ARTIFACTS_URL }} - name: Install Yarn dependencies working-directory: ./packages/app run: yarn install diff --git a/packages/app/scripts/test-e2e.sh b/packages/app/scripts/test-e2e.sh index 252a325..691aa51 100644 --- a/packages/app/scripts/test-e2e.sh +++ b/packages/app/scripts/test-e2e.sh @@ -2,4 +2,4 @@ # Execute E2E test # This file is required in the CI -yarn start-e2e-test-server & yarn test:e2e-ui & yarn test:e2e-dl \ No newline at end of file +yarn start-e2e-test-server & (yarn test:e2e-zkp && yarn test:e2e-ui) \ No newline at end of file diff --git a/packages/app/tests/e2e-dl-zkp.test.ts b/packages/app/tests/e2e-dl-zkp.test.ts index 0da80f7..08105c4 100644 --- a/packages/app/tests/e2e-dl-zkp.test.ts +++ b/packages/app/tests/e2e-dl-zkp.test.ts @@ -57,6 +57,8 @@ describe("App.js", () => { beforeAll(async () => { browser = await puppeteer.launch({ // headless: true, + args: ['--no-sandbox'], + executablePath: process.env.PUPPETEER_EXEC_PATH, headless: false, slowMo: 100 }); From 19efd41c7fe0e2b6f01afe553b7b0e369742a1c3 Mon Sep 17 00:00:00 2001 From: Isidro Date: Sun, 4 Feb 2024 11:45:16 -0600 Subject: [PATCH 4/4] ci: Update environment variables --- .github/workflows/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index cd1c824..5b52ae7 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,5 +1,8 @@ name: Proof of Twitter tests on: [push] +env: + VITE_CONTRACT_ADDRESS: ${{ vars.VITE_CONTRACT_ADDRESS }} + VITE_CIRCUIT_ARTIFACTS_URL: ${{ vars.VITE_CIRCUIT_ARTIFACTS_URL }} jobs: run_circuit_tests: runs-on: ubuntu-latest @@ -71,8 +74,7 @@ jobs: node-version: 16 cache: 'yarn' env: - VITE_CONTRACT_ADDRESS: ${{ vars.CONTRACT_ADDRESS }} - VITE_CIRCUIT_ARTIFACTS_URL: ${{ vars.CIRCUIT_ARTIFACTS_URL }} + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' - name: Install Yarn dependencies working-directory: ./packages/app run: yarn install