v1: executing-plans 模式生成,54 文件 1320 行 Python
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
from __future__ import annotations
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class BuildResult:
|
||||
success: bool
|
||||
artifact_path: str = ""
|
||||
log: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class RunResult:
|
||||
success: bool
|
||||
records: list[dict] = field(default_factory=list)
|
||||
log: str = ""
|
||||
coverage_exec: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class CoverageReport:
|
||||
branch_rate: float = 0.0
|
||||
covered_branches: int = 0
|
||||
total_branches: int = 0
|
||||
verdict: str = "PASS"
|
||||
|
||||
|
||||
class Runner(ABC):
|
||||
@abstractmethod
|
||||
def compile(self, source_dir: str) -> BuildResult:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def run(self, artifact: str, input_path: str, output_path: str) -> RunResult:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def get_coverage(self, artifact: str, run_id: str) -> CoverageReport:
|
||||
...
|
||||
Reference in New Issue
Block a user