Skip to content

feat: [E2E] Parallel E2E tests, devstack cmd, and CI workflow#222

Merged
sadiq1971 merged 22 commits intomainfrom
sadiq/e2e-improvements
Apr 27, 2026
Merged

feat: [E2E] Parallel E2E tests, devstack cmd, and CI workflow#222
sadiq1971 merged 22 commits intomainfrom
sadiq/e2e-improvements

Conversation

@sadiq1971
Copy link
Copy Markdown
Member

Summary

  • Parallel E2E tests: all applicable tests now call t.Parallel() as the first statement; a package-level anvilFundingMu mutex in dsl.go serializes Anvil nonce operations so parallelism is safe
  • DSL.NewFundedAccount: new helper that generates a fresh EVM account and funds it with ETH and/or ERC-20 tokens (accepts whole-unit int amounts); used by bridge and indexer tests instead of the shared AnvilAccount0
  • tests/e2e/cmd/devstack: standalone Go CLI (up/down) that wraps the docker compose lifecycle; Makefile and CI call this instead of raw docker compose commands
  • Simplified presets.DoMain: docker lifecycle removed; DoMain now only performs service discovery — the devstack must be running before tests start
  • Makefile: devstack-up / devstack-down targets; CANTON_MASTER_KEY generated once at parse time via export; test-e2e runs all three suites via existing targets
  • CI workflow (.github/workflows/e2e.yml): resolves CANTON_MASTER_KEY once into $GITHUB_ENV, starts devstack, runs api → bridge → indexer, stops devstack unconditionally
  • HTTP 403 fix: pkg/transfer/service.go now maps gRPC INVALID_ARGUMENT/PERMISSION_DENIED from Canton signature verification to ForbiddenError instead of HTTP 500

Test plan

  • make devstack-up starts the stack cleanly with CANTON_MASTER_KEY in env
  • make test-e2e-api / test-e2e-bridge / test-e2e-indexer each pass individually
  • make test-e2e runs all three suites sequentially against one devstack
  • go test -count=1 ./pkg/transfer/... passes (covers the 403 fix)
  • CI workflow triggers on PR and completes without error

@sadiq1971 sadiq1971 changed the title feat: parallel E2E tests, devstack cmd, and CI workflow feat: [E2E] Parallel E2E tests, devstack cmd, and CI workflow Apr 17, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a standalone devstack management tool and refactors the E2E test suite to support parallel execution. Key improvements include a mutex-protected NewFundedAccount helper to prevent nonce collisions in Anvil, updated Makefile targets for devstack lifecycle management, and the addition of t.Parallel() to numerous tests for increased performance. Furthermore, the TransferService was updated to map specific gRPC errors to forbidden responses. Review feedback suggests implementing a timeout for service discovery to prevent indefinite hangs and improving error handling in the account funding helper to catch configuration issues early.

Comment thread tests/e2e/devstack/presets/presets.go Outdated
Comment thread tests/e2e/devstack/dsl/dsl.go Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@3b406d6). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #222   +/-   ##
=======================================
  Coverage        ?   32.64%           
=======================================
  Files           ?      124           
  Lines           ?     8658           
  Branches        ?        0           
=======================================
  Hits            ?     2826           
  Misses          ?     5582           
  Partials        ?      250           
Flag Coverage Δ
unittests 32.64% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/transfer/service.go 58.33% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sadiq1971 sadiq1971 self-assigned this Apr 17, 2026
@salindne
Copy link
Copy Markdown
Contributor

I think first gemini comment should be addressed for sure

Comment thread .github/workflows/e2e.yml
Comment thread .github/workflows/e2e.yml
Copy link
Copy Markdown
Contributor

@salindne salindne left a comment

Choose a reason for hiding this comment

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

Looks good, some small comments

Base automatically changed from sadiq/feat/indexer-e2e to main April 27, 2026 10:51
@dhyaniarun1993
Copy link
Copy Markdown
Member

@sadiq1971 need rebase

- Add .github/workflows/e2e.yml: single job resolves CANTON_MASTER_KEY
  once via GITHUB_ENV then runs devstack-up + all three suites + devstack-down
- Add /devstack to .gitignore to prevent compiled binary from being tracked
- Write remappings.txt before forge script to override broken
  foundry.toml remappings (LayerZero paths that don't exist in CI)
- Delete foundry.lock to skip lock validation for missing packages
- Add || true to forge clean to guard against pre-existing failures
- Dump deployer container logs on devstack up failure for diagnosis
The foundry nightly image now runs as a non-root user, which cannot
write to the mounted contracts/ethereum-wayfinder volume in CI (owned
by the runner's UID). Adding user: root ensures forge can create
out/, cache/, and broadcast/ in the mounted directory.
@sadiq1971 sadiq1971 force-pushed the sadiq/e2e-improvements branch from 0a60c1d to f6a13af Compare April 27, 2026 14:47
- Add 2-minute timeout to service discovery in DoMain to prevent
  indefinite hangs when the devstack is unresponsive
- Fail fast in NewFundedAccount when tokens > 0 but tokenAddr is zero
  address, instead of silently skipping the ERC-20 transfer
- Add missing trigger paths to e2e workflow (docker-compose.yaml,
  Makefile, contracts/**, go.mod, go.sum)
- Document why the SSH-to-HTTPS git rewrite is required (submodules
  canton-erc20 and ethereum-wayfinder use SSH URLs)
@sadiq1971 sadiq1971 merged commit 2a35813 into main Apr 27, 2026
4 checks passed
@sadiq1971 sadiq1971 deleted the sadiq/e2e-improvements branch April 27, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants