Skip to content

Add E2E tests for skills overwrite protection and CLI#4010

Open
JAORMX wants to merge 3 commits intomainfrom
3655-e2e-skills-tests
Open

Add E2E tests for skills overwrite protection and CLI#4010
JAORMX wants to merge 3 commits intomainfrom
3655-e2e-skills-tests

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Mar 5, 2026

Summary

Closes #3655

All server wiring, service implementation, handlers, and CLI commands were already complete. This PR adds the missing E2E test coverage identified in the acceptance criteria:

  • Overwrite protection tests (API-level): duplicate install → 409, reinstall after uninstall succeeds, force flag allows overwrite
  • Build + validate lifecycle (API-level): validate then build the same skill directory end-to-end
  • CLI-level E2E tests (new cli_skills_test.go): tests thv skill commands (validate, build, install, list, info, uninstall) via the compiled binary with TOOLHIVE_API_URL pointing to a test server — proving the full CLI → REST API → service flow

Test plan

  • Existing API skills E2E tests continue to pass (LABEL_FILTER=skills)
  • New overwrite protection tests pass
  • New CLI skills E2E tests pass
  • No regressions in other E2E tests

🤖 Generated with Claude Code

Add missing E2E test coverage for the skills lifecycle (issue #3655):

- Overwrite protection: test duplicate install returns 409, reinstall
  after uninstall succeeds, and force flag allows overwrite
- Build + validate lifecycle: validate then build the same skill dir
- CLI-level E2E tests: new cli_skills_test.go testing the full
  thv skill CLI → REST API → service flow including validate, build,
  install, list, info, uninstall, and a full lifecycle test

Closes #3655

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 5, 2026
The E2E CI matrix filters by label (core, mcp, api, etc). Without
the "api" label, CLI skills tests would not run in any CI job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.63%. Comparing base (c90c41c) to head (8a7d079).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4010      +/-   ##
==========================================
- Coverage   68.63%   68.63%   -0.01%     
==========================================
  Files         439      439              
  Lines       44868    44868              
==========================================
- Hits        30797    30793       -4     
- Misses      11678    11682       +4     
  Partials     2393     2393              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The force flag controls filesystem overwrite of unmanaged directories,
not DB duplicate bypass. A duplicate install with force still returns
409 because the DB record already exists. Updated the test expectation
to match this behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServerBuilder wiring and E2E tests

3 participants