Skip to content

feat: add E2E profile test with Anthropic API probe#44

Merged
Keith-CY merged 3 commits intodevelopfrom
feat/e2e-profile-test
Mar 3, 2026
Merged

feat: add E2E profile test with Anthropic API probe#44
Keith-CY merged 3 commits intodevelopfrom
feat/e2e-profile-test

Conversation

@dev01lay2
Copy link
Copy Markdown
Collaborator

What

Adds an end-to-end integration test that:

  1. Creates an Anthropic/Claude profile (claude-sonnet-4-20250514)
  2. Persists it to storage via upsert_profile and verifies with list_profiles
  3. Probes the Anthropic API with a real HTTP request to verify the key works

CI Workflow

New e2e.yml workflow:

  • Runs on push/PR to main and develop
  • Uses GitHub environments (production / development) to scope the ANTHROPIC_API_KEY secret
  • Test gracefully skips when the key is absent (safe for local dev / forks)

Setup Required

  1. Create two GitHub environments: production and development
  2. Add the ANTHROPIC_API_KEY secret to both environments
  3. Do not add it as a repo-level secret (keeps it scoped)

Files

  • clawpal-core/tests/profile_e2e.rs — the E2E test
  • .github/workflows/e2e.yml — CI workflow
  • clawpal-core/Cargo.toml — adds reqwest as dev-dependency

Co-authored-by: dev01lay2 <dev01lay2@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39df4f1276

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

dev01lay2 commented Mar 3, 2026

🧪 Test Coverage Report

PR #44: feat: add E2E profile test with Anthropic API probe
Branch: feat/e2e-profile-testmain

Rust Tests (clawpal-core)

main (base) feat/e2e-profile-test (PR) Δ
✅ Pass 139 140 1
❌ Fail 1 0 -1
⏭️ Skip 0 0

TypeScript Tests (bun)

main (base) feat/e2e-profile-test (PR) Δ
✅ Pass 9 -9
❌ Fail 0 0
📊 Line Coverage 100.00% N/A%

Updated: 2026-03-03 02:35 UTC · clawpal-pr-coverage bot

- New integration test: creates an Anthropic/Claude profile, persists it,
  then makes a real API call to verify the key works
- Skips gracefully when ANTHROPIC_API_KEY is absent (local dev)
- New CI workflow (e2e.yml) runs on push/PR to main/develop
- Uses GitHub environments (production/development) to scope the secret
On pull_request events, github.ref is refs/pull/<id>/merge, so the
environment always resolved to 'development'. Now checks github.base_ref
(the PR target branch) for PRs, and github.ref for push events.
@Keith-CY Keith-CY changed the base branch from main to develop March 3, 2026 02:54
Copy link
Copy Markdown
Collaborator

@Keith-CY Keith-CY left a comment

Choose a reason for hiding this comment

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

Reviewed PR #44. No blocking issues found.

  • The e2e test correctly uses an env-gated skip path when ANTHROPIC_API_KEY is absent.
  • The added workflow wiring (environment + job config) is coherent and matches the stated intent.
  • profiles_path() usage and temp-data-dir isolation in the test align with existing profile tests.

Non-blocking note:

  1. The workflow silently passes for pull_request runs when ANTHROPIC_API_KEY is unavailable (intentional), which means merge-time validation is bypassed on contexts without the secret.
  2. If a long-lived key is revoked or downgraded, the fixed model claude-sonnet-4-20250514 may cause repeated CI failures; consider making the probed model configurable or adding clearer error guidance.

@Keith-CY Keith-CY merged commit ea48c9a into develop Mar 3, 2026
3 checks passed
@Keith-CY Keith-CY deleted the feat/e2e-profile-test branch March 3, 2026 03:00
dev01lay2 added a commit that referenced this pull request Mar 3, 2026
Co-authored-by: dev01lay2 <dev01lay2@users.noreply.github.com>
fix: prevent ETXTBSY race in openclaw test helper (#41)
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