add 真实well数据覆盖
This commit is contained in:
@@ -534,6 +534,33 @@ class APITestOrchestrator:
|
||||
else:
|
||||
self.logger.info("No stages_dir provided, stage testing will be skipped.")
|
||||
|
||||
# 完成其他初始化
|
||||
self.output_dir_path = Path(output_dir) if output_dir else Path("./test_reports_orchestrator")
|
||||
try:
|
||||
self.output_dir_path.mkdir(parents=True, exist_ok=True)
|
||||
self.logger.info(f"Orchestrator output directory set to: {self.output_dir_path.resolve()}")
|
||||
except OSError as e:
|
||||
self.logger.warning(f"Could not create orchestrator output directory {self.output_dir_path}: {e}. Falling back to current directory.")
|
||||
self.output_dir_path = Path(".")
|
||||
|
||||
self.schema_cache: Dict[str, Type[BaseModel]] = {}
|
||||
self.model_name_counts: Dict[str, int] = defaultdict(int)
|
||||
self.parser = InputParser()
|
||||
self.json_resolver_cache: Dict[str, Any] = {}
|
||||
self.json_validator = JSONSchemaValidator()
|
||||
|
||||
# 将字符串类型的 strictness_level 转换为 TestSeverity 枚举成员
|
||||
self.strictness_level: Optional[TestSeverity] = None
|
||||
if strictness_level and hasattr(TestSeverity, strictness_level):
|
||||
self.strictness_level = TestSeverity[strictness_level]
|
||||
logging.info(f"strictness_level: {self.strictness_level}")
|
||||
elif strictness_level:
|
||||
logging.warning(f"提供了无效的严格等级 '{strictness_level}'。将使用默认行为。有效值: {', '.join([e.name for e in TestSeverity])}")
|
||||
|
||||
# 将这些属性的初始化移到此处,并设为None,避免在_execute_tests_from_parsed_spec之前被错误使用
|
||||
self.json_schema_validator: Optional[JSONSchemaValidator] = None
|
||||
self.schema_provider: Optional[SchemaProvider] = None
|
||||
|
||||
def initialize_well_data(self) -> bool:
|
||||
"""
|
||||
初始化井数据,在测试开始前获取真实的井和井筒数据
|
||||
@@ -555,37 +582,6 @@ class APITestOrchestrator:
|
||||
self.logger.error(f"井数据初始化失败: {e}")
|
||||
return False
|
||||
|
||||
def _complete_initialization(self, output_dir: Optional[str], strictness_level: Optional[str]):
|
||||
"""完成初始化过程"""
|
||||
self.output_dir_path = Path(output_dir) if output_dir else Path("./test_reports_orchestrator")
|
||||
try:
|
||||
self.output_dir_path.mkdir(parents=True, exist_ok=True)
|
||||
self.logger.info(f"Orchestrator output directory set to: {self.output_dir_path.resolve()}")
|
||||
except OSError as e:
|
||||
self.logger.warning(f"Could not create orchestrator output directory {self.output_dir_path}: {e}. Falling back to current directory.")
|
||||
self.output_dir_path = Path(".")
|
||||
|
||||
self.schema_cache: Dict[str, Type[BaseModel]] = {}
|
||||
self.model_name_counts: Dict[str, int] = defaultdict(int)
|
||||
self.parser = InputParser()
|
||||
self.json_resolver_cache: Dict[str, Any] = {}
|
||||
self.json_validator = JSONSchemaValidator()
|
||||
|
||||
# 将字符串类型的 strictness_level 转换为 TestSeverity 枚举成员
|
||||
self.strictness_level: Optional[TestSeverity] = None
|
||||
if strictness_level and hasattr(TestSeverity, strictness_level):
|
||||
self.strictness_level = TestSeverity[strictness_level]
|
||||
logging.info(f"strictness_level: {self.strictness_level}")
|
||||
elif strictness_level:
|
||||
logging.warning(f"提供了无效的严格等级 '{strictness_level}'。将使用默认行为。有效值: {', '.join([e.name for e in TestSeverity])}")
|
||||
|
||||
# 将这些属性的初始化移到此处,并设为None,避免在_execute_tests_from_parsed_spec之前被错误使用
|
||||
self.json_schema_validator: Optional[JSONSchemaValidator] = None
|
||||
self.schema_provider: Optional[SchemaProvider] = None
|
||||
|
||||
# 完成初始化
|
||||
self._complete_initialization(output_dir, strictness_level)
|
||||
|
||||
def get_api_call_details(self) -> List[APICallDetail]:
|
||||
"""Returns the collected list of API call details."""
|
||||
return self.global_api_call_details
|
||||
|
||||
Reference in New Issue
Block a user