Skip to content

test: add real OpenCode OTLP integration coverage - #135

Merged
dialupdisaster merged 3 commits into
mainfrom
test/opencode-otel-integration
Oct 5, 2026
Merged

dialupdisaster merged 3 commits into
mainfrom
test/opencode-otel-integration

Conversation

@dialupdisaster

Copy link
Copy Markdown
Contributor

Description

Add deterministic integration tests that run the real OpenCode SDK and telemetry plugin in isolated Bun subprocesses. A scripted OpenAI-compatible Chat Completions endpoint drives actual tool execution, while a temporary loopback OTLP/JSON receiver captures exported spans, metrics, and logs. No model credentials, Docker, or external collector are required.

  • Pin the OpenCode SDK and plugin development dependencies to matching 2.0.20 versions.
  • Add seven integration cases covering session/LLM telemetry, token attributes, trace parenting, real local read execution, and disabled tool tracing.
  • Include three explicit expected-failure regression cases for fix(tool): record locally executed tools in OpenCode V2 #134. These assert local tool spans and duration metrics; scenario setup and actual execution remain ordinary passing tests. Change both test.failing registrations to test when fix(tool): record locally executed tools in OpenCode V2 #134 lands.
  • Add bun run test:integration and documentation in tests/integration/README.md. The existing bun test CI step also runs this suite.
  • Isolate home, XDG directories, project config, database, and inherited environment; enforce a process deadline and clean up servers and temporary files.

No production plugin code changes.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Chore (dependency updates, etc.)

Checklist

  • I have read the CONTRIBUTING.md document
  • My code follows the style guidelines of this project
  • bun run lint passes with no errors
  • bun run check:jsdoc-coverage passes with no errors
  • bun run typecheck passes with no errors
  • bun test passes with no errors
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • My commits follow the Conventional Commits specification

Related issues

Relates to #134.

Additional context

Validation on this branch: 198 tests pass, including the three expected-failure cases; typecheck, lint, and JSDoc coverage pass. Separately ran all seven integration cases against an isolated copy of the #134 commit with expected-failure markers removed, and all seven passed normally.

The temporary receiver covers OTLP HTTP/JSON only. gRPC/protobuf transport coverage and additional scenarios (permissions, failures, commits, subagents) remain follow-up work.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

No actionable findings in the PR changes.

I couldn’t run the integration suite because bun is unavailable in this environment; review was limited to static inspection.

@dialupdisaster
dialupdisaster merged commit 64ccebc into main Oct 5, 2026
8 checks passed
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.

1 participant