from abc import ABC, abstractmethod
from logging import Logger
from typing import override

from pydantic import BaseModel

from test_automation_suite.core.context import Context
from test_automation_suite.core.task import Step, StepResult, Task


class BenchmarkConfig(BaseModel):
    loops: int
    timeout: int
    settings: dict
    metered_parameters: list[str]


class Benchmark(Task, ABC):
    benchmark_config: BenchmarkConfig

    @abstractmethod
    @override
    def steps(self) -> list[Step]:
        return [*super().steps(), self.step_prepare]

    def step_prepare(self, _context: Context, _logger: Logger) -> StepResult:
        # TODO: implement
        return StepResult(success=True)
