Skip to content

Comments

Wallet and RPC integration and e2e tests#216

Open
OisinKyne wants to merge 5 commits intomainfrom
oisin/integration
Open

Wallet and RPC integration and e2e tests#216
OisinKyne wants to merge 5 commits intomainfrom
oisin/integration

Conversation

@OisinKyne
Copy link
Contributor

Need to test the action next

Comment on lines 25 to 88
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
run: |
mkdir -p .workspace/bin
go build -o .workspace/bin/obol ./cmd/obol

- 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

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 14 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: read is sufficient.

For this specific file .github/workflows/wallet-e2e.yml, the best fix without changing functionality is:

  • Add a workflow-level permissions: block after the on: section (or before jobs:) with contents: read.
  • This ensures the wallet-e2e job has a read-only GITHUB_TOKEN, which is enough for actions/checkout and any implicit token use.
  • No steps in this snippet need write access (no pushes, issue/PR mutations, or releases), so we do not grant any write scopes.

Concretely:

  • Insert:

    permissions:
      contents: read

    between the on: block (ending at line 20) and the env: block (starting at line 22). No imports or additional definitions are required.


Suggested changeset 1
.github/workflows/wallet-e2e.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/wallet-e2e.yml b/.github/workflows/wallet-e2e.yml
--- a/.github/workflows/wallet-e2e.yml
+++ b/.github/workflows/wallet-e2e.yml
@@ -19,6 +19,9 @@
     # Weekly on Monday at 07:00 UTC — catch regressions without burning credits daily.
     - cron: '0 7 * * 1'
 
+permissions:
+  contents: read
+
 env:
   OBOL_CONFIG_DIR: ${{ github.workspace }}/.workspace/config
   OBOL_BIN_DIR: ${{ github.workspace }}/.workspace/bin
EOF
@@ -19,6 +19,9 @@
# Weekly on Monday at 07:00 UTC — catch regressions without burning credits daily.
- cron: '0 7 * * 1'

permissions:
contents: read

env:
OBOL_CONFIG_DIR: ${{ github.workspace }}/.workspace/config
OBOL_BIN_DIR: ${{ github.workspace }}/.workspace/bin
Copilot is powered by AI and may make mistakes. Always verify output.
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.

1 participant