Skip to content

[BUG] Fix broken test suite — null byte in config path + missing gitlab export #171

@randomm

Description

@randomm

Problem

The test suite in packages/opencode has 58 test failures across 4 test files. Typecheck and build are green — only tests are broken.

Root Causes

Bug 1: Null byte in config path (57 failures)
Test setup creates a config directory path ending with \u0000 (null byte), producing:

ENOENT: no such file or directory, open '...opencode-test-data-.../home/.config/opencode\u0000'

Affected files:

  • test/permission-task.test.ts (6 failures)
  • test/snapshot/snapshot.test.ts (~40 failures)
  • test/skill/skill.test.ts (10 failures)
  • test/config/agent-color.test.ts (1 failure)

Bug 2: Missing gitlabAuthPlugin export (1 failure)
@gitlab/opencode-gitlab-auth package doesn't export gitlabAuthPlugin.
Affected: test/core/tasks.test.ts — crashes with SyntaxError: Export named 'gitlabAuthPlugin' not found

Bug 3 (not our code): Bun v1.3.6 segfault
Bun crashes with segfault after test completion. Runtime bug, may be fixed by upstream's Bun 1.3.8 upgrade.

Quality Gates (Non-Negotiable)

  • All 58 failing tests pass after fix
  • No new test suppressions (no skip, no TODO)
  • Typecheck still passes (bun run typecheck)
  • Build still passes (bun run build in packages/opencode)

Acceptance Criteria

  • Null byte path bug identified and fixed at source
  • gitlab plugin export resolved (fix import or exclude test)
  • Test suite runs green in packages/opencode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions