Skip to content

Fix test/plugin desynchronization and add missing test coverage #76

Closed

Description

@striderZA

The plugin test suite has a critical structural flaw: all 11 test files re-implement handler logic locally instead of importing from the actual plugin code. This means tests validate their own copies, not the production code — bugfixes to plugins are invisible to the test suite.

Additionally, two plugins have zero test coverage: drift-detector.ts and changelog-generator.ts.

Tasks

  • Refactor all 11 test files in .opencode/plugins/tests/ to import handlers from ../ccgs-hooks.ts instead of copying logic
  • Add test suite for drift-detector.ts (complex frontmatter parsing, section detection, severity assignment)
  • Add test suite for changelog-generator.ts (at minimum parseConventionalCommits() and format generators)
  • Configure package.json with a proper test script (currently "test": "echo \"Error: no test specified\" && exit 1")
  • Verify all 127+ existing test scenarios still pass after refactor

Affected Files

  • .opencode/plugins/tests/test-*.mjs (11 files)
  • .opencode/plugins/ccgs-hooks.ts (may need to export handlers)
  • .opencode/plugins/drift-detector.ts (needs test file)
  • .opencode/plugins/changelog-generator.ts (needs test file)
  • package.json

Identified during comprehensive framework review on 2026-07-21

Activity

  1. added
    testingTest suite, test coverage, test infrastructure
    framework-reviewIdentified during comprehensive framework review
    on Jul 21, 2026
  2. striderZA commented on Jul 22, 2026

    @striderZA
    OwnerAuthor

    All three tasks are complete and verified:

    • ✅ All 13 test files import handlers from their actual plugin code (ccgs-hooks.ts, drift-detector.ts, changelog-generator.ts) — no local re-implementations
    • ✅ drift-detector test suite covers parseFrontmatter, detectAgentDrift, detectSkillDrift, detectCommandDrift
    • ✅ changelog-generator test suite covers parseConventionalCommits, generateInternalChangelog, generatePlayerChangelog
    • ✅ All tests use native node:test runner (describe/it)

    158 tests, 18 suites, 0 failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    framework-reviewIdentified during comprehensive framework reviewpriority-criticalMust fix immediatelytestingTest suite, test coverage, test infrastructure

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions