Skip to content

ci: E2E integration test against latest OpenClaw#64

Merged
vincentkoc merged 17 commits intomainfrom
ci/e2e-integration-test
Apr 21, 2026
Merged

ci: E2E integration test against latest OpenClaw#64
vincentkoc merged 17 commits intomainfrom
ci/e2e-integration-test

Conversation

@gidim
Copy link
Copy Markdown
Contributor

@gidim gidim commented Apr 10, 2026

Problem

Unit tests can't catch the class of bug fixed in #59 — hooks silently dropped due to OpenClaw plugin lifecycle changes. OpenClaw moves fast; we need a test that will break if a future OpenClaw release breaks the plugin again.

What this adds

A self-contained E2E workflow (.github/workflows/e2e.yml) that:

  1. Installs the latest published OpenClaw (npm install -g openclaw@latest)
  2. Builds the plugin from source and installs the tarball into OpenClaw
  3. Starts a mock Opik server (scripts/mock-opik-server.mjs) that captures all trace/span API calls
  4. Starts a mock LLM server (scripts/mock-llm-server.mjs) — OpenAI-compatible, returns a canned response so no real API key is needed
  5. Runs a real gateway turn (openclaw agent --message "ping")
  6. Asserts that the mock Opik server received ≥1 trace batch and ≥1 span batch

If the PR #59 regression had existed, step 6 would have caught it — zero traces would have reached the mock server.

No secrets required

Both LLM and Opik are mocked locally. The workflow is fully self-contained.

Matrix

The workflow runs against openclaw@latest today. The matrix can be extended to pin specific versions as OpenClaw ships new releases.

Files

File Purpose
.github/workflows/e2e.yml CI workflow
scripts/mock-opik-server.mjs Captures Opik API calls, writes e2e-result.json
scripts/mock-llm-server.mjs OpenAI-compatible mock, supports streaming + non-streaming
scripts/check-e2e-result.mjs Reads result file, exits non-zero if traces/spans missing

Installs OpenClaw fresh, builds the plugin from source, starts the
gateway with a mock LLM + mock Opik server, runs a real agent turn,
and asserts traces and spans were exported. Catches hook-lifecycle
regressions that unit tests cannot detect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gidim gidim requested a review from a team as a code owner April 10, 2026 18:43
Gideon Mendels and others added 16 commits April 10, 2026 14:44
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openclaw latest now requires Node >=22.14.0; pinning to 22.12.0 broke
the plugin install step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
npm@latest self-upgrade breaks on Node 22.22.2 in GitHub Actions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gateway.auth must be an object: {"mode": "none"}
- models.providers.openai.apiUrl -> baseUrl
- models.providers.openai.models is required (array)
- remove unrecognized keys: models.defaults, agents.defaults.provider

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Model config uses agents.defaults.model.primary with provider/model
format. Credentials go under auth.profiles, not models.providers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
auth.profiles only accepts provider and mode — apiUrl and apiKey
are loaded from OPENAI_API_KEY and OPENAI_BASE_URL env vars.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openclaw agent requires --to, --session-id, or --agent to target a session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use token auth so CLI has operator scope
- Write per-agent auth-profiles.json for OpenAI API key
- Pass OPENCLAW_GATEWAY_TOKEN to agent turn command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openclaw@latest install consistently takes 10+ minutes. Caching the
npm global prefix directory cuts that to seconds on cache hits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All steps that connect to the gateway need OPENCLAW_GATEWAY_TOKEN.
Setting it at job level avoids missing it on health checks and stop steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vincentkoc vincentkoc merged commit 29e4ad4 into main Apr 21, 2026
1 check passed
@vincentkoc vincentkoc deleted the ci/e2e-integration-test branch April 21, 2026 18:30
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.

2 participants