Skip to content
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: Add CCTP E2E tests to CI #1843

Merged
merged 102 commits into from
Sep 9, 2024
Merged

test: Add CCTP E2E tests to CI #1843

merged 102 commits into from
Sep 9, 2024

Conversation

chrstph-dvx
Copy link
Contributor

Closes fs-729

Summary

Steps to test

@cla-bot cla-bot bot added the cla-signed label Aug 14, 2024
Copy link

vercel bot commented Aug 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Sep 3, 2024 7:18pm

cy.confirmSpending(USDCAmountToSend.toString())

/**
* Currently synpress cy.confirmMetamaskTransaction doesn't work on Sepolia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to fix this currently? We are also skipping 1 test coz of it which isn't ideal.

Comment on lines 158 to 165
e2e_content=$(cat packages/arb-token-bridge-ui/tests/e2e/specfiles.json | jq --compact-output .)
cctp_content=$(cat packages/arb-token-bridge-ui/tests/e2e/cctp.json | jq --compact-output .)

e2e_with_orbit=$(echo "$e2e_content" | jq '[.[] | {type: "regular", name: .name, file: .file, recordVideo: .recordVideo, orbitTest: "0"}, {type: "regular", name: .name, file: .file, recordVideo: .recordVideo, orbitTest: "1"}]' | jq . --compact-output)
cctp_formatted=$(echo "$cctp_content" | jq '[.[] | {type: "cctp", name: .name, file: .file, recordVideo: .recordVideo, orbitTest: null}]' | jq . --compact-output)

combined_content=$(echo "$e2e_with_orbit $cctp_formatted" | jq -s 'add' --compact-output)
echo "e2eFiles=$combined_content" >> $GITHUB_OUTPUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is way too chunky to read now

can you clean this up please?

we can also handle this in a separate file rather than inlining the processing script

test-e2e:
name: "Test E2E${{ matrix.orbit-test == '1' && ' with L3' || '' }} - ${{ matrix.tests.name }}"
name: "Test ${{ matrix.test.type == 'cctp' && 'E2E CCTP' || 'E2E' }}${{ matrix.test.type == 'regular' && matrix.test.orbitTest == '1' && ' with L3' || '' }} - ${{ matrix.test.name }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "Test ${{ matrix.test.type == 'cctp' && 'E2E CCTP' || 'E2E' }}${{ matrix.test.type == 'regular' && matrix.test.orbitTest == '1' && ' with L3' || '' }} - ${{ matrix.test.name }}"
name: "Test E2E ${{ matrix.test.type == 'cctp' && 'CCTP' || matrix.test.orbitTest == '1' && 'with L3' }} - ${{ matrix.test.name }}"

does this work?


- name: Run e2e tests via cypress-io/github-action
uses: cypress-io/github-action@8d3918616d8ac34caa2b49afc8b408b6a872a6f5 # pin@v6.7.1
with:
start: yarn start
command: ${{ matrix.orbit-test == '1' && 'yarn test:e2e:orbit --browser chromium' || 'yarn test:e2e --browser chromium' }}
command: ${{ matrix.test.type == 'cctp' && 'yarn test:e2e:cctp --browser chromium' || (matrix.test.orbitTest == '1' && 'yarn test:e2e:orbit --browser chromium' || 'yarn test:e2e --browser chromium') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
command: ${{ matrix.test.type == 'cctp' && 'yarn test:e2e:cctp --browser chromium' || (matrix.test.orbitTest == '1' && 'yarn test:e2e:orbit --browser chromium' || 'yarn test:e2e --browser chromium') }}
command: "yarn test:e2e${{ matrix.test.type == 'cctp' && ':cctp' || matrix.test.orbitTest == '1' && ':orbit' }} --browser chromium"

does this work?

Comment on lines +62 to +69
const SEPOLIA_INFURA_RPC_URL = `https://sepolia.infura.io/v3/${INFURA_KEY}`
const sepoliaRpcUrl =
process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL ?? SEPOLIA_INFURA_RPC_URL
const arbSepoliaRpcUrl = 'https://sepolia-rollup.arbitrum.io/rpc'

const sepoliaProvider = new StaticJsonRpcProvider(sepoliaRpcUrl)
const arbSepoliaProvider = new StaticJsonRpcProvider(arbSepoliaRpcUrl)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nbd but why move them?

.github/workflows/build-test.yml Outdated Show resolved Hide resolved
})
})

console.log(JSON.stringify(tests))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add end of file line?

.github/workflows/formatSpecfiles.js Show resolved Hide resolved
@chrstph-dvx chrstph-dvx merged commit f892b6a into master Sep 9, 2024
36 checks passed
@chrstph-dvx chrstph-dvx deleted the fs-729-add-cctp-e2e branch September 9, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants