-
Notifications
You must be signed in to change notification settings - Fork 0
Wallet and RPC integration and e2e tests #216
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
Open
OisinKyne
wants to merge
5
commits into
main
Choose a base branch
from
oisin/integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,98 @@ | ||
| # Wallet E2E Integration Test | ||
| # | ||
| # Deploys an OpenClaw instance with a wallet, funds it on Hoodi, | ||
| # sends a transaction, and verifies skills work end-to-end. | ||
| # | ||
| # Required secrets: | ||
| # ANTHROPIC_API_KEY — Anthropic API key for LLM provider | ||
| # HOODI_FUNDER_PRIVATE_KEY — hex private key of a pre-funded Hoodi testnet wallet | ||
|
|
||
| name: Wallet E2E | ||
|
|
||
| on: | ||
| # Temporary | ||
| push: | ||
| branches: | ||
| - oisin/integration | ||
| workflow_dispatch: {} | ||
| schedule: | ||
| # Weekly on Monday at 07:00 UTC — catch regressions without burning credits daily. | ||
| - cron: '0 7 * * 1' | ||
|
|
||
| env: | ||
| OBOL_CONFIG_DIR: ${{ github.workspace }}/.workspace/config | ||
| OBOL_BIN_DIR: ${{ github.workspace }}/.workspace/bin | ||
| OBOL_DATA_DIR: ${{ github.workspace }}/.workspace/data | ||
|
|
||
| jobs: | ||
| wallet-e2e: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Install k3d | ||
| run: | | ||
| curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash | ||
|
|
||
| - name: Install helmfile + helm-diff | ||
| run: | | ||
| curl -fsSL https://github.com/helmfile/helmfile/releases/download/v1.2.3/helmfile_1.2.3_linux_amd64.tar.gz \ | ||
| | tar -xzC /usr/local/bin helmfile | ||
| helm plugin install https://github.com/databus23/helm-diff --version v3.14.1 | ||
|
|
||
| - name: Build obol binary and link dependencies | ||
| run: | | ||
| mkdir -p .workspace/bin | ||
| go build -o .workspace/bin/obol ./cmd/obol | ||
| # obol looks for tools in OBOL_BIN_DIR — symlink the globally-installed ones. | ||
| for bin in k3d helm helmfile kubectl; do | ||
| if command -v "$bin" &>/dev/null && [ ! -e ".workspace/bin/$bin" ]; then | ||
| ln -s "$(command -v "$bin")" ".workspace/bin/$bin" | ||
| fi | ||
| done | ||
|
|
||
| - name: Start cluster | ||
| run: | | ||
| .workspace/bin/obol stack init | ||
| .workspace/bin/obol stack up | ||
| # Wait for default infrastructure to settle. | ||
| sleep 30 | ||
| .workspace/bin/obol kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=traefik -n traefik --timeout=120s || true | ||
| .workspace/bin/obol kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=erpc -n erpc --timeout=120s || true | ||
|
|
||
| - name: Run wallet E2E test | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| HOODI_FUNDER_PRIVATE_KEY: ${{ secrets.HOODI_FUNDER_PRIVATE_KEY }} | ||
| run: | | ||
| go test -tags integration -v -run 'TestIntegration_WalletE2E' \ | ||
| -timeout 20m ./internal/openclaw/ | ||
|
|
||
| - name: Collect logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Pod status ===" | ||
| .workspace/bin/obol kubectl get pods -A || true | ||
| echo "" | ||
| echo "=== Events ===" | ||
| .workspace/bin/obol kubectl get events -A --sort-by='.lastTimestamp' | tail -50 || true | ||
| echo "" | ||
| echo "=== OpenClaw logs ===" | ||
| .workspace/bin/obol kubectl logs -n openclaw-test-wallet-e2e deploy/openclaw -c openclaw --tail=50 || true | ||
| echo "" | ||
| echo "=== Remote-signer logs ===" | ||
| .workspace/bin/obol kubectl logs -n openclaw-test-wallet-e2e deploy/remote-signer --tail=50 || true | ||
|
|
||
| - name: Tear down cluster | ||
| if: always() | ||
| run: | | ||
| .workspace/bin/obol stack down || true | ||
| .workspace/bin/obol stack purge -f || true | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 18 hours ago
In general, fix this class of issue by explicitly declaring a
permissions:block that grants only the minimal required scopes, either at the workflow root (applies to all jobs) or for each job individually. For a typical test-only workflow that just checks out code and runs tests,contents: readis sufficient.For this specific file
.github/workflows/wallet-e2e.yml, the best fix without changing functionality is:permissions:block after theon:section (or beforejobs:) withcontents: read.wallet-e2ejob has a read-onlyGITHUB_TOKEN, which is enough foractions/checkoutand any implicit token use.writescopes.Concretely:
Insert:
between the
on:block (ending at line 20) and theenv:block (starting at line 22). No imports or additional definitions are required.