Skip to content

Conversation

Copy link

Copilot AI commented Dec 1, 2025

Refactors PythonResultResolver to separate stateful concerns (ID mappings) from stateless processing logic (payload handling), following the design in resultHandlerRefactor.md.

New Components

  • TestItemIndex - Per-workspace state management for ID mappings (runId ↔ TestItem, runId ↔ vsId). Provides O(1) lookups with fallback strategies and stale reference cleanup.

  • TestDiscoveryHandler - Stateless singleton for discovery payload processing. Handles error nodes and test tree population.

  • TestExecutionHandler - Stateless singleton for execution results. Routes outcomes (success/failure/error/skip/subtest) and returns subtest stats to caller.

  • TestCoverageHandler - Stateless singleton for coverage payloads. Creates FileCoverage objects and returns detailed coverage map.

Updated Component

PythonResultResolver is now a pure facade:

// Shared singleton handlers (stateless, safe to share across workspaces)
private static discoveryHandler = new TestDiscoveryHandler();
private static executionHandler = new TestExecutionHandler();
private static coverageHandler = new TestCoverageHandler();

// Per-workspace state
private testItemIndex: TestItemIndex;

public _resolveExecution(payload: ExecutionTestPayload, runInstance: TestRun): void {
    this.subTestStats = PythonResultResolver.executionHandler.processExecution(
        payload, runInstance, this.testItemIndex, this.testController, this
    );
}

Other Changes

  • SubtestStats interface moved to types.ts to avoid duplication
  • Backward compatibility maintained via getter delegation to TestItemIndex
Original prompt

Fantastic! I love this plan! Now go an execute the switch to the new design

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits December 1, 2025 03:09
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
…processing

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
…processing

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
…ocessing

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
… usage

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Execute switch to the new design Refactor PythonResultResolver: Separate state from processing logic Dec 1, 2025
Copilot AI requested a review from eleanorjboyd December 1, 2025 03:32
Copilot finished work on behalf of eleanorjboyd December 1, 2025 03:32
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.

2 participants