Skip to content

Add unit tests for Log Streaming and Port-Forwarding state management #154

@bhf

Description

@bhf

Log streaming and port-forwarding state management in src/lib/k8s.ts are complex and prone to edge-case bugs.

Goal

Implement unit tests specifically for startPortForward, stopPortForward, getPodLogStream, and listPortForwards.

Challenges

  • These functions use net.Server and Writable/stream objects which are harder to mock.
  • Need to verify that connections and sockets are properly closed when stopping a port-forward.

Acceptance Criteria

  • Add tests for port-forwarding state in k8s.test.ts.
  • Add tests for log streaming callbacks.
  • Verify that the PortForward client is called with correct arguments.
  • Ensure that existing port-forwards are tracked across calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions