Skip to content

Add test harness with repo-string and tool-handler tests, update CI#36

Closed
jing11223344 wants to merge 2 commits into
eliottreich:mainfrom
jing11223344:fix/test-harness-ci
Closed

Add test harness with repo-string and tool-handler tests, update CI#36
jing11223344 wants to merge 2 commits into
eliottreich:mainfrom
jing11223344:fix/test-harness-ci

Conversation

@jing11223344
Copy link
Copy Markdown

@jing11223344 jing11223344 commented May 18, 2026

Summary

Adds a comprehensive test harness using Node.js built-in test runner (node:test) and updates the CI workflow to run tests on PRs.

Part of bounty #16 (test harness + CI).

Changes

New test files

  • test/repo-string.test.ts — Tests for the repo-string normalizer regex used in autopilot_enable. Covers valid inputs (owner/name, full URL, with/without .git, trailing slash) and invalid inputs (empty, non-GitHub URLs, fragments, spaces).
  • test/tool-handler.test.ts — Tests for missing-required-arg validation across all tool handlers. Covers submit_pr (4 required fields), create_bounty_draft (6 required fields), and single-arg tools (request_repo_access, fund_bounty, etc.).

Config changes

  • tsconfig.test.json — Extended to include test/**/*.test.ts files; set rootDir to . to accommodate both src/ and test/ directories.
  • .github/workflows/ci.yml — Updated the existing CI workflow to run tests with Node 20 and 22 (matrix build), gating PRs.

Verification

  • npm run build passes
  • TypeScript compilation of test files: tsc -p tsconfig.test.json passes
  • CI runs: npm test (build + compile tests + run with node --test)

Closes #16

Fixes hono (CVE-2024-XXXX, CVE-2024-XXXX, CVE-2024-XXXX) and ip-address (CVE-2024-XXXX) vulnerabilities via npm audit fix.
@jing11223344 jing11223344 force-pushed the fix/test-harness-ci branch from 55391b1 to a21e5b5 Compare May 18, 2026 23:33
@jing11223344 jing11223344 changed the title feat: add test harness and run in CI (fixes #16) feat: add test harness with CI integration (issue #16) May 18, 2026
…e CI

- Add test/repo-string.test.ts: tests for the repo-string normalizer
  (valid: owner/name, full URL, .git suffix; invalid: empty, non-GitHub URLs)
- Add test/tool-handler.test.ts: tests for missing-required-arg validation
  (submit_pr, create_bounty_draft, and single-arg tool handlers)
- Update tsconfig.test.json: include test/**/*.test.ts, set rootDir to '.'
- Update .github/workflows/ci.yml: add test step with Node 20/22 matrix

Part of bounty eliottreich#16 (test harness + CI).
@jing11223344 jing11223344 force-pushed the fix/test-harness-ci branch from a21e5b5 to 7d8edb1 Compare May 19, 2026 05:23
@jing11223344 jing11223344 changed the title feat: add test harness with CI integration (issue #16) Add test harness with repo-string and tool-handler tests, update CI May 19, 2026
@eliottreich
Copy link
Copy Markdown
Owner

Closing this competing submission. The TaskBounty bounty was awarded to another submission; the winning PR has been merged. Thanks for the attempt — find other open bounties at https://www.task-bounty.com/browse.

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.

Add a test harness and run it in CI

2 participants