feat: config-driven multi-scenario + gcda accumulation fix + gcov merge fix
Config-driven architecture: - coverage_dates: YAML-driven date replacement for LEAVE_RECORDS - row_overrides: per-scenario field overrides (e.g. STATUS='9') - delete_all_rows: per-scenario table emptying for empty-cursor tests gcda accumulation fix (V3 bug #7): - Delete .gcda before each scenario run to prevent GnuCOBOL accumulation - Force-copy scenario gcda (skip mtime check) - Copy scenario DB to CWD data/kin.db for CONNECT TO path resolution Multi-run gcov merge fix: - Always merge multi-run gcov data regardless of generate_coverage flag - Fix v3_root UnboundLocalError in cleanup path Other fixes: - _make_key_unique: skip WHERE-constrained columns to avoid PK conflict - incremental_supplement: support fields_dict for base record generation - check_coverage: use structure coverage data if available - orchestrator.py: filter _-prefixed fields in TestCase; merge Agent2Data cases
This commit is contained in:
+13
-4
@@ -49,7 +49,8 @@ def run_pipeline(cfg: Config, cpath: str, cbl: str, java: str, map_path: str) ->
|
||||
# 转换为 TestCase 列表(增强管线的基础数据集)
|
||||
complete_tests = []
|
||||
for i, rec in enumerate(base_records):
|
||||
complete_tests.append(TestCase(id=f"CTG-{i+1:04d}", fields=dict(rec)))
|
||||
fields = {k: v for k, v in rec.items() if not k.startswith('_')}
|
||||
complete_tests.append(TestCase(id=f"CTG-{i+1:04d}", fields=fields))
|
||||
|
||||
# HINA 完整类型判定管道(Keyword / 规则引擎 / LLM 辅助三路径)
|
||||
classification: dict = {}
|
||||
@@ -84,13 +85,15 @@ def run_pipeline(cfg: Config, cpath: str, cbl: str, java: str, map_path: str) ->
|
||||
break
|
||||
gaps = gate_result.get("issues", {}).get("decision_gaps", [])
|
||||
if gaps and structure.get("branch_tree_obj"):
|
||||
delta = incremental_supplement(structure["branch_tree_obj"], gaps)
|
||||
data_fields = structure.get("data_fields", [])
|
||||
delta = incremental_supplement(structure["branch_tree_obj"], gaps, data_fields)
|
||||
base_records.extend(delta)
|
||||
# 同步更新 complete_tests
|
||||
for i, d in enumerate(delta):
|
||||
d_fields = {k: v for k, v in d.items() if not k.startswith('_')}
|
||||
complete_tests.append(TestCase(
|
||||
id=f"CTG-S{attempt+1}-{i+1:04d}",
|
||||
fields=dict(d),
|
||||
fields=d_fields,
|
||||
))
|
||||
cov = check_coverage(structure, base_records)
|
||||
else:
|
||||
@@ -109,7 +112,13 @@ def run_pipeline(cfg: Config, cpath: str, cbl: str, java: str, map_path: str) ->
|
||||
|
||||
suite = Agent2Data(llm).design(tree, cfg.coverage_default, cfg.runner_mode == "spark")
|
||||
vr.llm_cost += 0.002
|
||||
suite.test_cases = complete_tests # 替换为增强管线数据(P1/P2 修复)
|
||||
# 合并: cobol_testgen 基线 + 策略标记 + Agent2Data LLM 场景数据
|
||||
merged = list(complete_tests)
|
||||
existing_ids = {tc.id for tc in merged}
|
||||
for tc in suite.test_cases:
|
||||
if tc.id not in existing_ids:
|
||||
merged.append(tc)
|
||||
suite.test_cases = merged
|
||||
vr.debug["test_cases"] = [{"id":tc.id,"fields":tc.fields,"targets":tc.coverage_targets} for tc in suite.test_cases]
|
||||
vr.debug["spark_config"] = {"records":suite.spark_config.num_records} if suite.has_spark else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user