OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[GHA][Coverage] Expand coverage workflow test set (#34202)
Marcin Kruszynski1148033d69a6
diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tagindex dfc05cc5bc7..7db0cfe5e9c 100644--- a/.github/dockerfiles/docker_tag+++ b/.github/dockerfiles/docker_tag@@ -1 +1 @@-pr-35047+pr-34202diff --git a/.github/dockerfiles/ov_test/ubuntu_22_04_x64/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_22_04_x64/Dockerfileindex dcf09c8928a..9ea31664c58 100644--- a/.github/dockerfiles/ov_test/ubuntu_22_04_x64/Dockerfile+++ b/.github/dockerfiles/ov_test/ubuntu_22_04_x64/Dockerfile@@ -23,6 +23,8 @@ RUN apt-get update && \ca-certificates \gpg-agent \tzdata \+ # coverage+ lcov \# parallel gzippigz \# Samplesdiff --git a/.github/scripts/coverage/ci_reports.py b/.github/scripts/coverage/ci_reports.pynew file mode 100644index 00000000000..06f3e6e789c--- /dev/null+++ b/.github/scripts/coverage/ci_reports.py@@ -0,0 +1,365 @@+# Copyright (C) 2018-2026 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from __future__ import annotations++import argparse+import csv+import json+from pathlib import Path+import shutil+import sys+++SCRIPT_DIR = Path(__file__).resolve().parent+CONFIG_DIR = SCRIPT_DIR / "config"+if str(SCRIPT_DIR) not in sys.path:+ sys.path.insert(0, str(SCRIPT_DIR))++from coverage import load_cpp_tests, load_js_tests, load_python_tests+++METADATA_FILE = "coverage-artifact-metadata.json"+++SUITE_DEFS = {+ "cpp": {+ "label": "C++",+ "artifacts_dir": "cpp",+ "stats_file": "cpp-coverage-stats.env",+ "duration_file": "cpp-test-durations.csv",+ "coverage_file": "coverage.info",+ "total_key": "CXX_TESTS_TOTAL",+ "executed_key": "CXX_TESTS_EXECUTED",+ "passed_key": "CXX_TESTS_PASSED",+ "failed_key": "CXX_TESTS_FAILED",+ "skipped_key": "CXX_TESTS_SKIPPED",+ "not_run_key": "CXX_TESTS_NOT_RUN",+ },+ "python": {+ "label": "Python",+ "artifacts_dir": "python",+ "stats_file": "python-coverage-stats.env",+ "duration_file": "python-test-durations.csv",+ "coverage_file": "python-coverage.xml",+ "extra_files": ["coverage.info"],+ "total_key": "PY_TESTS_TOTAL",+ "executed_key": None,+ "passed_key": "PY_TESTS_PASSED",+ "failed_key": "PY_TESTS_FAILED",+ "skipped_key": "PY_TESTS_SKIPPED",+ "not_run_key": "PY_TESTS_NOT_RUN",+ },+ "js": {+ "label": "JS",+ "artifacts_dir": "js",+ "stats_file": "js-coverage-stats.env",+ "duration_file": "js-test-durations.csv",+ "coverage_file": "js-lcov.info",+ "extra_files": ["coverage.info"],+ "total_key": "JS_TESTS_TOTAL",+ "executed_key": None,+ "passed_key": "JS_TESTS_PASSED",+ "failed_key": "JS_TESTS_FAILED",+ "skipped_key": "JS_TESTS_SKIPPED",+ "not_run_key": "JS_TESTS_NOT_RUN",+ },+}+def _read_json_file(path: Path) -> dict[str, object]:+ if not path.is_file():+ return {}+ return json.loads(path.read_text(encoding="utf-8"))+++def _read_env_file(path: Path) -> dict[str, str]:+ values: dict[str, str] = {}+ if not path.is_file():+ return values+ for raw_line in path.read_text(encoding="utf-8").splitlines():+ if "=" not in raw_line:+ continue+ key, value = raw_line.split("=", 1)+ values[key.strip()] = value.strip()+ return values+++def _to_int(values: dict[str, str], key: str | None) -> int:+ if not key:+ return 0+ try:+ return int(values.get(key, "0").strip())+ except ValueError:+ return 0+++def _load_test_names(*, workspace: Path, suite: str, profile: str) -> list[str]:+ if suite == "cpp":+ return [test.name for test in load_cpp_tests(CONFIG_DIR / "tests_cpp.yml", profile)]+ if suite == "python":+ return [test.name for test in load_python_tests(CONFIG_DIR / "tests_python.yml", profile)]+ if suite == "js":+ return [test.name for test in load_js_tests(CONFIG_DIR / "tests_js.yml", profile)]+ raise ValueError(f"Unsupported suite: {suite}")+++def collect_suite_results(+ *,+ workspace: Path,+ suite: str,+ profile: str,+ lane: str,+ artifact_name: str,+ artifact_dir: Path,+) -> None:+ suite_def = SUITE_DEFS[suite]+ artifact_dir.mkdir(parents=True, exist_ok=True)++ tests = _load_test_names(workspace=workspace, suite=suite, profile=profile)+ total = len(tests)++ metadata = {"suite": suite, "lane": lane, "artifact_name": artifact_name}+ (artifact_dir / METADATA_FILE).write_text(json.dumps(metadata, separators=(",", ":")) + "\n", encoding="utf-8")++ duration_path = artifact_dir / str(suite_def["duration_file"])+ with duration_path.open("w", encoding="utf-8", newline="") as handle:+ writer = csv.writer(handle)+ writer.writerow(["test_name", "status", "duration_seconds", "duration_minutes"])+ for test_name in tests:+ writer.writerow([test_name, "not_run", "0.000", "0.000"])++ stats_lines = [f"{suite_def['total_key']}={total}"]+ if suite_def["executed_key"]:+ stats_lines.append(f"{suite_def['executed_key']}=0")+ stats_lines.extend(+ [+ f"{suite_def['passed_key']}=0",+ f"{suite_def['failed_key']}=0",+ f"{suite_def['skipped_key']}=0",+ f"{suite_def['not_run_key']}={total}",+ ]+ )+ (artifact_dir / str(suite_def["stats_file"])).write_text("\n".join(stats_lines) + "\n", encoding="utf-8")++ files_to_copy = [+ str(suite_def["duration_file"]),+ str(suite_def["stats_file"]),+ str(suite_def["coverage_file"]),+ *[str(name) for name in suite_def.get("extra_files", [])],+ ]+ for filename in files_to_copy:+ source = workspace / filename+ if source.is_file():+ shutil.copy2(source, artifact_dir / filename)++ debug_dir = workspace / ".tmp" / "cpp-coverage-parts"+ if debug_dir.is_dir():+ destination = artifact_dir / "native-cpp-debug"+ shutil.rmtree(destination, ignore_errors=True)+ shutil.copytree(debug_dir, destination)++ python_debug_dir = workspace / ".tmp" / "python-coverage"+ if suite == "python" and python_debug_dir.is_dir():+ destination = artifact_dir / "python-coverage-debug"+ shutil.rmtree(destination, ignore_errors=True)+ shutil.copytree(python_debug_dir, destination)+++def _collect_artifacts(*, workspace: Path, suite_key: str) -> list[dict[str, object]]:+ suite_def = SUITE_DEFS[suite_key]+ root = workspace / "artifacts" / suite_def["artifacts_dir"]+ if not root.exists():+ return []++ artifacts: list[dict[str, object]] = []+ for metadata_path in sorted(root.rglob(METADATA_FILE)):+ metadata = _read_json_file(metadata_path)+ if not metadata or str(metadata.get("suite", "")).strip() != suite_key:+ continue+ artifacts.append(+ {+ "artifact_dir": metadata_path.parent,+ "artifact_name": str(metadata.get("artifact_name", metadata_path.parent.name)).strip(),+ "lane": str(metadata.get("lane", "")).strip() or "-",+ }+ )+ return artifacts+++def _flag_patterns(suite: str, lane: str) -> str:+ if suite == "cpp":+ return f"`cpp-runtime-cpp-{lane}`"+ if suite == "python":+ return f"`python-api-frontend-layer-ovc-{lane}`, `cpp-runtime-python-{lane}`"+ if suite == "js":+ return f"`nodejs-bindings-unit-e2e-{lane}`, `cpp-runtime-js-{lane}`"+ raise ValueError(f"Unsupported suite: {suite}")+++def render_summary(*, workspace: Path, summary_file: Path, selection: str, selected_lanes: str) -> None:+ rows: list[dict[str, object]] = []+ overall = {"total": 0, "executed": 0, "passed": 0, "failed": 0, "skipped": 0, "not_run": 0}++ for suite_key, suite_def in SUITE_DEFS.items():+ for artifact in _collect_artifacts(workspace=workspace, suite_key=suite_key):+ artifact_dir = Path(artifact["artifact_dir"])+ lane = str(artifact["lane"])+ stats = _read_env_file(artifact_dir / str(suite_def["stats_file"]))+ total = _to_int(stats, str(suite_def["total_key"]))+ passed = _to_int(stats, str(suite_def["passed_key"]))+ failed = _to_int(stats, str(suite_def["failed_key"]))+ skipped = _to_int(stats, str(suite_def["skipped_key"]))+ not_run = _to_int(stats, str(suite_def["not_run_key"]))+ executed = _to_int(stats, suite_def["executed_key"]) if suite_def["executed_key"] else max(0, total - skipped - not_run)+ coverage_file = artifact_dir / str(suite_def["coverage_file"])+ report_size = coverage_file.stat().st_size if coverage_file.is_file() else 0++ rows.append(+ {+ "lane": lane,+ "suite": suite_def["label"],+ "total": total,+ "executed": executed,+ "passed": passed,+ "failed": failed,+ "skipped": skipped,+ "not_run": not_run,+ "report_size": report_size,+ "flags": _flag_patterns(suite_key, lane),+ }+ )+ overall["total"] += total+ overall["executed"] += executed+ overall["passed"] += passed+ overall["failed"] += failed+ overall["skipped"] += skipped+ overall["not_run"] += not_run++ pass_rate = (overall["passed"] * 100.0) / overall["executed"] if overall["executed"] else 0.0++ lines = [+ "## Coverage Summary",+ "",+ f"**Selection:** `{selection}`",+ "",+ f"**Active lanes:** `{selected_lanes}`",+ "",+ f"**Executed pass rate:** `{pass_rate:.1f}%`",+ "",+ "### Overall",+ "| Metric | Value |",+ "| --- | ---: |",+ f"| Total test units | {overall['total']} |",+ f"| Executed | {overall['executed']} |",+ f"| Passed | {overall['passed']} |",+ f"| Failed | {overall['failed']} |",+ f"| Skipped | {overall['skipped']} |",+ f"| Not run | {overall['not_run']} |",+ "",+ "### By Lane And Suite",+ "| Lane | Suite | Total | Executed | Passed | Failed | Skipped | Not run | Report Size (bytes) | Codecov Flags |",+ "| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |",+ ]++ if rows:+ for row in sorted(rows, key=lambda item: (str(item["lane"]), str(item["suite"]))):+ lines.append(+ f"| {row['lane']} | {row['suite']} | {row['total']} | {row['executed']} | "+ f"{row['passed']} | {row['failed']} | {row['skipped']} | {row['not_run']} | {row['report_size']} | {row['flags']} |"+ )+ else:+ lines.append("| - | - | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - |")++ lines.extend(["", "Merged duration artifact: `coverage-test-durations` (`coverage-test-durations-all.csv`)", ""])+ summary_file.write_text("\n".join(lines), encoding="utf-8")+++def merge_durations(*, workspace: Path, output: Path) -> None:+ rows: list[dict[str, str]] = []+ for suite_key, suite_def in SUITE_DEFS.items():+ for artifact in _collect_artifacts(workspace=workspace, suite_key=suite_key):+ artifact_dir = Path(artifact["artifact_dir"])+ report = artifact_dir / str(suite_def["duration_file"])+ if not report.is_file():+ continue+ artifact_name = str(artifact["artifact_name"])+ lane = str(artifact["lane"])+ with report.open(encoding="utf-8", newline="") as handle:+ reader = csv.DictReader(handle)+ for row in reader:+ rows.append(+ {+ "suite": suite_key,+ "lane": lane,+ "artifact": artifact_name,+ "test_name": row.get("test_name", ""),+ "status": row.get("status", ""),+ "duration_seconds": row.get("duration_seconds", "0"),+ "duration_minutes": row.get("duration_minutes", "0"),+ }+ )++ rows.sort(key=lambda row: (-float(row["duration_seconds"] or 0), row["suite"], row["lane"], row["test_name"]))+ with output.open("w", encoding="utf-8", newline="") as handle:+ writer = csv.DictWriter(+ handle,+ fieldnames=["suite", "lane", "artifact", "test_name", "status", "duration_seconds", "duration_minutes"],+ )+ writer.writeheader()+ writer.writerows(rows)++ print(f"Wrote {len(rows)} duration row(s) to {output}")+++def _parse_args() -> argparse.Namespace:+ parser = argparse.ArgumentParser(description="Coverage CI report helpers")+ subparsers = parser.add_subparsers(dest="command", required=True)++ collect = subparsers.add_parser("collect-suite-results", help="Prepare one suite artifact with fallback files and real outputs")+ collect.add_argument("--workspace", type=Path, required=True)+ collect.add_argument("--suite", choices=sorted(SUITE_DEFS), required=True)+ collect.add_argument("--profile", required=True)+ collect.add_argument("--lane", required=True)+ collect.add_argument("--artifact-name", required=True)+ collect.add_argument("--artifact-dir", type=Path, required=True)++ render = subparsers.add_parser("render-summary", help="Render the aggregated GitHub summary from downloaded artifacts")+ render.add_argument("--workspace", type=Path, required=True)+ render.add_argument("--summary-file", type=Path, required=True)+ render.add_argument("--selection", required=True)+ render.add_argument("--selected-lanes", required=True)++ merge = subparsers.add_parser("merge-durations", help="Merge suite duration CSV files from downloaded artifacts")+ merge.add_argument("--workspace", type=Path, required=True)+ merge.add_argument("--output", type=Path, required=True)++ return parser.parse_args()+++def main() -> int:+ args = _parse_args()+ if args.command == "collect-suite-results":+ collect_suite_results(+ workspace=args.workspace.resolve(),+ suite=args.suite,+ profile=args.profile,+ lane=args.lane,+ artifact_name=args.artifact_name,+ artifact_dir=args.artifact_dir.resolve(),+ )+ return 0+ if args.command == "render-summary":+ render_summary(+ workspace=args.workspace.resolve(),+ summary_file=args.summary_file.resolve(),+ selection=args.selection,+ selected_lanes=args.selected_lanes,+ )+ return 0+ if args.command == "merge-durations":+ merge_durations(workspace=args.workspace.resolve(), output=args.output.resolve())+ return 0+ raise ValueError(f"Unsupported command: {args.command}")+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/.github/scripts/coverage/collect_cpp_coverage.py b/.github/scripts/coverage/collect_cpp_coverage.pynew file mode 100644index 00000000000..678b39ffb12--- /dev/null+++ b/.github/scripts/coverage/collect_cpp_coverage.py@@ -0,0 +1,791 @@+# Copyright (C) 2018-2026 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from __future__ import annotations++import os+import re+import shlex+import shutil+import subprocess+from pathlib import Path++from coverage_workflow import CoverageContext, LOGGER, run_cmd+++def _slugify(value: str) -> str:+ """Convert a label into a filesystem-friendly fragment."""+ return re.sub(r"[^A-Za-z0-9._-]+", "-", value).strip("-") or "capture"+++def _as_text(value: str | bytes | None) -> str:+ """Normalize subprocess output to text."""+ if value is None:+ return ""+ if isinstance(value, bytes):+ return value.decode("utf-8", errors="replace")+ return value+++def _has_gcda(root: Path) -> bool:+ """Return whether a directory tree contains any gcda files."""+ if not root.exists():+ return False+ return any(root.rglob("*.gcda"))+++def _read_header(path: Path) -> bytes | None:+ """Read the 12-byte gcov header used for compatibility checks.++ Example layout: ``<4-byte magic><4-byte version><4-byte stamp/checksum>``.+ This helper only returns the raw 12 bytes so callers can compare fields such+ as ``header[4:12]`` between matching ``.gcda`` and ``.gcno`` files. This is+ needed because stale runtime data from an older build can make ``lcov`` fail+ with mismatch errors even when the current build is otherwise valid.+ """+ try:+ with path.open("rb") as f:+ header = f.read(12)+ if len(header) < 12:+ return None+ return header+ except OSError:+ return None+++def _prefilter_incompatible_gcda(root: Path, *, label: str, gcno_root: Path | None = None) -> None:+ """Remove gcda files that cannot be matched to compatible gcno files.++ This is a proactive cleanup step before running ``lcov``. It filters out+ stale, unreadable, or mismatched coverage data so one bad ``.gcda`` file+ does not break capture for the whole run.+ """+ if not root.exists():+ return++ removed_missing_gcno = 0+ removed_header_mismatch = 0+ removed_unreadable = 0+ scanned = 0++ for gcda in root.rglob("*.gcda"):+ scanned += 1+ if gcno_root is None:+ gcno = gcda.with_suffix(".gcno")+ else:+ gcno = gcno_root / gcda.relative_to(root).with_suffix(".gcno")+ if not gcno.exists():+ try:+ gcda.unlink()+ removed_missing_gcno += 1+ except OSError:+ pass+ continue++ gcda_header = _read_header(gcda)+ gcno_header = _read_header(gcno)+ if gcda_header is None or gcno_header is None:+ try:+ gcda.unlink()+ removed_unreadable += 1+ except OSError:+ pass+ continue++ # bytes[4:12] are version+stamp/checksum fields that must match between gcda/gcno.+ if gcda_header[4:12] != gcno_header[4:12]:+ try:+ gcda.unlink()+ removed_header_mismatch += 1+ except OSError:+ pass++ if removed_missing_gcno or removed_header_mismatch or removed_unreadable:+ LOGGER.warning(+ f"{label}: pre-filtered incompatible gcda files "+ f"(scanned={scanned}, missing_gcno={removed_missing_gcno}, "+ f"header_mismatch={removed_header_mismatch}, unreadable={removed_unreadable})"+ )+++def _extract_problematic_gcda(log_text: str) -> list[Path]:+ """Extract gcda paths mentioned in lcov/gcov error output.++ This is used after a failed ``lcov`` attempt to identify the specific+ runtime coverage files that triggered mismatch or missing-notes errors, so+ they can be removed and capture can be retried.+ """+ patterns = (+ r"(?m)^([^\n]+\.gcda):stamp mismatch with notes file$",+ r"GCOV failed for ([^\s!]+\.gcda)!",+ r"skipping \.gcda file ([^\s]+\.gcda) because corresponding \.gcno file",+ )++ found: set[Path] = set()+ for pattern in patterns:+ for raw in re.findall(pattern, log_text):+ path = Path(raw.strip())+ if path.exists():+ found.add(path)+ return sorted(found)+++def _remove_gcda_files(paths: list[Path]) -> int:+ """Delete problematic gcda files and return how many were removed.++ Removing only the known-bad files lets coverage collection continue with the+ remaining valid data instead of failing the entire report.+ """+ removed = 0+ for path in paths:+ try:+ path.unlink()+ removed += 1+ except OSError:+ continue+ return removed+++def _is_relative_to(path: Path, root: Path) -> bool:+ """Return whether ``path`` is located under ``root``."""+ try:+ path.relative_to(root)+ return True+ except ValueError:+ return False+++def _classify_unwanted_gcda(rel_path: Path) -> str | None:+ """Return the exclusion reason for a gcda file we never want to capture."""+ rel = rel_path.as_posix()+ padded = f"/{rel}/"++ if rel.endswith(".pb.cc.gcda") or rel.endswith(".pb.h.gcda"):+ return "generated-protobuf"+ if rel.startswith("thirdparty/") or "/thirdparty/" in padded:+ return "thirdparty"+ if "/tests/" in padded or rel.startswith("tests/"):+ return "tests"+ if rel.startswith("docs/") or "/docs/" in padded:+ return "docs"+ if rel.startswith("samples/") or "/samples/" in padded:+ return "samples"+ if rel.startswith("tools/") or "/tools/" in padded:+ return "tools"+ return None+++def _classify_unwanted_source(rel_path: Path) -> str | None:+ """Return the exclusion reason for a source file path in a tracefile."""+ rel = rel_path.as_posix()+ padded = f"/{rel}/"++ if rel.endswith(".pb.cc") or rel.endswith(".pb.h"):+ return "generated-protobuf"+ if rel.startswith("openvino_build/") or rel.startswith("openvino_build_js/"):+ return "build-tree"+ if rel.startswith("build/") or rel.startswith("build_js/"):+ return "build-tree"+ if rel.startswith("thirdparty/") or "/thirdparty/" in padded:+ return "thirdparty"+ if rel.startswith("tests/") or "/tests/" in padded:+ return "tests"+ if rel.startswith("docs/") or "/docs/" in padded:+ return "docs"+ if rel.startswith("samples/") or "/samples/" in padded:+ return "samples"+ if rel.startswith("tools/") or "/tools/" in padded:+ return "tools"+ return None+++def _classify_profile_unwanted_source(rel_path: Path, *, run_gpu_tests: bool, run_npu_tests: bool) -> str | None:+ """Return profile-specific exclusion reasons for source paths."""+ rel = rel_path.as_posix()+ if not run_gpu_tests and rel.startswith("src/plugins/intel_gpu/"):+ return "gpu-plugin-disabled"+ if not run_npu_tests and rel.startswith("src/plugins/intel_npu/"):+ return "npu-plugin-disabled"+ return None+++def _prune_unwanted_gcda(root: Path, *, label: str, run_gpu_tests: bool, run_npu_tests: bool) -> None:+ """Delete gcda files that are known to be excluded from the final report.++ This reduces lcov capture time by removing whole classes of files that we+ already strip later via ``lcov --remove`` and never want to upload.+ """+ if not root.exists():+ return++ removed = 0+ reasons: dict[str, int] = {}+ for gcda in root.rglob("*.gcda"):+ rel = gcda.relative_to(root)+ reason = _classify_unwanted_gcda(rel)+ if reason is None:+ reason = _classify_profile_unwanted_source(rel, run_gpu_tests=run_gpu_tests, run_npu_tests=run_npu_tests)+ if reason is None:+ continue+ try:+ gcda.unlink()+ removed += 1+ reasons[reason] = reasons.get(reason, 0) + 1+ except OSError:+ continue++ if removed:+ details = ", ".join(f"{name}={count}" for name, count in sorted(reasons.items()))+ LOGGER.warning("%s: pre-pruned %s unwanted gcda files before lcov capture (%s)", label, removed, details)+++def _resolve_trace_source_path(raw_path: str, *, workspace: Path) -> Path | None:+ """Resolve an ``SF:`` path from lcov into an existing file under the repo."""+ raw = raw_path.strip()+ if not raw:+ return None++ candidates: list[Path] = []+ path = Path(raw)+ if path.is_absolute():+ candidates.append(path)+ parts = path.parts[1:] if path.parts and path.parts[0] == path.anchor else path.parts+ for start in range(len(parts)):+ suffix = parts[start:]+ if not suffix:+ continue+ candidates.append(workspace.joinpath(*suffix))+ else:+ stripped = raw.removeprefix("./")+ if stripped:+ candidates.append(workspace / stripped)+ candidates.append(workspace.parent / stripped)+ repo_prefix = f"{workspace.name}/"+ if stripped.startswith(repo_prefix):+ candidates.append(workspace / stripped[len(repo_prefix) :])+ rel_parts = Path(stripped).parts+ for start in range(len(rel_parts)):+ suffix = rel_parts[start:]+ if not suffix:+ continue+ candidates.append(workspace.joinpath(*suffix))++ seen: set[str] = set()+ for candidate in candidates:+ try:+ resolved = candidate.resolve(strict=False)+ except OSError:+ resolved = candidate+ key = str(resolved)+ if key in seen:+ continue+ seen.add(key)+ if resolved.exists() and resolved.is_file() and _is_relative_to(resolved, workspace):+ return resolved++ return None+++def _normalize_and_filter_tracefile(+ *,+ tracefile: Path,+ workspace: Path,+ debug_dir: Path,+ run_gpu_tests: bool,+ run_npu_tests: bool,+) -> dict[str, int]:+ """Normalize ``SF:`` paths and drop records that should not be uploaded."""+ stats: dict[str, int] = {+ "total_records": 0,+ "kept_records": 0,+ "dropped_missing_sf": 0,+ "dropped_unresolved": 0,+ "dropped_outside_workspace": 0,+ "dropped_excluded": 0,+ "rewritten_paths": 0,+ }+ excluded_reasons: dict[str, int] = {}+ unresolved_samples: list[str] = []++ if not tracefile.is_file():+ return stats++ input_lines = tracefile.read_text(encoding="utf-8", errors="replace").splitlines()+ output_lines: list[str] = []+ record: list[str] = []++ def flush_record(lines: list[str]) -> None:+ if not lines:+ return+ stats["total_records"] += 1++ sf_index = next((idx for idx, line in enumerate(lines) if line.startswith("SF:")), None)+ if sf_index is None:+ stats["dropped_missing_sf"] += 1+ return++ raw_source = lines[sf_index][3:]+ resolved = _resolve_trace_source_path(raw_source, workspace=workspace)+ if resolved is None:+ stats["dropped_unresolved"] += 1+ if len(unresolved_samples) < 20:+ unresolved_samples.append(raw_source)+ return++ if not _is_relative_to(resolved, workspace):+ stats["dropped_outside_workspace"] += 1+ return++ rel_source = resolved.relative_to(workspace)+ exclude_reason = _classify_unwanted_source(rel_source)+ if exclude_reason is None:+ exclude_reason = _classify_profile_unwanted_source(+ rel_source,+ run_gpu_tests=run_gpu_tests,+ run_npu_tests=run_npu_tests,+ )+ if exclude_reason is not None:+ stats["dropped_excluded"] += 1+ excluded_reasons[exclude_reason] = excluded_reasons.get(exclude_reason, 0) + 1+ return++ normalized_source = rel_source.as_posix()+ if normalized_source != raw_source:+ lines[sf_index] = f"SF:{normalized_source}"+ stats["rewritten_paths"] += 1++ output_lines.extend(lines)+ stats["kept_records"] += 1++ for line in input_lines:+ record.append(line)+ if line == "end_of_record":+ flush_record(record)+ record = []+ flush_record(record)++ tracefile.write_text(("\n".join(output_lines) + "\n") if output_lines else "", encoding="utf-8")++ summary_lines = [+ f"tracefile={tracefile}",+ f"workspace={workspace}",+ f"total_records={stats['total_records']}",+ f"kept_records={stats['kept_records']}",+ f"dropped_missing_sf={stats['dropped_missing_sf']}",+ f"dropped_unresolved={stats['dropped_unresolved']}",+ f"dropped_outside_workspace={stats['dropped_outside_workspace']}",+ f"dropped_excluded={stats['dropped_excluded']}",+ f"rewritten_paths={stats['rewritten_paths']}",+ ]+ if excluded_reasons:+ summary_lines.append("excluded_reasons=" + ", ".join(f"{name}={count}" for name, count in sorted(excluded_reasons.items())))+ if unresolved_samples:+ summary_lines.append("unresolved_samples:")+ summary_lines.extend(f" {sample}" for sample in unresolved_samples)++ summary_path = debug_dir / f"{tracefile.stem}.normalized-summary.txt"+ summary_path.write_text("\n".join(summary_lines) + "\n", encoding="utf-8")+ LOGGER.info("===== %s =====\n%s", summary_path.name, "\n".join(summary_lines[:20]))+ return stats+++def _tool_version_report() -> str:+ """Capture native coverage tool versions for debugging."""+ commands = (+ ("gcc", ["gcc", "--version"]),+ ("g++", ["g++", "--version"]),+ ("gcov", ["gcov", "--version"]),+ ("lcov", ["lcov", "--version"]),+ ("genhtml", ["genhtml", "--version"]),+ )++ lines: list[str] = []+ for name, cmd in commands:+ resolved = shutil.which(name)+ lines.append(f"## {name}")+ lines.append(f"path: {resolved or 'not found'}")+ if resolved is None:+ lines.append("")+ continue+ completed = subprocess.run(cmd, text=True, capture_output=True)+ lines.append(f"exit_code: {completed.returncode}")+ output = (completed.stdout or completed.stderr or "").strip()+ if output:+ lines.extend(output.splitlines()[:3])+ lines.append("")++ return "\n".join(lines).rstrip() + "\n"+++def _tree_inventory_report(+ *,+ root: Path,+ label: str,+ gcno_root: Path,+ alt_gcno_root: Path | None = None,+ limit: int = 20,+) -> str:+ """Summarize gcda/gcno layout and sample expected note matches."""+ lines = [f"# {label}", f"root={root}", f"gcno_root={gcno_root}"]+ if alt_gcno_root is not None:+ lines.append(f"alt_gcno_root={alt_gcno_root}")++ if not root.exists():+ lines.append("exists=false")+ return "\n".join(lines) + "\n"++ local_gcno_files = sorted(root.rglob("*.gcno"))+ gcda_files = sorted(root.rglob("*.gcda"))+ lines.extend(+ [+ "exists=true",+ f"gcno_count={len(local_gcno_files)}",+ f"gcda_count={len(gcda_files)}",+ ]+ )++ if gcda_files:+ local_matches = 0+ alt_matches = 0+ missing_matches = 0+ lines.append("sample_gcda_to_gcno:")+ for gcda in gcda_files:+ rel = gcda.relative_to(root)+ local_gcno = gcno_root / rel.with_suffix(".gcno")+ alt_gcno = alt_gcno_root / rel.with_suffix(".gcno") if alt_gcno_root is not None else None+ local_exists = local_gcno.exists()+ alt_exists = alt_gcno.exists() if alt_gcno is not None else False+ if local_exists:+ local_matches += 1+ elif alt_exists:+ alt_matches += 1+ else:+ missing_matches += 1++ lines.extend(+ [+ f"matching_gcno_in_primary_root={local_matches}",+ f"matching_gcno_only_in_alt_root={alt_matches}",+ f"matching_gcno_missing_in_both={missing_matches}",+ ]+ )++ for gcda in gcda_files[:limit]:+ rel = gcda.relative_to(root)+ local_gcno = gcno_root / rel.with_suffix(".gcno")+ alt_gcno = alt_gcno_root / rel.with_suffix(".gcno") if alt_gcno_root is not None else None+ lines.append(+ " "+ + f"gcda={gcda} | primary_gcno_exists={local_gcno.exists()} | primary_gcno={local_gcno}"+ + (f" | alt_gcno_exists={alt_gcno.exists()} | alt_gcno={alt_gcno}" if alt_gcno is not None else "")+ )++ if local_gcno_files:+ lines.append("sample_gcno:")+ lines.extend(f" {path}" for path in local_gcno_files[:limit])++ return "\n".join(lines) + "\n"+++def _run_lcov_capture(+ *,+ directory: Path,+ base_directory: Path,+ output_file: Path,+ label: str,+ debug_dir: Path,+ branch_coverage: bool,+) -> None:+ """Capture one lcov tracefile, retrying after gcda cleanup when needed.++ ``lcov`` can fail on mismatched or corrupted ``.gcda`` inputs. This helper+ wraps capture with targeted cleanup and retry logic so transient artifact or+ stale-file issues do not abort native coverage generation unnecessarily.+ """+ cmd = [+ "lcov",+ "--capture",+ "--directory",+ str(directory),+ "--base-directory",+ str(base_directory),+ "--output-file",+ str(output_file),+ "--rc",+ "geninfo_unexecuted_blocks=1",+ "--ignore-errors",+ "gcov,source,graph",+ "--compat",+ "split_crc=auto",+ ]+ if branch_coverage:+ cmd.extend(["--rc", "lcov_branch_coverage=1"])++ timeout_seconds = int(os.environ.get("LCOV_CAPTURE_TIMEOUT_SECONDS", "3600"))+ max_attempts = 32+ for attempt in range(1, max_attempts + 1):+ display = " ".join(shlex.quote(part) for part in cmd)+ log_file = debug_dir / f"{_slugify(label)}.attempt{attempt}.log"+ LOGGER.info(+ "$ %s # %s (attempt %s/%s, timeout=%ss)",+ display,+ label,+ attempt,+ max_attempts,+ timeout_seconds,+ )+ try:+ completed = subprocess.run(cmd, text=True, capture_output=True, timeout=timeout_seconds)+ except subprocess.TimeoutExpired as exc:+ stdout_text = _as_text(exc.stdout)+ stderr_text = _as_text(exc.stderr)+ log_file.write_text(+ f"$ {display}\nexit_code=timeout\n\n[stdout]\n{stdout_text}\n\n[stderr]\n{stderr_text}\n",+ encoding="utf-8",+ )+ combined_tail = (stdout_text.splitlines() + stderr_text.splitlines())[-40:]+ if combined_tail:+ LOGGER.warning(+ f"{label}: lcov capture timed out after {timeout_seconds}s; full log: {log_file}\n"+ + "\n".join(combined_tail)+ )+ raise RuntimeError(f"{label}: lcov capture timed out after {timeout_seconds}s") from exc++ stdout_text = _as_text(completed.stdout)+ stderr_text = _as_text(completed.stderr)+ log_file.write_text(+ f"$ {display}\nexit_code={completed.returncode}\n\n[stdout]\n{stdout_text}\n\n[stderr]\n{stderr_text}\n",+ encoding="utf-8",+ )++ if completed.returncode == 0 and output_file.exists() and output_file.stat().st_size > 0:+ return++ log_text = f"{stdout_text}\n{stderr_text}"+ bad_files = _extract_problematic_gcda(log_text)+ removed = _remove_gcda_files(bad_files)++ if removed > 0:+ preview = ", ".join(str(p) for p in bad_files[:3])+ more = "" if len(bad_files) <= 3 else f", ... (+{len(bad_files) - 3} more)"+ LOGGER.warning(+ "%s: removed %s problematic .gcda file(s): %s%s; lcov log: %s",+ label,+ removed,+ preview,+ more,+ log_file,+ )+ continue++ finished_info = "Finished .info-file creation" in log_text+ excluded_match = re.search(r"Excluded data for (\d+) files due to include/exclude options", log_text)+ excluded_suffix = f", excluded={excluded_match.group(1)}" if excluded_match else ""+ if output_file.exists():+ size_bytes = output_file.stat().st_size+ else:+ size_bytes = -1++ if output_file.exists() and (size_bytes > 0 or finished_info):+ LOGGER.warning(+ f"{label}: lcov returned {completed.returncode}, but {output_file.name} was produced "+ f"(size={size_bytes} bytes{excluded_suffix}); continuing. lcov log: {log_file}"+ )+ return++ combined_tail = (stdout_text.splitlines() + stderr_text.splitlines())[-40:]+ if combined_tail:+ LOGGER.warning(+ f"{label}: lcov capture failed (attempt {attempt}); full log: {log_file}\n"+ + "\n".join(combined_tail)+ )+ raise RuntimeError(f"{label}: lcov capture failed without recoverable gcda cleanup; see {log_file}")++ raise RuntimeError(f"{label}: failed to capture coverage after {max_attempts} attempts")+++def _merge_tracefiles(tracefiles: list[Path], output: Path, *, branch_coverage: bool) -> None:+ """Merge captured lcov tracefiles into the final coverage report.++ Coverage may be captured from the main build and the JS build, so those+ partial reports need to be combined into a single ``coverage.info`` file+ for downstream upload and HTML generation.+ """+ if not tracefiles:+ raise RuntimeError("No native C/C++ coverage tracefiles were produced.")++ if len(tracefiles) == 1:+ output.write_bytes(tracefiles[0].read_bytes())+ return++ cmd = ["lcov"]+ if branch_coverage:+ cmd.extend(["--rc", "lcov_branch_coverage=1"])+ for tracefile in tracefiles:+ cmd.extend(["-a", str(tracefile)])+ cmd.extend(["-o", str(output)])+ run_cmd(cmd)+++def run(ctx: CoverageContext) -> None:+ """Collect native C/C++ coverage data and generate HTML output.++ The flow intentionally cleans up incompatible gcov artifacts, captures all+ available native tracefiles, merges them, and then produces the final report+ used by Codecov and local HTML inspection.+ """+ src_dir = ctx.workspace+ report_dir = ctx.workspace / "coverage-report"+ merged_info = ctx.workspace / "coverage.info"+ trace_dir = ctx.workspace / ".tmp" / "cpp-coverage-parts"+ shutil.rmtree(trace_dir, ignore_errors=True)+ trace_dir.mkdir(parents=True, exist_ok=True)+ tracefiles: list[Path] = []++ tool_report = _tool_version_report()+ (trace_dir / "tool-versions.txt").write_text(tool_report, encoding="utf-8")+ LOGGER.info("Native coverage tool versions:\n%s", tool_report.rstrip())++ (trace_dir / "main-build-before-prefilter.txt").write_text(+ _tree_inventory_report(+ root=ctx.paths.build_dir,+ label="main build before prefilter",+ gcno_root=ctx.paths.build_dir,+ alt_gcno_root=ctx.paths.build_js_dir if ctx.paths.build_js_dir.exists() else None,+ ),+ encoding="utf-8",+ )+ (trace_dir / "js-build-before-prefilter.txt").write_text(+ _tree_inventory_report(+ root=ctx.paths.build_js_dir,+ label="js build before prefilter",+ gcno_root=ctx.paths.build_js_dir,+ alt_gcno_root=ctx.paths.build_dir if ctx.paths.build_dir.exists() else None,+ ),+ encoding="utf-8",+ )++ _prune_unwanted_gcda(+ ctx.paths.build_dir,+ label="main build",+ run_gpu_tests=ctx.run_gpu_tests,+ run_npu_tests=ctx.run_npu_tests,+ )+ if ctx.paths.build_js_dir.exists():+ _prune_unwanted_gcda(+ ctx.paths.build_js_dir,+ label="js build",+ run_gpu_tests=ctx.run_gpu_tests,+ run_npu_tests=ctx.run_npu_tests,+ )++ _prefilter_incompatible_gcda(ctx.paths.build_dir, label="main build")+ if ctx.paths.build_js_dir.exists():+ _prefilter_incompatible_gcda(ctx.paths.build_js_dir, label="js build")++ (trace_dir / "main-build-after-prefilter.txt").write_text(+ _tree_inventory_report(+ root=ctx.paths.build_dir,+ label="main build after prefilter",+ gcno_root=ctx.paths.build_dir,+ alt_gcno_root=ctx.paths.build_js_dir if ctx.paths.build_js_dir.exists() else None,+ ),+ encoding="utf-8",+ )+ (trace_dir / "js-build-after-prefilter.txt").write_text(+ _tree_inventory_report(+ root=ctx.paths.build_js_dir,+ label="js build after prefilter",+ gcno_root=ctx.paths.build_js_dir,+ alt_gcno_root=ctx.paths.build_dir if ctx.paths.build_dir.exists() else None,+ ),+ encoding="utf-8",+ )+ LOGGER.info("Wrote native coverage inventories under %s", trace_dir)+ for inventory_name in (+ "main-build-before-prefilter.txt",+ "main-build-after-prefilter.txt",+ "js-build-before-prefilter.txt",+ "js-build-after-prefilter.txt",+ ):+ inventory_path = trace_dir / inventory_name+ if inventory_path.is_file():+ LOGGER.info(+ "===== %s =====\n%s",+ inventory_name,+ "\n".join(inventory_path.read_text(encoding="utf-8").splitlines()[:40]),+ )++ has_main_gcda = _has_gcda(ctx.paths.build_dir)+ has_js_gcda = _has_gcda(ctx.paths.build_js_dir)++ if has_main_gcda:+ main_info = trace_dir / "main-build.info"+ _run_lcov_capture(+ directory=ctx.paths.build_dir,+ base_directory=src_dir,+ output_file=main_info,+ label="C/C++ main capture",+ debug_dir=trace_dir,+ branch_coverage=ctx.branch_coverage,+ )+ else:+ LOGGER.warning("No .gcda files found in %s, skipping main native C++ capture", ctx.paths.build_dir)++ main_info = None++ if has_js_gcda:+ js_info = trace_dir / "js-build.info"+ _run_lcov_capture(+ directory=ctx.paths.build_js_dir,+ base_directory=src_dir,+ output_file=js_info,+ label="C/C++ JS-side capture",+ debug_dir=trace_dir,+ branch_coverage=ctx.branch_coverage,+ )+ tracefiles.append(js_info)+ else:+ if ctx.paths.build_js_dir.exists():+ LOGGER.warning("No .gcda files found in %s, skipping JS-side native C++ capture", ctx.paths.build_js_dir)+ js_info = None++ if has_main_gcda and main_info is not None:+ tracefiles.append(main_info)++ _merge_tracefiles(tracefiles, merged_info, branch_coverage=ctx.branch_coverage)++ normalization_stats = _normalize_and_filter_tracefile(+ tracefile=merged_info,+ workspace=src_dir,+ debug_dir=trace_dir,+ run_gpu_tests=ctx.run_gpu_tests,+ run_npu_tests=ctx.run_npu_tests,+ )++ if not merged_info.exists() or merged_info.stat().st_size == 0:+ raise RuntimeError("coverage.info is empty after normalization.")+ LOGGER.info(+ "Normalized merged tracefile: kept=%s, dropped_unresolved=%s, dropped_excluded=%s, rewritten=%s",+ normalization_stats["kept_records"],+ normalization_stats["dropped_unresolved"],+ normalization_stats["dropped_excluded"],+ normalization_stats["rewritten_paths"],+ )+ run_cmd(["grep", "-m", "10", "^SF:", str(merged_info)], check=False)++ report_dir.mkdir(parents=True, exist_ok=True)+ genhtml_rc = run_cmd(+ [+ "genhtml",+ str(merged_info),+ "--output-directory",+ str(report_dir),+ "--synthesize-missing",+ *(["--branch-coverage"] if ctx.branch_coverage else []),+ ],+ cwd=src_dir,+ check=False,+ )+ if genhtml_rc != 0:+ LOGGER.warning("genhtml failed; coverage.info is still available for Codecov upload.")diff --git a/.github/scripts/coverage/config/tests_cpp.yml b/.github/scripts/coverage/config/tests_cpp.ymlnew file mode 100644index 00000000000..0d5891d8b8a--- /dev/null+++ b/.github/scripts/coverage/config/tests_cpp.yml@@ -0,0 +1,199 @@+schema_version: 1+suite: cpp+tests:+ - name: ov_api_conformance_tests+ binary: ov_api_conformance_tests+ mode: gtest_single+ args: "*mandatory*"++ - name: ov_auto_batch_func_tests+ binary: ov_auto_batch_func_tests+ mode: gtest_single+ args: "*smoke*"++ - name: ov_auto_batch_unit_tests+ binary: ov_auto_batch_unit_tests+ mode: gtest_single++ - name: ov_auto_func_tests+ binary: ov_auto_func_tests+ mode: gtest_single+ args: "*smoke*"++ - name: ov_auto_unit_tests+ binary: ov_auto_unit_tests+ mode: gtest_single++ - name: ov_capi_test+ binary: ov_capi_test+ mode: gtest_single++ - name: ov_conditional_compilation_tests+ binary: ov_conditional_compilation_tests+ mode: gtest_single++ - name: ov_core_unit_tests+ binary: ov_core_unit_tests+ mode: gtest_single+ profiles: [cpu, gpu]+ args:+ cpu: "-*IE_GPU*"+ gpu: "*IE_GPU*"+ default: ""++ - name: ov_cpu_func_tests+ binary: ov_cpu_func_tests+ mode: gtest_single+ args: "*smoke*"++ - name: ov_cpu_unit_tests+ binary: ov_cpu_unit_tests+ mode: gtest_single++ - name: ov_cpu_unit_tests_vectorized+ binary: ov_cpu_unit_tests_vectorized+ mode: gtest_single++ - name: ov_hetero_func_tests+ binary: ov_hetero_func_tests+ mode: gtest_single+ args: "*smoke*:-nightly*"++ - name: ov_hetero_unit_tests+ binary: ov_hetero_unit_tests+ mode: gtest_single++ - name: ov_inference_functional_tests+ binary: ov_inference_functional_tests+ mode: gtest_single++ - name: ov_inference_unit_tests+ binary: ov_inference_unit_tests+ mode: gtest_single++ - name: ov_ir_frontend_tests+ binary: ov_ir_frontend_tests+ mode: gtest_single++ - name: ov_lp_transformations_tests+ binary: ov_lp_transformations_tests+ mode: gtest_single++ - name: ov_onnx_frontend_tests+ binary: ov_onnx_frontend_tests+ mode: gtest_single+ profiles: [cpu, gpu]+ args:+ cpu: "-*IE_GPU*"+ gpu: "*IE_GPU*"+ default: ""++ - name: ov_onnx_frontend_tests (ONNX_ITERATOR=0)+ binary: ov_onnx_frontend_tests+ mode: gtest_single+ extra_env: "ONNX_ITERATOR=0"+ profiles: [cpu, gpu]+ args:+ cpu: "-*IE_GPU*"+ gpu: "*IE_GPU*"+ default: ""++ - name: ov_op_conformance_tests+ binary: ov_op_conformance_tests+ mode: raw+ args: "--device=TEMPLATE --gtest_filter=*OpImpl*"++ - name: ov_proxy_plugin_tests+ binary: ov_proxy_plugin_tests+ mode: gtest_single++ - name: ov_snippets_func_tests+ binary: ov_snippets_func_tests+ mode: gtest_single++ - name: ov_subgraphs_dumper_tests+ binary: ov_subgraphs_dumper_tests+ mode: gtest_single++ - name: ov_template_func_tests+ binary: ov_template_func_tests+ mode: gtest_single+ args: "*smoke*"++ - name: ov_tensorflow_common_tests+ binary: ov_tensorflow_common_tests+ mode: gtest_single++ - name: ov_tensorflow_frontend_tests+ binary: ov_tensorflow_frontend_tests+ mode: gtest_single+ profiles: [cpu, gpu]+ args:+ cpu: "-*IE_GPU*"+ gpu: "*IE_GPU*"+ default: ""++ - name: ov_tensorflow_lite_frontend_tests+ binary: ov_tensorflow_lite_frontend_tests+ mode: gtest_single++ - name: ov_transformations_tests+ binary: ov_transformations_tests+ mode: gtest_single++ - name: ov_util_tests+ binary: ov_util_tests+ mode: gtest_single++ - name: ov_paddle_tests+ binary: ov_paddle_tests+ mode: gtest_single++ - name: ov_npu_unit_tests+ binary: ov_npu_unit_tests+ mode: gtest_single+ profiles: [npu]+ profile_skip_reason: "NPU profile is OFF"++ - name: ov_npu_func_tests+ binary: ov_npu_func_tests+ mode: gtest_single+ args: "*smoke*"+ profiles: [npu]+ profile_skip_reason: "NPU profile is OFF"++ - name: ov_nvidia_func_tests+ binary: ov_nvidia_func_tests+ mode: gtest_single+ skip_reason: "unsupported in coverage workflow"++ - name: ov_gpu_unit_tests+ binary: ov_gpu_unit_tests+ mode: gtest_single+ profiles: [gpu]+ profile_skip_reason: "GPU profile is OFF"++ - name: ov_gpu_func_tests+ binary: ov_gpu_func_tests+ mode: gtest_single+ args: "*smoke*"+ profiles: [gpu]+ profile_skip_reason: "GPU profile is OFF"++ - name: test_inference_async+ binary: test_inference_async+ mode: raw+ profiles: [cpu, gpu, npu]+ args:+ gpu: "__MODEL_PATH__ GPU"+ npu: "__MODEL_PATH__ NPU"+ default: "__MODEL_PATH__ CPU"++ - name: test_inference_sync+ binary: test_inference_sync+ mode: raw+ profiles: [cpu, gpu, npu]+ args:+ gpu: "__MODEL_PATH__ GPU"+ npu: "__MODEL_PATH__ NPU"+ default: "__MODEL_PATH__ CPU"diff --git a/.github/scripts/coverage/config/tests_js.yml b/.github/scripts/coverage/config/tests_js.ymlnew file mode 100644index 00000000000..2f0d6d08578--- /dev/null+++ b/.github/scripts/coverage/config/tests_js.yml@@ -0,0 +1,60 @@+schema_version: 1+suite: js+tests:+ - name: node tests/setup.js (covered)+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=true --exclude 'tests/**' --exclude 'thirdparty/**' node ./tests/setup.js"++ - name: node scripts/download-runtime.js --ignore-if-exists (covered)+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node ./scripts/download-runtime.js --ignore-if-exists"++ - name: node unit core.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/core.test.js"++ - name: node unit model.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/model.test.js"++ - name: node unit read_model.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/read_model.test.js"++ - name: node unit basic.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/basic.test.js"++ - name: node unit compiled_model.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/compiled_model.test.js"++ - name: node unit infer_request.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/infer_request.test.js"++ - name: node unit async_infer_queue.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/async_infer_queue.test.js"++ - name: node unit tensor.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/tensor.test.js"++ - name: node unit partial_shape.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/partial_shape.test.js"++ - name: node unit pre_post_processor.test.js+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node --test ./tests/unit/pre_post_processor.test.js"++ - name: npm run test:e2e+ kind: command+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' npm run test:e2e --loglevel=silly"++ - name: js_gpu_compile_model_smoke+ kind: command+ profiles: [gpu]+ profile_skip_reason: "GPU profile is OFF"+ command: "npx c8 --reporter=lcov --reporter=text --report-dir ${OV_WORKSPACE}/js-coverage --clean=false --exclude 'tests/**' --exclude 'thirdparty/**' node -e \"const path=require('path'); const { addon: ov } = require('.'); const core = new ov.Core(); const devices = core.getAvailableDevices(); if (!devices.includes('GPU')) { throw new Error('GPU device is not available'); } const model = core.readModelSync(path.resolve('./tests/unit/test_models/add_model.xml')); const compiled = core.compileModelSync(model, 'GPU'); if (!compiled) { throw new Error('Failed to compile model on GPU'); } console.log('GPU JS smoke OK');\""diff --git a/.github/scripts/coverage/config/tests_python.yml b/.github/scripts/coverage/config/tests_python.ymlnew file mode 100644index 00000000000..f50573ca1ad--- /dev/null+++ b/.github/scripts/coverage/config/tests_python.yml@@ -0,0 +1,138 @@+schema_version: 1+suite: python+tests:+ - name: pyopenvino+ kind: pytest+ target: "${TESTS_DIR}/pyopenvino"+ args: "-sv -k 'not cuda' --ignore=${TESTS_DIR}/pyopenvino/tests/test_utils/test_utils.py"++ - name: onnx_python+ kind: pytest+ target: "${TESTS_DIR}/onnx"+ args: "-sv -k 'not cuda' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py"++ - name: ovc_unit+ kind: pytest+ target: "${TESTS_DIR}/ovc/unit_tests"+ args: "-sv -k 'not cuda'"++ - name: py_frontend+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/py_frontend_tests"+ args: "-sv -v"++ - name: tensorflow_lite_layers+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/tensorflow_lite_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args: "-sv -v"++ - name: tensorflow_layers+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/tensorflow_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args: "-sv -m precommit -v"++ - name: tensorflow2_keras_layers+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/tensorflow2_keras_tests"+ env: "TEST_DEVICE=CPU"+ args: "-sv -m precommit -v"++ - name: onnx_layers+ kind: pytest_if_dir+ profiles: [cpu, gpu, npu]+ target: "${TESTS_DIR}/layer_tests/onnx_tests"+ env:+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16"+ npu: "TEST_DEVICE=NPU TEST_PRECISION=FP16"+ default: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args:+ cpu: "-sv -k 'not gpu and not cuda and not npu'"+ gpu: "-sv -k 'not cuda and not npu'"+ npu: "-sv -k 'not cuda and not gpu'"+ default: "-sv -k 'not gpu and not cuda and not npu'"++ - name: pytorch_layers+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/pytorch_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP32"+ args: "-sv -m precommit -v"++ - name: pytorch_layers_export+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/pytorch_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=EXPORT"+ args: "-sv -m precommit_torch_export -v"++ - name: pytorch_layers_fx_backend+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/pytorch_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=TORCHFX"+ args: "-sv -m precommit_fx_backend -v"++ - name: jax_layers_precommit+ kind: pytest_if_dir+ target: "${TESTS_DIR}/layer_tests/jax_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args: "-sv -m precommit_jax_fe -k 'not cuda'"++ - name: src_py_runtime+ kind: pytest_if_dir+ target: "${SRC_PY_TESTS_DIR}/test_runtime"+ args: "-sv -k 'not gpu and not cuda and not npu'"++ - name: src_py_graph+ kind: pytest_if_dir+ target: "${SRC_PY_TESTS_DIR}/test_graph"+ args: "-sv -k 'not gpu and not cuda and not npu'"++ - name: src_py_transformations+ kind: pytest_if_dir+ target: "${SRC_PY_TESTS_DIR}/test_transformations"+ args: "-sv -k 'not gpu and not cuda and not npu'"++ - name: src_onnx_frontend_python+ kind: pytest_if_dir+ target: "${ONNX_PY_TESTS_DIR}"+ args: "-sv -k 'not gpu and not cuda and not npu and not zoo' --ignore=${ONNX_PY_TESTS_DIR}/test_zoo_models.py"++ - name: src_py_runtime_strict+ kind: pytest_if_dir+ target: "${SRC_PY_TESTS_DIR}/test_runtime"+ args: "-q --maxfail=1 -k 'not gpu and not cuda and not npu'"++ - name: src_py_utils+ kind: pytest_if_dir+ target: "${SRC_PY_TESTS_DIR}/test_utils"+ args: "-sv -k 'not gpu and not cuda and not npu'"++ - name: src_py_package_versions+ kind: pytest+ target: "${SRC_PY_TESTS_DIR}/test_package_versions.py"+ args: "-sv -k 'not cuda'"++ - name: src_py_runtime_remote_api_gpu+ kind: pytest+ profiles: [gpu]+ profile_skip_reason: "GPU profile is OFF"+ target: "${SRC_PY_TESTS_DIR}/test_runtime/test_remote_api.py"+ env: "TEST_DEVICE=GPU TEST_PRECISION=FP16"+ args: "-sv -k 'not cuda'"++ - name: tf_api_precommit_subset+ kind: pytest_if_dir+ target: "${WORKSPACE_LAYER_TESTS_DIR}/ovc_python_api_tests"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args: "-sv -m precommit_tf_fe -k 'test_tf and not cuda' -v"++ - name: ovc_python_api_paddle_precommit+ kind: pytest+ target: "${WORKSPACE_LAYER_TESTS_DIR}/ovc_python_api_tests/test_paddle.py"+ env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"+ args: "-sv -m precommit -k 'not cuda'"++ - name: ovc_cli_help+ kind: command+ command: "python3 -m coverage run -a -m openvino.tools.ovc --help"diff --git a/.github/scripts/coverage/coverage.py b/.github/scripts/coverage/coverage.pynew file mode 100644index 00000000000..7aec77902ad--- /dev/null+++ b/.github/scripts/coverage/coverage.py@@ -0,0 +1,677 @@+# Copyright (C) 2018-2026 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from __future__ import annotations++import argparse+from collections.abc import Callable, Sequence+from dataclasses import dataclass+import importlib+import logging+import os+from pathlib import Path+import shlex+import subprocess+import sys+from typing import Any+++SCRIPT_DIR = Path(__file__).resolve().parent+CONFIG_DIR = SCRIPT_DIR / "config"+if str(SCRIPT_DIR) not in sys.path:+ sys.path.insert(0, str(SCRIPT_DIR))+# Stable import alias used by step modules.+sys.modules.setdefault("coverage_workflow", sys.modules[__name__])+++SUPPORTED_PROFILES = {"cpu", "gpu", "npu"}+++def _build_logger() -> logging.Logger:+ """Create the shared logger used by the coverage helpers."""+ logger = logging.getLogger("coverage")+ if logger.handlers:+ return logger++ handler = logging.StreamHandler()+ handler.setFormatter(logging.Formatter("[coverage][%(levelname)s] %(message)s"))+ logger.addHandler(handler)+ logger.setLevel(logging.INFO)+ logger.propagate = False+ return logger+++LOGGER = _build_logger()+++@dataclass(frozen=True)+class CppTestCase:+ name: str+ enabled: bool+ skip_reason: str+ binary: str+ mode: str+ args: str+ extra_env: str+++@dataclass(frozen=True)+class PythonTestCase:+ name: str+ enabled: bool+ skip_reason: str+ kind: str+ target: str+ args: str+ env: str+ command: str+++@dataclass(frozen=True)+class JsTestCase:+ name: str+ enabled: bool+ skip_reason: str+ kind: str+ command: str+++@dataclass(frozen=True)+class Paths:+ workspace: Path+ build_dir: Path+ build_js_dir: Path+ install_pkg_dir: Path+ bin_dir: Path+ js_dir: Path+ model_path: Path+++@dataclass(frozen=True)+class ProfileFlags:+ run_gpu_tests: bool+ run_npu_tests: bool+ gpu_flags: tuple[str, ...]+ npu_flags: tuple[str, ...]+++@dataclass(frozen=True)+class ConfigValidationIssue:+ suite: str+ test_name: str+ message: str+++class GithubIO:+ """Manage GitHub Actions env and summary files with a local fallback."""++ def __init__(self, workspace: Path) -> None:+ self.workspace = workspace+ self._github_env = os.environ.get("GITHUB_ENV", "").strip()+ self._github_summary = os.environ.get("GITHUB_STEP_SUMMARY", "").strip()+ self._summary_enabled = os.environ.get("COVERAGE_WRITE_STEP_SUMMARY", "true").strip().lower() != "false"++ self.local_state_dir = workspace / ".tmp" / "coverage-local"+ self.local_env_file = self.local_state_dir / "github_env"+ self.local_summary_file = self.local_state_dir / "step_summary.md"++ self.local_state_dir.mkdir(parents=True, exist_ok=True)+ self.local_env_file.touch(exist_ok=True)+ self.local_summary_file.touch(exist_ok=True)++ @property+ def env_file(self) -> Path:+ if self._github_env:+ return Path(self._github_env)+ return self.local_env_file++ @property+ def summary_file(self) -> Path:+ if self._github_summary:+ return Path(self._github_summary)+ return self.local_summary_file++ @property+ def is_github_mode(self) -> bool:+ return bool(self._github_env)++ def load_local_env(self) -> dict[str, str]:+ """Load locally persisted workflow variables when not in Actions."""+ if self.is_github_mode:+ return {}++ loaded: dict[str, str] = {}+ if not self.local_env_file.exists():+ return loaded++ for raw_line in self.local_env_file.read_text(encoding="utf-8").splitlines():+ line = raw_line.strip()+ if not line or "=" not in line:+ continue+ key, value = line.split("=", 1)+ loaded[key] = value+ return loaded++ def export_env(self, key: str, value: str) -> None:+ """Append an environment variable to the active env file."""+ with self.env_file.open("a", encoding="utf-8") as f:+ f.write(f"{key}={value}\n")+ os.environ[key] = value++ def append_summary(self, text: str) -> None:+ """Append text to the step summary when summary output is enabled."""+ if not self._summary_enabled:+ return+ with self.summary_file.open("a", encoding="utf-8") as f:+ f.write(text)+ if not text.endswith("\n"):+ f.write("\n")+++def run_cmd(+ cmd: Sequence[str] | str,+ *,+ cwd: Path | None = None,+ env: dict[str, str] | None = None,+ check: bool = True,+ shell: bool = False,+) -> int:+ """Run a command and optionally fail when it returns non-zero."""+ display = cmd if isinstance(cmd, str) else " ".join(shlex.quote(part) for part in cmd)+ LOGGER.info("$ %s", display)+ completed = subprocess.run(cmd, cwd=cwd, env=env, shell=shell, text=True)+ if check and completed.returncode != 0:+ raise RuntimeError(f"Command failed with exit code {completed.returncode}: {display}")+ return completed.returncode+++def run_cmd_capture(cmd: Sequence[str], *, cwd: Path | None = None, check: bool = True) -> str:+ """Run a command and return captured stdout."""+ display = " ".join(shlex.quote(part) for part in cmd)+ LOGGER.info("$ %s", display)+ completed = subprocess.run(cmd, cwd=cwd, text=True, capture_output=True)+ if check and completed.returncode != 0:+ stderr = completed.stderr.strip()+ raise RuntimeError(f"Command failed with exit code {completed.returncode}: {display}\n{stderr}")+ return completed.stdout+++def env_from_assignments(assignments: str | None, base_env: dict[str, str] | None = None) -> dict[str, str]:+ """Apply shell-style KEY=VALUE assignments to an environment mapping."""+ env = dict(base_env or os.environ)+ if not assignments:+ return env++ for token in shlex.split(assignments):+ if "=" not in token:+ continue+ key, value = token.split("=", 1)+ env[key] = value+ return env+++def _repo_root(default: Path) -> Path:+ """Return the git repository root when available."""+ try:+ output = subprocess.check_output(+ ["git", "rev-parse", "--show-toplevel"],+ stderr=subprocess.DEVNULL,+ text=True,+ ).strip()+ if output:+ return Path(output)+ except Exception:+ pass+ return default+++def _profile_flags(profile: str) -> ProfileFlags:+ """Resolve build flags and runtime switches for a test profile."""+ if profile == "cpu":+ return ProfileFlags(False, False, ("-DENABLE_INTEL_GPU=OFF", "-DENABLE_ONEDNN_FOR_GPU=OFF"), ("-DENABLE_INTEL_NPU=OFF",))+ if profile == "gpu":+ return ProfileFlags(True, False, ("-DENABLE_INTEL_GPU=ON", "-DENABLE_ONEDNN_FOR_GPU=ON"), ("-DENABLE_INTEL_NPU=OFF",))+ if profile == "npu":+ return ProfileFlags(False, True, ("-DENABLE_INTEL_GPU=OFF", "-DENABLE_ONEDNN_FOR_GPU=OFF"), ("-DENABLE_INTEL_NPU=ON",))+ raise ValueError(f"Unsupported TEST_PROFILE: {profile}. Use one of: {', '.join(sorted(SUPPORTED_PROFILES))}")+++@dataclass+class CoverageContext:+ """Runtime configuration shared by coverage workflow steps."""++ workspace: Path+ build_type: str+ branch_coverage: bool+ test_profile: str+ cc: str+ cxx: str+ paths: Paths+ profile_flags: ProfileFlags+ io: GithubIO++ @classmethod+ def from_env(cls) -> "CoverageContext":+ """Build a coverage context from environment variables."""+ workspace = Path(os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE") or str(_repo_root(Path.cwd()))).resolve()++ io = GithubIO(workspace)+ local_vars = io.load_local_env()+ for key, value in local_vars.items():+ os.environ.setdefault(key, value)++ build_type = os.environ.get("CMAKE_BUILD_TYPE", "Release")++ def _bool_env(name: str, fallback: bool) -> bool:+ raw = os.environ.get(name)+ if raw is None or raw.strip() == "":+ return fallback+ return raw.strip().lower() in {"1", "true", "yes", "on"}++ branch_coverage = _bool_env("ENABLE_BRANCH_COVERAGE", False)++ test_profile = os.environ.get("TEST_PROFILE", "cpu").strip()+ if test_profile not in SUPPORTED_PROFILES:+ raise ValueError(f"Unsupported TEST_PROFILE: {test_profile}. Use one of: {', '.join(sorted(SUPPORTED_PROFILES))}")++ cc = os.environ.get("CC", "gcc")+ cxx = os.environ.get("CXX", "g++")++ paths = Paths(+ workspace=workspace,+ build_dir=Path(os.environ.get("BUILD_DIR", str(workspace / "build"))),+ build_js_dir=Path(os.environ.get("BUILD_JS_DIR", str(workspace / "build_js"))),+ install_pkg_dir=Path(os.environ.get("INSTALL_PKG_DIR", str(workspace / "install_pkg"))),+ bin_dir=Path(os.environ.get("BIN_DIR", str(workspace / "bin" / "intel64" / build_type))),+ js_dir=Path(os.environ.get("JS_DIR", str(workspace / "src" / "bindings" / "js" / "node"))),+ model_path=Path(os.environ.get("MODEL_PATH", str(workspace / "src" / "core" / "tests" / "models" / "ir" / "add_abc.xml"))),+ )++ profile_flags = _profile_flags(test_profile)++ os.environ["OV_WORKSPACE"] = str(workspace)+ os.environ["CMAKE_BUILD_TYPE"] = build_type+ os.environ["ENABLE_BRANCH_COVERAGE"] = "true" if branch_coverage else "false"+ os.environ["TEST_PROFILE"] = test_profile+ os.environ["RUN_GPU_TESTS"] = "true" if profile_flags.run_gpu_tests else "false"+ os.environ["RUN_NPU_TESTS"] = "true" if profile_flags.run_npu_tests else "false"++ return cls(+ workspace=workspace,+ build_type=build_type,+ branch_coverage=branch_coverage,+ test_profile=test_profile,+ cc=cc,+ cxx=cxx,+ paths=paths,+ profile_flags=profile_flags,+ io=io,+ )++ @property+ def run_gpu_tests(self) -> bool:+ return self.profile_flags.run_gpu_tests++ @property+ def run_npu_tests(self) -> bool:+ return self.profile_flags.run_npu_tests++ @property+ def gpu_flags(self) -> tuple[str, ...]:+ return self.profile_flags.gpu_flags++ @property+ def npu_flags(self) -> tuple[str, ...]:+ return self.profile_flags.npu_flags++ def log_profile(self) -> None:+ """Print the resolved profile and accelerator flags."""+ LOGGER.info("TEST_PROFILE=%s", self.test_profile)+ LOGGER.info("ENABLE_BRANCH_COVERAGE=%s", "true" if self.branch_coverage else "false")+ LOGGER.info("RUN_GPU_TESTS=%s", "true" if self.run_gpu_tests else "false")+ LOGGER.info("RUN_NPU_TESTS=%s", "true" if self.run_npu_tests else "false")+ LOGGER.info("GPU_FLAGS=%s", " ".join(self.gpu_flags))+ LOGGER.info("NPU_FLAGS=%s", " ".join(self.npu_flags))+++def _as_text(value: Any) -> str:+ """Normalize a value into the string form used by configs."""+ if value is None:+ return ""+ if isinstance(value, bool):+ return "true" if value else "false"+ return str(value)+++def _resolve_profile_value(value: Any, profile: str) -> str:+ """Pick a profile-specific config value when a mapping is provided."""+ if isinstance(value, dict):+ if profile in value:+ return _as_text(value[profile])+ return _as_text(value.get("default", ""))+ return _as_text(value)+++def _resolve_enabled(test: dict[str, Any], profile: str) -> tuple[bool, str]:+ """Decide whether a configured test is enabled for the active profile."""+ skip_reason = _as_text(test.get("skip_reason", "")).strip()+ profiles = test.get("profiles")++ # Accelerator-specific profiles execute only tests explicitly marked for them.+ if profile in {"gpu", "npu"} and profiles is None:+ reason = _as_text(test.get("profile_skip_reason", "")).strip()+ if not reason:+ reason = f"{profile.upper()} profile is OFF"+ return False, reason++ if profiles is not None:+ normalized = [str(p) for p in profiles]+ if profile not in normalized:+ reason = _as_text(test.get("profile_skip_reason", "")).strip()+ if not reason:+ reason = f"{profile.upper()} profile is OFF"+ return False, reason++ if skip_reason:+ return False, skip_reason++ return True, ""+++def _load_yaml(path: Path) -> dict[str, Any]:+ """Load a YAML config file used by the coverage tooling."""+ if not path.exists():+ raise FileNotFoundError(f"Config file not found: {path}")+ try:+ import yaml # type: ignore[import-not-found]+ except ModuleNotFoundError as exc:+ raise RuntimeError("PyYAML is required in the coverage runtime environment.") from exc++ data = yaml.safe_load(path.read_text(encoding="utf-8")) or {}+ if not isinstance(data, dict):+ raise ValueError(f"Invalid YAML root in {path}")+ return data+++def _load_tests(path: Path, suite: str) -> list[dict[str, Any]]:+ """Load and validate raw test definitions for one suite."""+ data = _load_yaml(path)+ found_suite = _as_text(data.get("suite", "")).strip()+ if found_suite != suite:+ raise ValueError(f"Invalid suite in {path}: expected '{suite}', got '{found_suite}'")+ tests = data.get("tests")+ if not isinstance(tests, list):+ raise ValueError(f"Invalid config: 'tests' list is missing in {path}")+ return tests+++def load_cpp_tests(path: Path, profile: str) -> list[CppTestCase]:+ """Load resolved C++ test definitions for a profile."""+ if profile not in SUPPORTED_PROFILES:+ raise ValueError(f"Unsupported profile: {profile}")++ loaded: list[CppTestCase] = []+ for test in _load_tests(path, "cpp"):+ enabled, reason = _resolve_enabled(test, profile)+ loaded.append(+ CppTestCase(+ name=_as_text(test.get("name", "")).strip(),+ enabled=enabled,+ skip_reason=reason,+ binary=_as_text(test.get("binary", "")).strip(),+ mode=_as_text(test.get("mode", "gtest_single")).strip() or "gtest_single",+ args=_resolve_profile_value(test.get("args", ""), profile).strip(),+ extra_env=_resolve_profile_value(test.get("extra_env", ""), profile).strip(),+ )+ )+ return loaded+++def load_python_tests(path: Path, profile: str) -> list[PythonTestCase]:+ """Load resolved Python test definitions for a profile."""+ if profile not in SUPPORTED_PROFILES:+ raise ValueError(f"Unsupported profile: {profile}")++ loaded: list[PythonTestCase] = []+ for test in _load_tests(path, "python"):+ enabled, reason = _resolve_enabled(test, profile)+ loaded.append(+ PythonTestCase(+ name=_as_text(test.get("name", "")).strip(),+ enabled=enabled,+ skip_reason=reason,+ kind=_as_text(test.get("kind", "pytest")).strip() or "pytest",+ target=_resolve_profile_value(test.get("target", ""), profile).strip(),+ args=_resolve_profile_value(test.get("args", ""), profile).strip(),+ env=_resolve_profile_value(test.get("env", ""), profile).strip(),+ command=_resolve_profile_value(test.get("command", ""), profile).strip(),+ )+ )+ return loaded+++def load_js_tests(path: Path, profile: str) -> list[JsTestCase]:+ """Load resolved JS test definitions for a profile."""+ if profile not in SUPPORTED_PROFILES:+ raise ValueError(f"Unsupported profile: {profile}")++ loaded: list[JsTestCase] = []+ for test in _load_tests(path, "js"):+ enabled, reason = _resolve_enabled(test, profile)+ loaded.append(+ JsTestCase(+ name=_as_text(test.get("name", "")).strip(),+ enabled=enabled,+ skip_reason=reason,+ kind=_as_text(test.get("kind", "command")).strip() or "command",+ command=_resolve_profile_value(test.get("command", ""), profile).strip(),+ )+ )+ return loaded+++def validate_configs(config_dir: Path) -> list[ConfigValidationIssue]:+ """Validate coverage YAML configs and return any issues found."""+ issues: list[ConfigValidationIssue] = []++ suites = {+ "cpp": config_dir / "tests_cpp.yml",+ "python": config_dir / "tests_python.yml",+ "js": config_dir / "tests_js.yml",+ }++ for suite, path in suites.items():+ tests = _load_tests(path, suite)+ for idx, test in enumerate(tests):+ name = _as_text(test.get("name", f"<index:{idx}>"))+ if not _as_text(test.get("name", "")).strip():+ issues.append(ConfigValidationIssue(suite, name, "missing 'name'"))+ if suite == "cpp" and not _as_text(test.get("binary", "")).strip():+ issues.append(ConfigValidationIssue(suite, name, "missing 'binary'"))+ if suite == "python":+ kind = _as_text(test.get("kind", "pytest")).strip() or "pytest"+ if kind not in {"pytest", "pytest_if_dir", "command"}:+ issues.append(ConfigValidationIssue(suite, name, f"unsupported kind '{kind}'"))+ if suite == "js":+ kind = _as_text(test.get("kind", "command")).strip() or "command"+ if kind != "command":+ issues.append(ConfigValidationIssue(suite, name, f"unsupported kind '{kind}'"))++ return issues+++STEP_MODULES: dict[str, str] = {+ "run-cpp-tests": "run_tests:run_cpp",+ "run-python-tests": "run_tests:run_python",+ "run-js-tests": "run_tests:run_js",+ "collect-cpp-coverage": "collect_cpp_coverage",+}+++def _apply_common_env(args: argparse.Namespace) -> None:+ """Project CLI options into environment variables used by steps."""+ profile = getattr(args, "profile", None)+ if profile:+ os.environ["TEST_PROFILE"] = profile++ workspace = getattr(args, "workspace", None)+ if workspace:+ os.environ["OV_WORKSPACE"] = str(Path(workspace).resolve())++ build_type = getattr(args, "build_type", None)+ if build_type:+ os.environ["CMAKE_BUILD_TYPE"] = build_type++def _load_context(args: argparse.Namespace) -> CoverageContext:+ """Create a coverage context for the current command."""+ _apply_common_env(args)+ return CoverageContext.from_env()+++def _resolve_step_handler(step_name: str) -> Callable[[CoverageContext], None]:+ """Import and return the handler for a named workflow step."""+ handler_spec = STEP_MODULES.get(step_name)+ if not handler_spec:+ raise KeyError(f"Unknown step '{step_name}'")+ module_name, _, handler_name = handler_spec.partition(":")+ module = importlib.import_module(module_name)+ handler = getattr(module, handler_name or "run", None)+ if not callable(handler):+ raise RuntimeError(f"Step handler '{handler_spec}' is not callable")+ return handler # type: ignore[return-value]+++def _run_step(ctx: CoverageContext, step_name: str) -> None:+ """Execute one coverage workflow step."""+ LOGGER.info("Starting step: %s", step_name)+ handler = _resolve_step_handler(step_name)+ handler(ctx)+++def _command_step(args: argparse.Namespace) -> int:+ """Run a single named workflow step."""+ ctx = _load_context(args)+ _run_step(ctx, args.step_name)+ return 0+++def _command_list_tests(args: argparse.Namespace) -> int:+ """Print resolved tests for a suite/profile pair."""+ _apply_common_env(args)+ workspace = Path(os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE") or Path.cwd()).resolve()+ config_dir = CONFIG_DIR++ if args.suite == "cpp":+ tests = load_cpp_tests(config_dir / "tests_cpp.yml", args.profile)+ print("name\tenabled\tskip_reason\tbinary\tmode\targs\textra_env")+ for t in tests:+ print(+ "\t".join(+ [+ t.name,+ "1" if t.enabled else "0",+ t.skip_reason,+ t.binary,+ t.mode,+ t.args,+ t.extra_env,+ ]+ )+ )+ elif args.suite == "python":+ tests = load_python_tests(config_dir / "tests_python.yml", args.profile)+ print("name\tenabled\tskip_reason\tkind\ttarget\targs\tenv\tcommand")+ for t in tests:+ print(+ "\t".join(+ [+ t.name,+ "1" if t.enabled else "0",+ t.skip_reason,+ t.kind,+ t.target,+ t.args,+ t.env,+ t.command,+ ]+ )+ )+ else:+ tests = load_js_tests(config_dir / "tests_js.yml", args.profile)+ print("name\tenabled\tskip_reason\tkind\tcommand")+ for t in tests:+ print(+ "\t".join(+ [+ t.name,+ "1" if t.enabled else "0",+ t.skip_reason,+ t.kind,+ t.command,+ ]+ )+ )++ return 0+++def _command_validate_config(args: argparse.Namespace) -> int:+ """Validate the coverage YAML configuration files."""+ _apply_common_env(args)+ workspace = Path(os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE") or Path.cwd()).resolve()+ issues = validate_configs(CONFIG_DIR)++ if issues:+ for issue in issues:+ print(f"[config][{issue.suite}] {issue.test_name}: {issue.message}")+ return 1++ print("Coverage config validation passed")+ return 0+++def _add_common_options(parser: argparse.ArgumentParser, *, include_profile: bool = True) -> None:+ """Attach shared CLI options used by coverage commands."""+ if include_profile:+ parser.add_argument("--profile", choices=sorted(SUPPORTED_PROFILES), default=os.environ.get("TEST_PROFILE", "cpu"))+ parser.add_argument("--workspace", default=os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE"))+ parser.add_argument("--build-type", default=os.environ.get("CMAKE_BUILD_TYPE", "Release"))+++def build_parser() -> argparse.ArgumentParser:+ """Build the top-level CLI parser for coverage tooling."""+ parser = argparse.ArgumentParser(description="OpenVINO coverage test helpers")+ subparsers = parser.add_subparsers(dest="command", required=True)++ step_parser = subparsers.add_parser("step", help="Run one coverage step")+ _add_common_options(step_parser)+ step_parser.add_argument("step_name", choices=sorted(STEP_MODULES.keys()))+ step_parser.set_defaults(func=_command_step)++ list_parser = subparsers.add_parser("list-tests", help="List resolved tests for suite/profile")+ list_parser.add_argument("--suite", required=True, choices=["cpp", "python", "js"])+ list_parser.add_argument("--profile", choices=sorted(SUPPORTED_PROFILES), default=os.environ.get("TEST_PROFILE", "cpu"))+ list_parser.add_argument("--workspace", default=os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE"))+ list_parser.set_defaults(func=_command_list_tests)++ validate_parser = subparsers.add_parser("validate-config", help="Validate YAML coverage test configs")+ validate_parser.add_argument("--workspace", default=os.environ.get("OV_WORKSPACE") or os.environ.get("GITHUB_WORKSPACE"))+ validate_parser.set_defaults(func=_command_validate_config)++ return parser+++def main(argv: list[str] | None = None) -> int:+ """Parse arguments and run the selected CLI command."""+ parser = build_parser()+ args = parser.parse_args(argv)++ try:+ return int(args.func(args))+ except Exception as exc: # noqa: BLE001+ LOGGER.error("%s", exc)+ return 1+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/.github/scripts/coverage/requirements-ci.txt b/.github/scripts/coverage/requirements-ci.txtnew file mode 100644index 00000000000..7decd80dcaf--- /dev/null+++ b/.github/scripts/coverage/requirements-ci.txt@@ -0,0 +1,4 @@+coverage==7.13.5+pytest==9.0.2+pytest-cov==7.1.0+PyYAML==6.0.3diff --git a/.github/scripts/coverage/run_tests.py b/.github/scripts/coverage/run_tests.pynew file mode 100644index 00000000000..86aec212818--- /dev/null+++ b/.github/scripts/coverage/run_tests.py@@ -0,0 +1,894 @@+# Copyright (C) 2018-2026 Intel Corporation+# SPDX-License-Identifier: Apache-2.0++from __future__ import annotations++from dataclasses import dataclass+import csv+import os+from pathlib import Path+import shlex+import shutil+import subprocess+import time+import xml.etree.ElementTree as ET++from coverage_workflow import (+ CoverageContext,+ CppTestCase,+ LOGGER,+ env_from_assignments,+ load_cpp_tests,+ load_js_tests,+ load_python_tests,+ run_cmd,+)++SCRIPT_DIR = Path(__file__).resolve().parent+CONFIG_DIR = SCRIPT_DIR / "config"+++@dataclass(frozen=True)+class _SuiteSpec:+ label: str+ selection_env: str+ duration_file: str+ duration_env_key: str+ duration_total_env_key: str | None+ stats_file: str+ total_key: str+ executed_key: str | None+ passed_key: str+ failed_key: str+ skipped_key: str+ not_run_key: str+++@dataclass(frozen=True)+class _TestRunResult:+ name: str+ status: str+ detail: str = ""+ duration_seconds: float = 0.0+++CPP_SUITE = _SuiteSpec(+ label="C++",+ selection_env="CXX_TEST_NAMES",+ duration_file="cpp-test-durations.csv",+ duration_env_key="CXX_TEST_DURATION_REPORT",+ duration_total_env_key="CXX_TEST_DURATION_TOTAL_SECONDS",+ stats_file="cpp-coverage-stats.env",+ total_key="CXX_TESTS_TOTAL",+ executed_key="CXX_TESTS_EXECUTED",+ passed_key="CXX_TESTS_PASSED",+ failed_key="CXX_TESTS_FAILED",+ skipped_key="CXX_TESTS_SKIPPED",+ not_run_key="CXX_TESTS_NOT_RUN",+)++PYTHON_SUITE = _SuiteSpec(+ label="Python",+ selection_env="PY_TEST_NAMES",+ duration_file="python-test-durations.csv",+ duration_env_key="PY_TEST_DURATION_REPORT",+ duration_total_env_key=None,+ stats_file="python-coverage-stats.env",+ total_key="PY_TESTS_TOTAL",+ executed_key=None,+ passed_key="PY_TESTS_PASSED",+ failed_key="PY_TESTS_FAILED",+ skipped_key="PY_TESTS_SKIPPED",+ not_run_key="PY_TESTS_NOT_RUN",+)++JS_SUITE = _SuiteSpec(+ label="JS",+ selection_env="JS_TEST_NAMES",+ duration_file="js-test-durations.csv",+ duration_env_key="JS_TEST_DURATION_REPORT",+ duration_total_env_key=None,+ stats_file="js-coverage-stats.env",+ total_key="JS_TESTS_TOTAL",+ executed_key=None,+ passed_key="JS_TESTS_PASSED",+ failed_key="JS_TESTS_FAILED",+ skipped_key="JS_TESTS_SKIPPED",+ not_run_key="JS_TESTS_NOT_RUN",+)+++def _runtime_ld_library_path(ctx: CoverageContext, *, extra_paths: tuple[Path, ...] = ()) -> str:+ """Build the runtime library search path used by test binaries."""+ paths: list[Path] = []+ candidates = [+ ctx.paths.bin_dir,+ ctx.paths.install_pkg_dir / "runtime" / "lib" / "intel64",+ ctx.paths.install_pkg_dir / "runtime" / "3rdparty" / "tbb" / "lib",+ *extra_paths,+ ]+ for candidate in candidates:+ if candidate.exists() and candidate not in paths:+ paths.append(candidate)++ tbb_dirs = sorted({p.parent for p in ctx.paths.install_pkg_dir.rglob("libtbb.so*") if p.is_file()})+ for tbb_dir in tbb_dirs:+ if tbb_dir not in paths:+ paths.append(tbb_dir)++ return ":".join(str(path) for path in paths)+++def _selected_test_names(env_name: str) -> list[str]:+ """Read the optional test selection list for one suite."""+ raw = os.environ.get(env_name, "").strip()+ if not raw:+ return []+ return [name.strip() for name in raw.split(",") if name.strip()]+++def _filter_selected_tests(tests: list[object], selected_names: list[str], *, suite_label: str) -> list[object]:+ """Filter configured tests by requested names and warn on unknown entries."""+ if not selected_names:+ return tests++ selected_set = set(selected_names)+ known_names = {getattr(test, "name") for test in tests}+ missing_names = [name for name in selected_names if name not in known_names]+ if missing_names:+ LOGGER.warning("Requested %s tests were not found in config: %s", suite_label, ", ".join(missing_names))+ return [test for test in tests if getattr(test, "name") in selected_set]+++def _timed_run(+ title: str,+ cmd: list[str],+ *,+ cwd: Path | None = None,+ env: dict[str, str] | None = None,+) -> tuple[int, float]:+ """Run one command and return its exit code and duration."""+ LOGGER.info("========== Running %s ==========", title)+ started_at = time.monotonic()+ rc = run_cmd(cmd, cwd=cwd, env=env, check=False)+ return rc, time.monotonic() - started_at+++def _write_duration_report(ctx: CoverageContext, suite: _SuiteSpec, results: list[_TestRunResult]) -> None:+ """Write per-test durations for one suite."""+ report_path = ctx.workspace / suite.duration_file+ with report_path.open("w", encoding="utf-8", newline="") as handle:+ writer = csv.writer(handle)+ writer.writerow(["test_name", "status", "duration_seconds", "duration_minutes"])+ for result in results:+ writer.writerow(+ [+ result.name,+ result.status,+ f"{result.duration_seconds:.3f}",+ f"{result.duration_seconds / 60.0:.3f}",+ ]+ )++ ctx.io.export_env(suite.duration_env_key, str(report_path))+ if suite.duration_total_env_key:+ total_duration = sum(result.duration_seconds for result in results)+ ctx.io.export_env(suite.duration_total_env_key, f"{total_duration:.3f}")+++def _write_stats_report(+ ctx: CoverageContext,+ suite: _SuiteSpec,+ *,+ total: int,+ executed: int,+ passed: int,+ failed: int,+ skipped: int,+ not_run: int = 0,+) -> None:+ """Write aggregate suite counters and export them to the workflow env."""+ values = {+ suite.total_key: total,+ suite.passed_key: passed,+ suite.failed_key: failed,+ suite.skipped_key: skipped,+ suite.not_run_key: not_run,+ }+ if suite.executed_key:+ values[suite.executed_key] = executed++ for key, value in values.items():+ ctx.io.export_env(key, str(value))++ lines = [f"{key}={value}" for key, value in values.items()]+ (ctx.workspace / suite.stats_file).write_text("\n".join(lines) + "\n", encoding="utf-8")+++def _append_summary(+ ctx: CoverageContext,+ suite: _SuiteSpec,+ *,+ selected_names: list[str],+ executed: int,+ passed: int,+ failed: list[str],+ skipped: list[str],+ extra_lines: list[str] | None = None,+) -> None:+ """Append a human-readable step summary for one suite."""+ lines = [f"## {suite.label} coverage test execution summary", ""]+ if extra_lines:+ lines.extend(extra_lines)+ lines.extend(+ [+ f"{suite.label} test selection: {', '.join(selected_names) if selected_names else 'all enabled tests'}",+ f"{suite.label} tests executed: {executed}",+ f"{suite.label} tests passed: {passed}",+ f"{suite.label} tests failed: {len(failed)}",+ f"{suite.label} tests skipped: {len(skipped)}",+ "",+ ]+ )++ if failed:+ lines.append("Failed tests:")+ lines.extend(f"- {item}" for item in failed)+ else:+ lines.append("Failed tests: none")++ lines.append("")++ if skipped:+ lines.append("Skipped tests:")+ lines.extend(f"- {item}" for item in skipped)+ else:+ lines.append("Skipped tests: none")++ ctx.io.append_summary("\n".join(lines) + "\n")+++def _finalize_suite(+ ctx: CoverageContext,+ suite: _SuiteSpec,+ *,+ selected_names: list[str],+ results: list[_TestRunResult],+ extra_lines: list[str] | None = None,+ no_execution_warning: str | None = None,+ failure_warning: str | None = None,+) -> None:+ """Write reports, export counters, and append summary for one suite."""+ executed = [result for result in results if result.status != "skipped"]+ failed = [result.detail for result in results if result.status == "failed" and result.detail]+ skipped = [result.detail for result in results if result.status == "skipped" and result.detail]+ passed = [result for result in results if result.status == "passed"]++ _write_duration_report(ctx, suite, results)+ _write_stats_report(+ ctx,+ suite,+ total=len(results),+ executed=len(executed),+ passed=len(passed),+ failed=len(failed),+ skipped=len(skipped),+ not_run=0,+ )+ _append_summary(+ ctx,+ suite,+ selected_names=selected_names,+ executed=len(executed),+ passed=len(passed),+ failed=failed,+ skipped=skipped,+ extra_lines=extra_lines,+ )++ if no_execution_warning and not executed:+ LOGGER.warning("%s", no_execution_warning)+ if failure_warning and failed:+ LOGGER.warning("%s", failure_warning)+++def _pycov_config(+ *,+ branch_coverage: bool,+ runtime_source_dir: Path,+ repo_source_dir: Path,+ workspace: Path,+ installed_dirs: tuple[Path, ...] = (),+) -> str:+ """Build the coverage.py config used by pytest-cov and coverage CLI."""+ branch_line = "branch = True\n" if branch_coverage else ""+ try:+ source_value = runtime_source_dir.relative_to(workspace).as_posix()+ except ValueError:+ source_value = runtime_source_dir.as_posix()++ path_entries: list[str] = []+ for path in (repo_source_dir, runtime_source_dir, *installed_dirs):+ try:+ value = path.relative_to(workspace).as_posix()+ except ValueError:+ value = path.as_posix()+ if value not in path_entries:+ path_entries.append(value)+ path_entries_text = "\n ".join(path_entries)+ return f"""[run]+source =+ {source_value}+{branch_line}omit =+ */tests/*+ */thirdparty/*+ */docs/*+ */samples/*+ */tools/*+ */src/bindings/js/node/tests/*+ */src/bindings/python/tests/*+ *.pb.cc+ *.pb.h++[paths]+openvino =+ {path_entries_text}+"""+++def _expand(value: str) -> str:+ """Expand environment variables in a config value."""+ return os.path.expandvars(value)+++def _remove_gcda(root: Path) -> None:+ """Delete stale gcda files before a fresh coverage run."""+ if not root.exists():+ return+ for gcda in root.rglob("*.gcda"):+ try:+ gcda.unlink()+ except OSError:+ pass+++def _python_pytest_command(target: str, args: str, *, py_cov_source: str, py_cov_config: Path) -> list[str]:+ """Build one pytest command with shared Python coverage arguments."""+ cmd = ["python3", "-m", "pytest", "-ra", "--durations=50", target]+ if args:+ cmd.extend(shlex.split(args))+ cmd.extend(+ [+ f"--cov={py_cov_source}",+ f"--cov-config={py_cov_config}",+ "--cov-append",+ ]+ )+ return cmd+++def _detect_installed_python_package_dir(package: str) -> Path | None:+ """Resolve the installed package directory used by the active Python interpreter."""+ cmd = [+ "python3",+ "-c",+ (+ "import importlib, pathlib; "+ f"module = importlib.import_module({package!r}); "+ "print(pathlib.Path(module.__file__).resolve().parent)"+ ),+ ]+ display = " ".join(shlex.quote(part) for part in cmd)+ LOGGER.info("$ %s", display)+ completed = subprocess.run(cmd, text=True, capture_output=True)+ if completed.returncode != 0:+ details = completed.stderr.strip() or completed.stdout.strip() or f"exit {completed.returncode}"+ LOGGER.warning("Could not resolve installed Python package dir for %s: %s", package, details)+ return None++ resolved_text = completed.stdout.strip().splitlines()+ if not resolved_text:+ LOGGER.warning("Could not resolve installed Python package dir for %s: empty output", package)+ return None++ package_dir = Path(resolved_text[-1].strip())+ if not package_dir.is_dir():+ LOGGER.warning("Resolved Python package dir for %s is not a directory: %s", package, package_dir)+ return None+ return package_dir+++def _coverage_data_files(workspace: Path) -> list[Path]:+ """Return coverage data files produced by pytest-cov / coverage.py."""+ return sorted(+ path+ for path in workspace.iterdir()+ if path.is_file() and (path.name == ".coverage" or path.name.startswith(".coverage."))+ )+++def _run_logged_command(+ cmd: list[str],+ *,+ log_path: Path,+ cwd: Path | None = None,+ env: dict[str, str] | None = None,+) -> int:+ """Run one command, store stdout/stderr in a log file, and return its exit code."""+ display = " ".join(shlex.quote(part) for part in cmd)+ LOGGER.info("$ %s", display)+ completed = subprocess.run(cmd, cwd=cwd, env=env, text=True, capture_output=True)++ log_path.parent.mkdir(parents=True, exist_ok=True)+ sections = [f"$ {display}", f"exit_code={completed.returncode}"]+ if completed.stdout:+ sections.extend(["", "stdout:", completed.stdout.rstrip()])+ if completed.stderr:+ sections.extend(["", "stderr:", completed.stderr.rstrip()])+ log_path.write_text("\n".join(sections).rstrip() + "\n", encoding="utf-8")+ return completed.returncode+++def _normalize_python_xml_filename(raw_path: str, *, repo_source_dir: Path, installed_dirs: tuple[Path, ...]) -> str:+ """Map coverage.py XML filenames back to repo-relative Python source paths."""+ raw = raw_path.strip()+ if not raw:+ return raw++ path = Path(raw)+ if not path.is_absolute():+ stripped = raw.removeprefix("./")+ if stripped.startswith("openvino/"):+ stripped = stripped[len("openvino/") :]+ return Path(stripped).as_posix()++ try:+ resolved = path.resolve(strict=False)+ except OSError:+ resolved = path++ for root in (repo_source_dir, *installed_dirs):+ try:+ return resolved.relative_to(root).as_posix()+ except ValueError:+ continue++ parts = resolved.parts+ for marker in ("site-packages", "dist-packages"):+ if marker not in parts:+ continue+ idx = parts.index(marker)+ tail = parts[idx + 1 :]+ if tail and tail[0] == "openvino":+ return Path(*tail[1:]).as_posix()++ if "openvino" in parts:+ openvino_indexes = [idx for idx, part in enumerate(parts) if part == "openvino"]+ for idx in reversed(openvino_indexes):+ tail = parts[idx + 1 :]+ if tail:+ return Path(*tail).as_posix()++ return raw+++def _rewrite_python_coverage_xml(*, xml_path: Path, workspace: Path, repo_source_dir: Path, installed_dirs: tuple[Path, ...]) -> None:+ """Rewrite Python XML coverage paths to the repo source layout expected by Codecov."""+ if not xml_path.is_file():+ return++ tree = ET.parse(xml_path)+ root = tree.getroot()++ try:+ source_value = repo_source_dir.relative_to(workspace).as_posix()+ except ValueError:+ source_value = repo_source_dir.as_posix()++ sources = root.find("sources")+ if sources is not None:+ for source in sources.findall("source"):+ source.text = source_value++ for cls in root.findall(".//class"):+ filename = cls.attrib.get("filename", "")+ cls.attrib["filename"] = _normalize_python_xml_filename(+ filename,+ repo_source_dir=repo_source_dir,+ installed_dirs=installed_dirs,+ )++ tree.write(xml_path, encoding="utf-8", xml_declaration=True)+++def _build_cpp_command(exe: Path, *, mode: str, args: str) -> list[str]:+ """Build the command line for one configured C++ test binary."""+ cmd = [str(exe)]+ if mode == "raw":+ if args:+ cmd.extend(shlex.split(args))+ return cmd++ if args:+ cmd.append(f"--gtest_filter={args}")+ return cmd+++def _run_cpp_test(+ ctx: CoverageContext,+ test: CppTestCase,+ args: str,+ *,+ runtime_ld_library_path: str,+) -> _TestRunResult:+ """Run one configured C++ test binary."""+ exe = ctx.paths.bin_dir / test.binary+ if not exe.exists():+ return _TestRunResult(test.name, "skipped", f"{test.name} (missing binary: {test.binary})")++ if not os.access(exe, os.X_OK):+ try:+ exe.chmod(exe.stat().st_mode | 0o111)+ except OSError:+ pass++ if not os.access(exe, os.X_OK):+ return _TestRunResult(test.name, "skipped", f"{test.name} (binary not executable: {test.binary})")++ env = env_from_assignments(test.extra_env)+ existing_ld = env.get("LD_LIBRARY_PATH", "")+ if runtime_ld_library_path:+ env["LD_LIBRARY_PATH"] = f"{runtime_ld_library_path}:{existing_ld}" if existing_ld else runtime_ld_library_path++ rc, duration_seconds = _timed_run(+ f"C++ test: {test.name}",+ _build_cpp_command(exe, mode=test.mode, args=args),+ env=env,+ )+ if rc != 0:+ return _TestRunResult(test.name, "failed", f"{test.name} (exit {rc})", duration_seconds)+ return _TestRunResult(test.name, "passed", duration_seconds=duration_seconds)+++def _run_cpp_tests_serial(+ ctx: CoverageContext,+ tests: list[tuple[CppTestCase, str]],+ *,+ runtime_ld_library_path: str,+) -> list[_TestRunResult]:+ """Run selected C++ tests one after another."""+ return [+ _run_cpp_test(+ ctx,+ test,+ args,+ runtime_ld_library_path=runtime_ld_library_path,+ )+ for test, args in tests+ ]+++def _normalize_js_source_path(raw_path: str, *, workspace: Path) -> Path | None:+ """Normalize a JS LCOV source path to a repo-relative path."""+ raw = raw_path.strip()+ if not raw:+ return None++ candidates: list[Path] = []+ path = Path(raw)+ if path.is_absolute():+ candidates.append(path)+ parts = path.parts[1:] if path.parts and path.parts[0] == path.anchor else path.parts+ for start in range(len(parts)):+ suffix = parts[start:]+ if suffix:+ candidates.append(workspace.joinpath(*suffix))+ else:+ stripped = raw.removeprefix("./")+ if stripped:+ candidates.append(workspace / stripped)+ repo_prefix = f"{workspace.name}/"+ if stripped.startswith(repo_prefix):+ candidates.append(workspace / stripped[len(repo_prefix) :])+ rel_parts = Path(stripped).parts+ for start in range(len(rel_parts)):+ suffix = rel_parts[start:]+ if suffix:+ candidates.append(workspace.joinpath(*suffix))++ seen: set[str] = set()+ for candidate in candidates:+ try:+ resolved = candidate.resolve(strict=False)+ except OSError:+ resolved = candidate+ key = str(resolved)+ if key in seen:+ continue+ seen.add(key)+ if resolved.exists() and resolved.is_file():+ try:+ return resolved.relative_to(workspace)+ except ValueError:+ continue+ return None+++def _copy_js_lcov(*, source: Path, target: Path, workspace: Path, branch_coverage: bool) -> None:+ """Copy JS LCOV output and optionally strip branch records."""+ output_lines: list[str] = []+ for line in source.read_text(encoding="utf-8", errors="replace").splitlines():+ if not branch_coverage and line.startswith(("BRDA:", "BRF:", "BRH:")):+ continue+ if line.startswith("SF:"):+ normalized = _normalize_js_source_path(line[3:].strip(), workspace=workspace)+ if normalized is not None:+ line = f"SF:{normalized.as_posix()}"+ output_lines.append(line)+ target.write_text("\n".join(output_lines) + "\n", encoding="utf-8")+++def run_cpp(ctx: CoverageContext) -> None:+ """Execute configured C++ tests and record execution statistics."""+ config = CONFIG_DIR / "tests_cpp.yml"+ selected_names = _selected_test_names(CPP_SUITE.selection_env)+ tests = _filter_selected_tests(load_cpp_tests(config, ctx.test_profile), selected_names, suite_label=CPP_SUITE.label)++ _remove_gcda(ctx.paths.build_dir)+ _remove_gcda(ctx.paths.build_js_dir)+ shutil.rmtree(ctx.paths.build_dir / "gcov", ignore_errors=True)++ results_by_name: dict[str, _TestRunResult] = {}+ enabled_tests: list[tuple[CppTestCase, str]] = []+ for test in tests:+ if not test.enabled:+ results_by_name[test.name] = _TestRunResult(test.name, "skipped", f"{test.name} ({test.skip_reason})")+ continue+ enabled_tests.append((test, test.args.replace("__MODEL_PATH__", str(ctx.paths.model_path))))++ if enabled_tests:+ runtime_ld_library_path = _runtime_ld_library_path(ctx)+ for result in _run_cpp_tests_serial(ctx, enabled_tests, runtime_ld_library_path=runtime_ld_library_path):+ results_by_name[result.name] = result++ results = [results_by_name[test.name] for test in tests if test.name in results_by_name]++ _finalize_suite(+ ctx,+ CPP_SUITE,+ selected_names=selected_names,+ results=results,+ extra_lines=[+ f"Test profile: {ctx.test_profile}",+ f"GPU mode: {'true' if ctx.run_gpu_tests else 'false'}",+ f"NPU mode: {'true' if ctx.run_npu_tests else 'false'}",+ "",+ ],+ no_execution_warning=(+ f"No C++ tests were executed (all skipped). Check restored binaries under: {ctx.paths.bin_dir}"+ if results+ else None+ ),+ failure_warning="One or more C++ tests failed; continuing to coverage generation.",+ )+++def run_python(ctx: CoverageContext) -> None:+ """Execute configured Python tests and export coverage results."""+ config = CONFIG_DIR / "tests_python.yml"+ selected_names = _selected_test_names(PYTHON_SUITE.selection_env)+ tests = _filter_selected_tests(load_python_tests(config, ctx.test_profile), selected_names, suite_label=PYTHON_SUITE.label)++ results: list[_TestRunResult] = []+ if not any(test.enabled for test in tests):+ for test in tests:+ if not test.enabled:+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} ({test.skip_reason})"))+ _finalize_suite(+ ctx,+ PYTHON_SUITE,+ selected_names=selected_names,+ results=results,+ no_execution_warning=f"No Python tests are enabled for TEST_PROFILE={ctx.test_profile}; skipping Python suite.",+ )+ return++ tests_dir = ctx.paths.install_pkg_dir / "tests"+ py_source_root = ctx.workspace / "src" / "bindings" / "python" / "src"+ py_source_dir = py_source_root / "openvino"+ src_py_tests = ctx.workspace / "src" / "bindings" / "python" / "tests"+ onnx_py_tests = ctx.workspace / "src" / "frontends" / "onnx" / "tests" / "tests_python"+ layer_tests = ctx.workspace / "tests" / "layer_tests"+ py_cov_config = ctx.workspace / ".python_coverage_ci.rc"+ python_coverage_debug_dir = ctx.workspace / ".tmp" / "python-coverage"++ pip_install_path = os.environ.get("PIP_INSTALL_PATH", "").strip()+ installed_openvino_dir = _detect_installed_python_package_dir("openvino")+ if installed_openvino_dir is None and pip_install_path:+ fallback_dir = Path(pip_install_path) / "openvino"+ if fallback_dir.is_dir():+ installed_openvino_dir = fallback_dir++ py_cov_source_dir = installed_openvino_dir if installed_openvino_dir is not None else py_source_dir+ py_cov_source = str(py_cov_source_dir)+ wheel_lib_dir = Path(pip_install_path) / "openvino" / "libs" if pip_install_path else None+ runtime_extra_paths = [tests_dir]+ if wheel_lib_dir is not None:+ runtime_extra_paths.append(wheel_lib_dir)++ os.environ["LD_LIBRARY_PATH"] = (+ f"{_runtime_ld_library_path(ctx, extra_paths=tuple(runtime_extra_paths))}:{os.environ.get('LD_LIBRARY_PATH', '')}"+ ).rstrip(":")+ python_path_entries = [+ str(tests_dir),+ str(tests_dir / "python"),+ os.environ.get("PYTHONPATH", ""),+ ]+ os.environ["PYTHONPATH"] = ":".join(entry for entry in python_path_entries if entry).rstrip(":")+ os.environ["PYTHONSAFEPATH"] = "1"+ os.environ["TESTS_DIR"] = str(tests_dir)+ os.environ["SRC_PY_TESTS_DIR"] = str(src_py_tests)+ os.environ["ONNX_PY_TESTS_DIR"] = str(onnx_py_tests)+ os.environ["WORKSPACE_LAYER_TESTS_DIR"] = str(layer_tests)+ os.environ["PY_COV_CONFIG"] = str(py_cov_config)++ py_cov_config.write_text(+ _pycov_config(+ branch_coverage=ctx.branch_coverage,+ runtime_source_dir=py_cov_source_dir,+ repo_source_dir=py_source_dir,+ workspace=ctx.workspace,+ installed_dirs=tuple(path for path in (installed_openvino_dir,) if path is not None),+ ),+ encoding="utf-8",+ )+ os.environ["COVERAGE_RCFILE"] = str(py_cov_config)+ run_cmd(["python3", "-m", "coverage", "erase"])++ for test in tests:+ if not test.enabled:+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} ({test.skip_reason})"))+ continue++ target = _expand(test.target)+ args = _expand(test.args)+ command = _expand(test.command)+ env = env_from_assignments(_expand(test.env))++ if test.kind == "pytest":+ cmd = _python_pytest_command(target, args, py_cov_source=py_cov_source, py_cov_config=py_cov_config)+ rc, duration_seconds = _timed_run(f"Python test: {test.name}", cmd, env=env)+ elif test.kind == "pytest_if_dir":+ if not Path(target).is_dir():+ LOGGER.warning("Skipping Python test group '%s' (missing: %s)", test.name, target)+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} (missing path)"))+ continue+ cmd = _python_pytest_command(target, args, py_cov_source=py_cov_source, py_cov_config=py_cov_config)+ rc, duration_seconds = _timed_run(f"Python test: {test.name}", cmd, env=env)+ elif test.kind == "command":+ rc, duration_seconds = _timed_run(+ f"Python test: {test.name}",+ ["bash", "-lc", command],+ env=env,+ )+ else:+ LOGGER.warning("Unknown Python test kind '%s' for '%s', skipping", test.kind, test.name)+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} (unknown kind: {test.kind})"))+ continue++ if rc != 0:+ results.append(_TestRunResult(test.name, "failed", f"{test.name} (exit {rc})", duration_seconds))+ else:+ results.append(_TestRunResult(test.name, "passed", duration_seconds=duration_seconds))++ coverage_data_files = _coverage_data_files(ctx.workspace)+ if not coverage_data_files:+ raise RuntimeError("Python coverage data files were not produced; cannot export python-coverage.xml")++ primary_coverage_file = ctx.workspace / ".coverage"+ if len(coverage_data_files) > 1 or not primary_coverage_file.is_file():+ combine_log = python_coverage_debug_dir / "coverage-combine.log"+ combine_rc = _run_logged_command(+ ["python3", "-m", "coverage", "combine", "--keep"],+ log_path=combine_log,+ cwd=ctx.workspace,+ )+ if combine_rc != 0:+ raise RuntimeError(+ f"Failed to combine Python coverage data. See {combine_log}"+ )++ xml_path = ctx.workspace / "python-coverage.xml"+ xml_log = python_coverage_debug_dir / "coverage-xml.log"+ xml_rc = _run_logged_command(+ ["python3", "-m", "coverage", "xml", "-i", "-o", str(xml_path)],+ log_path=xml_log,+ cwd=ctx.workspace,+ )+ if xml_rc != 0 or not xml_path.is_file() or xml_path.stat().st_size == 0:+ debug_log = python_coverage_debug_dir / "coverage-debug-data.log"+ _run_logged_command(+ ["python3", "-m", "coverage", "debug", "data"],+ log_path=debug_log,+ cwd=ctx.workspace,+ )+ raise RuntimeError(+ "Failed to export python-coverage.xml; "+ f"see {xml_log} and {debug_log}"+ )++ installed_dirs = tuple(path for path in (installed_openvino_dir,) if path is not None)+ _rewrite_python_coverage_xml(+ xml_path=xml_path,+ workspace=ctx.workspace,+ repo_source_dir=py_source_dir,+ installed_dirs=installed_dirs,+ )++ _finalize_suite(+ ctx,+ PYTHON_SUITE,+ selected_names=selected_names,+ results=results,+ failure_warning="One or more Python tests failed; continuing to coverage generation.",+ )+++def run_js(ctx: CoverageContext) -> None:+ """Execute configured JS tests and export coverage results."""+ if shutil.which("node") is None or shutil.which("npm") is None:+ raise RuntimeError("Node.js/npm are not available in the coverage runtime environment.")++ config = CONFIG_DIR / "tests_js.yml"+ selected_names = _selected_test_names(JS_SUITE.selection_env)+ tests = _filter_selected_tests(load_js_tests(config, ctx.test_profile), selected_names, suite_label=JS_SUITE.label)++ results: list[_TestRunResult] = []+ if not any(test.enabled for test in tests):+ for test in tests:+ if not test.enabled:+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} ({test.skip_reason})"))+ _finalize_suite(+ ctx,+ JS_SUITE,+ selected_names=selected_names,+ results=results,+ no_execution_warning=f"No JS tests are enabled for TEST_PROFILE={ctx.test_profile}; skipping JS suite.",+ )+ return++ os.environ["OV_WORKSPACE"] = str(ctx.workspace)+ os.environ["LD_LIBRARY_PATH"] = (+ f"{_runtime_ld_library_path(ctx, extra_paths=(ctx.paths.js_dir / 'bin',))}:{os.environ.get('LD_LIBRARY_PATH', '')}"+ ).rstrip(":")++ for test in tests:+ if not test.enabled:+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} ({test.skip_reason})"))+ continue+ if test.kind != "command":+ results.append(_TestRunResult(test.name, "skipped", f"{test.name} (unknown kind: {test.kind})"))+ continue++ rc, duration_seconds = _timed_run(+ f"JS test: {test.name}",+ ["bash", "-lc", _expand(test.command)],+ cwd=ctx.paths.js_dir,+ )+ if rc != 0:+ results.append(_TestRunResult(test.name, "failed", f"{test.name} (exit {rc})", duration_seconds))+ else:+ results.append(_TestRunResult(test.name, "passed", duration_seconds=duration_seconds))++ source = ctx.workspace / "js-coverage" / "lcov.info"+ target = ctx.workspace / "js-lcov.info"+ if source.exists():+ _copy_js_lcov(source=source, target=target, workspace=ctx.workspace, branch_coverage=ctx.branch_coverage)++ _finalize_suite(+ ctx,+ JS_SUITE,+ selected_names=selected_names,+ results=results,+ failure_warning="One or more JS tests failed; continuing to coverage generation.",+ )diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.ymlindex e73d5605329..915dce47eb8 100644--- a/.github/workflows/coverage.yml+++ b/.github/workflows/coverage.yml@@ -1,5 +1,7 @@name: Code coverage-on: workflow_dispatch++on:+ workflow_dispatch:concurrency:group: ${{ github.workflow }}-${{ github.ref }}@@ -7,181 +9,559 @@ concurrency:permissions: read-all+env:+ PIP_CACHE_PATH: /mount/caches/pip/linux+ TEST_PROFILE: cpu+ ENABLE_BRANCH_COVERAGE: 'false'+ LCOV_CAPTURE_TIMEOUT_SECONDS: '3600'+ NODE_VERSION: '21'+ NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/IntelProxyRootCA-Base64.crt+jobs:- Coverage:- runs-on: ${{ matrix.config.os }}- env:- CMAKE_BUILD_TYPE: 'Release'- strategy:- fail-fast: false- matrix:- config:- - { name: "Ubuntu-gcc", os: ubuntu-latest-16-cores, cc: "gcc", cxx: "g++" }+ Docker:+ runs-on: aks-linux-4-cores-16gb-docker-build+ container:+ image: openvinogithubactions.azurecr.io/docker_build:0.2+ volumes:+ - /mount:/mount+ outputs:+ images: ${{ steps.handle_docker.outputs.images }}+ steps:+ - name: Checkout+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries+ timeout-minutes: 15++ - uses: ./.github/actions/handle_docker+ id: handle_docker+ with:+ images: |+ ov_build/ubuntu_22_04_x64+ ov_test/ubuntu_22_04_x64+ registry: 'openvinogithubactions.azurecr.io'+ dockerfiles_root_dir: '.github/dockerfiles'+ changed_components: '{"docker_env":false,"dockerfiles":false}'++ Build:+ name: Build coverage artifacts+ needs: Docker+ uses: ./.github/workflows/job_build_linux.yml+ with:+ runner: 'aks-linux-16-cores-32gb'+ image: ${{ fromJSON(needs.Docker.outputs.images).ov_build.ubuntu_22_04_x64 }}+ affected-components: '{"JS_API":true}'+ event-name: ${{ github.event_name }}+ os: 'ubuntu_22_04'+ build-js: true+ build-additional-python-packages: false+ build-debian-packages: false+ upload-coverage-notes: true+ cmake-options: >-+ -G 'Ninja Multi-Config'+ -DENABLE_NCC_STYLE=OFF+ -DENABLE_TESTS=ON+ -DENABLE_FUNCTIONAL_TESTS=ON+ -DENABLE_STRICT_DEPENDENCIES=OFF+ -DENABLE_SYSTEM_OPENCL=ON+ -DCMAKE_VERBOSE_MAKEFILE=ON+ -DCPACK_GENERATOR=TGZ+ -DENABLE_WHEEL=ON+ -DENABLE_PYTHON=ON+ -DENABLE_JS=ON+ -DENABLE_COVERAGE=ON+ -DENABLE_OV_ONNX_FRONTEND=ON+ -DENABLE_OV_PADDLE_FRONTEND=ON+ -DENABLE_OV_PYTORCH_FRONTEND=ON+ -DENABLE_OV_TF_FRONTEND=ON+ -DENABLE_OV_TF_LITE_FRONTEND=ON+ -DENABLE_INTEL_GPU=OFF+ -DENABLE_INTEL_NPU=OFF+ -DENABLE_ONEDNN_FOR_GPU=OFF+ CoverageCpp:+ name: Coverage C+++ needs: [Docker, Build]+ runs-on: aks-linux-8-cores-32gb+ container:+ image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}+ volumes:+ - /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro+ - /mount:/mount+ - ${{ github.workspace }}:${{ github.workspace }}+ defaults:+ run:+ shell: bash+ working-directory: ${{ github.workspace }}+ env:+ OV_WORKSPACE: ${{ github.workspace }}+ INSTALL_DIR: ${{ github.workspace }}/install+ INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests+ INSTALL_PKG_DIR: ${{ github.workspace }}/install+ BIN_DIR: ${{ github.workspace }}/install/tests+ BUILD_DIR: ${{ github.workspace }}/openvino/openvino_build+ BUILD_JS_DIR: ${{ github.workspace }}/openvino/openvino_build_js+ COVERAGE_WRITE_STEP_SUMMARY: 'false'steps:- - name: Setup python- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0+ - name: Checkout sources+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries+ timeout-minutes: 15+ with:+ submodules: 'true'++ - name: Download OpenVINO package+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_package+ path: ${{ env.INSTALL_DIR }}++ - name: Download OpenVINO tests+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0with:- python-version: '3.10.10'- architecture: 'x64'+ name: openvino_tests+ path: ${{ env.INSTALL_DIR }}++ - name: Download coverage build notes+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: coverage_build_notes+ path: ${{ github.workspace }}/coverage_notes++ - name: Extract OpenVINO packages+ run: |+ pigz -dc openvino_package.tar.gz | tar -xf - -C "${INSTALL_DIR}"+ pigz -dc openvino_tests.tar.gz | tar -xf - -C "${INSTALL_DIR}"+ working-directory: ${{ env.INSTALL_DIR }}++ - name: Restore coverage notes+ run: |+ set -euo pipefail+ notes_root="${{ github.workspace }}/coverage_notes"+ if [[ -d "${notes_root}/coverage_build_notes" ]]; then+ notes_root="${notes_root}/coverage_build_notes"+ fi+ rm -rf "${BUILD_DIR}" "${BUILD_JS_DIR}"+ mkdir -p "${BUILD_DIR}" "${BUILD_JS_DIR}"+ cp -a "${notes_root}/main-build/." "${BUILD_DIR}/"+ if [[ -d "${notes_root}/js-build" ]]; then+ cp -a "${notes_root}/js-build/." "${BUILD_JS_DIR}/"+ fi++ - name: Setup Python 3.11+ uses: ./.github/actions/setup_python+ with:+ version: '3.11'+ pip-cache-path: ${{ env.PIP_CACHE_PATH }}+ should-setup-pip-paths: 'true'+ self-hosted-runner: 'true'++ - name: Install coverage Python dependencies+ run: python3 -m pip install -r .github/scripts/coverage/requirements-ci.txt++ - name: Run CPU C++ coverage tests+ run: python3 .github/scripts/coverage/coverage.py step run-cpp-tests++ - name: Generate CPU native C/C++ coverage report+ run: python3 .github/scripts/coverage/coverage.py step collect-cpp-coverage++ - name: Collect C++ CPU results+ id: cpu_artifact+ if: ${{ always() }}+ run: |+ dir="${RUNNER_TEMP}/coverage-cpp-cpu"+ python3 .github/scripts/coverage/ci_reports.py collect-suite-results \+ --workspace "${{ env.OV_WORKSPACE }}" \+ --suite cpp \+ --profile cpu \+ --lane cpu \+ --artifact-name coverage-cpp-cpu \+ --artifact-dir "${dir}"+ echo "dir=${dir}" >> "$GITHUB_OUTPUT"+ - name: Upload Codecov (C++ runtime, CPU)+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2+ with:+ files: ${{ env.OV_WORKSPACE }}/coverage.info+ disable_search: true+ plugins: noop+ flags: cpp-runtime-cpp-cpu+ override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}+ override_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}+ fail_ci_if_error: true+ verbose: true- - name: Setup ccache- uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2.20+ - name: Upload C++ CPU artifact+ if: ${{ always() }}+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0with:- max-size: 50G+ name: coverage-cpp-cpu+ path: ${{ steps.cpu_artifact.outputs.dir }}+ if-no-files-found: warn+ retention-days: 14+ compression-level: 0+ overwrite: true- - name: Clone OpenVINO+ CoveragePython:+ name: Coverage Python+ needs: [Docker, Build]+ runs-on: aks-linux-4-cores-16gb+ container:+ image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}+ volumes:+ - /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro+ - /mount:/mount+ - ${{ github.workspace }}:${{ github.workspace }}+ defaults:+ run:+ shell: bash+ working-directory: ${{ github.workspace }}+ env:+ OV_WORKSPACE: ${{ github.workspace }}+ INSTALL_DIR: ${{ github.workspace }}/install+ INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests+ INSTALL_PKG_DIR: ${{ github.workspace }}/install+ BUILD_DIR: ${{ github.workspace }}/openvino/openvino_build+ BUILD_JS_DIR: ${{ github.workspace }}/openvino/openvino_build_js+ COVERAGE_WRITE_STEP_SUMMARY: 'false'+ steps:+ - name: Checkout sourcesuses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retriestimeout-minutes: 15with:submodules: 'true'- - name: Install dependencies- run: |- sudo apt --assume-yes update- sudo -E ${{ github.workspace }}/install_build_dependencies.sh- sudo apt --assume-yes install lcov-- python3 -m pip install --upgrade pip- python3 -m pip install -r ${{ github.workspace }}/src/bindings/python/wheel/requirements-dev.txt- # For running Paddle frontend unit tests- python3 -m pip install -r ${{ github.workspace }}/src/frontends/paddle/tests/requirements.txt- # For running ONNX frontend unit tests- python3 -m pip install -r ${{ github.workspace }}/src/frontends/onnx/tests/requirements.txt- # For running TensorFlow frontend unit tests- python3 -m pip install -r ${{ github.workspace }}/src/frontends/tensorflow/tests/requirements.txt-- - name: Build OpenVINO with CMake- uses: ashutoshvarma/action-cmake-build@ade188313bc7eaa6f14349569a64d8bc716342ff # master- with:- build-dir: ${{ github.workspace }}/build- cc: ${{ matrix.config.cc }}- cxx: ${{ matrix.config.cxx }}- configure-options: >- -GNinja- -DCMAKE_VERBOSE_MAKEFILE=ON- -DENABLE_PYTHON=ON- -DENABLE_ONEDNN_FOR_GPU=ON- -DENABLE_TESTS=ON- -DENABLE_OV_ONNX_FRONTEND=ON- -DENABLE_STRICT_DEPENDENCIES=OFF- -DENABLE_COVERAGE=ON- -DCMAKE_C_COMPILER_LAUNCHER=ccache- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache- -DCMAKE_C_LINKER_LAUNCHER=ccache- -DCMAKE_CXX_LINKER_LAUNCHER=ccache- -DENABLE_SYSTEM_SNAPPY=ON- build-type: ${{ env.CMAKE_BUILD_TYPE }}-- - name: Install wheel packages- run: cmake -DCOMPONENT=python_wheels -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install_pkg -P '${{ github.workspace }}/build/cmake_install.cmake'-- - name: List binaries- run: ls -la ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}-- - name: Install OpenVINO- run: cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install_pkg -P '${{ github.workspace }}/build/cmake_install.cmake'-- - name: Run OV core unit tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_core_unit_tests- continue-on-error: true-- - name: Run OV Proxy plugin tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_proxy_plugin_tests- continue-on-error: true-- - name: Run OV Hetero Func tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_hetero_func_tests --gtest_filter="*smoke*" --gtest_filter=-"nightly*"- continue-on-error: true-- - name: Run IR frontend tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_ir_frontend_tests- continue-on-error: true-- - name: Run ONNX frontend tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_onnx_frontend_tests --gtest_filter=-*IE_GPU*- continue-on-error: true-- # - name: Run Paddle frontend unit tests- # run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_paddle_tests --gtest_filter=-*IE_GPU*- # continue-on-error: true-- - name: Run TensorFlow frontend unit tests- run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_tensorflow_frontend_tests --gtest_filter=-*IE_GPU*- continue-on-error: true-- - name: Print info+ - name: Download OpenVINO package+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_package+ path: ${{ env.INSTALL_DIR }}++ - name: Download OpenVINO tests+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_tests+ path: ${{ env.INSTALL_DIR }}++ - name: Download OpenVINO wheels+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_wheels+ path: ${{ env.INSTALL_DIR }}++ - name: Download coverage build notes+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: coverage_build_notes+ path: ${{ github.workspace }}/coverage_notes++ - name: Extract OpenVINO packagesrun: |- ls -laR- pwd+ pigz -dc openvino_package.tar.gz | tar -xf - -C "${INSTALL_DIR}"+ pigz -dc openvino_tests.tar.gz | tar -xf - -C "${INSTALL_DIR}"+ working-directory: ${{ env.INSTALL_DIR }}- - name: Generate raport+ - name: Restore coverage notesrun: |set -euo pipefail+ notes_root="${{ github.workspace }}/coverage_notes"+ if [[ -d "${notes_root}/coverage_build_notes" ]]; then+ notes_root="${notes_root}/coverage_build_notes"+ fi+ rm -rf "${BUILD_DIR}" "${BUILD_JS_DIR}"+ mkdir -p "${BUILD_DIR}" "${BUILD_JS_DIR}"+ cp -a "${notes_root}/main-build/." "${BUILD_DIR}/"+ if [[ -d "${notes_root}/js-build" ]]; then+ cp -a "${notes_root}/js-build/." "${BUILD_JS_DIR}/"+ fi++ - name: Setup Python 3.11+ uses: ./.github/actions/setup_python+ with:+ version: '3.11'+ pip-cache-path: ${{ env.PIP_CACHE_PATH }}+ should-setup-pip-paths: 'true'+ self-hosted-runner: 'true'- SRC_DIR="${{ github.workspace }}"- BUILD_DIR="${{ github.workspace }}/build"- REPORT_DIR="${{ github.workspace }}/coverage-report"-- echo "Capturing coverage from $BUILD_DIR (base=$SRC_DIR)..."- lcov --capture \- --directory "$BUILD_DIR" \- --base-directory "$SRC_DIR" \- --output-file coverage.info \- --no-external \- --rc geninfo_unexecuted_blocks=1 \- --ignore-errors mismatch,negative,unused-- echo "Applying exclude patterns (tests, thirdparty, protobuf generated)..."- lcov --remove coverage.info \- "${SRC_DIR}/*.pb.cc" \- "${SRC_DIR}/*.pb.h" \- "${SRC_DIR}/*/tests/*" \- "${SRC_DIR}/thirdparty/*" \- -o coverage.info-- mkdir -p "$REPORT_DIR"- genhtml coverage.info \- --output-directory "$REPORT_DIR" \- --prefix "$SRC_DIR" \- --synthesize-missing-- - name: Coverage summary+ - name: Install coverage Python dependencies+ run: python3 -m pip install -r .github/scripts/coverage/requirements-ci.txt++ - name: Install OpenVINO Python wheels+ uses: ./.github/actions/install_ov_wheels+ with:+ wheels-dir-path: ${{ env.INSTALL_DIR }}+ wheels-to-install: 'openvino'++ - name: Install Python test dependenciesrun: |- echo "## Code coverage (lcov)" >> "$GITHUB_STEP_SUMMARY"- if [ -f coverage.info ]; then- echo "" >> "$GITHUB_STEP_SUMMARY"- echo '```' >> "$GITHUB_STEP_SUMMARY"- lcov --summary coverage.info >> "$GITHUB_STEP_SUMMARY" || true- echo '```' >> "$GITHUB_STEP_SUMMARY"- else- echo "" >> "$GITHUB_STEP_SUMMARY"- echo "coverage.info not found (coverage generation likely failed earlier)." >> "$GITHUB_STEP_SUMMARY"- fi+ python3 -m pip install -r "${INSTALL_DIR}/tests/bindings/python/requirements_test.txt"+ python3 -m pip install -r "${INSTALL_DIR}/tests/python/preprocess/torchvision/requirements.txt"+ python3 -m pip install -r "${INSTALL_DIR}/tests/layer_tests/requirements.txt"+ python3 -m pip install -r "${INSTALL_DIR}/tests/requirements_onnx"+ python3 -m pip install -r "${INSTALL_DIR}/tests/requirements_jax"+ python3 -m pip install -r "${INSTALL_DIR}/tests/requirements_pytorch"+ python3 -m pip install -r "${INSTALL_DIR}/tests/requirements_tensorflow"- - name: Package coverage report+ - name: Run CPU Python coverage tests+ run: python3 .github/scripts/coverage/coverage.py step run-python-tests++ - name: Generate CPU native C/C++ coverage report+ run: python3 .github/scripts/coverage/coverage.py step collect-cpp-coverage++ - name: Collect Python CPU results+ id: cpu_artifact+ if: ${{ always() }}run: |- set -euo pipefail- if [ -d "${{ github.workspace }}/coverage-report" ] && [ -f coverage.info ]; then- tar -czf coverage-report.tgz coverage-report coverage.info- echo "" >> "$GITHUB_STEP_SUMMARY"- echo "Artifact: \`coverage-report.tgz\` (download from Actions → Artifacts, then extract and open \`coverage-report/index.html\`)." >> "$GITHUB_STEP_SUMMARY"- else- echo "" >> "$GITHUB_STEP_SUMMARY"- echo "coverage-report/ or coverage.info missing → skipping artifact packaging." >> "$GITHUB_STEP_SUMMARY"- fi+ dir="${RUNNER_TEMP}/coverage-python-cpu"+ python3 .github/scripts/coverage/ci_reports.py collect-suite-results \+ --workspace "${{ env.OV_WORKSPACE }}" \+ --suite python \+ --profile cpu \+ --lane cpu \+ --artifact-name coverage-python-cpu \+ --artifact-dir "${dir}"+ echo "dir=${dir}" >> "$GITHUB_OUTPUT"++ - name: Upload Codecov (Python API, CPU)+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2+ with:+ files: ${{ env.OV_WORKSPACE }}/python-coverage.xml+ disable_search: true+ plugins: noop+ flags: python-api-frontend-layer-ovc-cpu+ override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}+ override_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}+ fail_ci_if_error: true+ verbose: true- - name: Upload coverage artifact+ - name: Upload Codecov (C++ runtime, Python suite, CPU)+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2+ with:+ files: ${{ env.OV_WORKSPACE }}/coverage.info+ disable_search: true+ plugins: noop+ flags: cpp-runtime-python-cpu+ override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}+ override_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}+ fail_ci_if_error: true+ verbose: true++ - name: Upload Python CPU artifact+ if: ${{ always() }}uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0with:- name: coverage-report-${{ matrix.config.name }}- path: coverage-report.tgz+ name: coverage-python-cpu+ path: ${{ steps.cpu_artifact.outputs.dir }}if-no-files-found: warn- retention-days: 30+ retention-days: 14compression-level: 0+ overwrite: true++ CoverageJS:+ name: Coverage JS+ needs: [Docker, Build]+ runs-on: aks-linux-4-cores-16gb+ container:+ image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}+ volumes:+ - /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro+ - /mount:/mount+ - ${{ github.workspace }}:${{ github.workspace }}+ defaults:+ run:+ shell: bash+ working-directory: ${{ github.workspace }}+ env:+ OV_WORKSPACE: ${{ github.workspace }}+ INSTALL_DIR: ${{ github.workspace }}/install+ INSTALL_PKG_DIR: ${{ github.workspace }}/install+ OPENVINO_JS_DIR: ${{ github.workspace }}/src/bindings/js/node+ BUILD_DIR: ${{ github.workspace }}/openvino/openvino_build+ BUILD_JS_DIR: ${{ github.workspace }}/openvino/openvino_build_js+ COVERAGE_WRITE_STEP_SUMMARY: 'false'+ DISPLAY: ':99'+ steps:+ - name: Checkout sources+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries+ timeout-minutes: 15+ with:+ submodules: 'true'++ - name: Download OpenVINO package+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_package+ path: ${{ env.INSTALL_DIR }}++ - name: Download OpenVINO Node package+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: openvino_node_npm_package+ path: ${{ env.OPENVINO_JS_DIR }}+ merge-multiple: true++ - name: Download coverage build notes+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0+ with:+ name: coverage_build_notes+ path: ${{ github.workspace }}/coverage_notes++ - name: Extract OpenVINO package+ run: pigz -dc openvino_package.tar.gz | tar -xf - -C "${INSTALL_DIR}"+ working-directory: ${{ env.INSTALL_DIR }}++ - name: Extract OpenVINO Node package+ run: pigz -dc openvino_node_npm_package.tar.gz | tar -xf - -v+ working-directory: ${{ env.OPENVINO_JS_DIR }}++ - name: Setup Node ${{ env.NODE_VERSION }}+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0+ with:+ node-version: ${{ env.NODE_VERSION }}+ cache: npm+ cache-dependency-path: ${{ env.OPENVINO_JS_DIR }}/package-lock.json++ - name: Configure OpenVINO JS API+ working-directory: ${{ env.OPENVINO_JS_DIR }}+ run: npm i++ - name: Install JS coverage dependencies+ working-directory: ${{ env.OPENVINO_JS_DIR }}+ run: npm i --no-save c8++ - name: Setup Python 3.11+ uses: ./.github/actions/setup_python+ with:+ version: '3.11'+ pip-cache-path: ${{ env.PIP_CACHE_PATH }}+ should-setup-pip-paths: 'true'+ self-hosted-runner: 'true'++ - name: Install coverage Python dependencies+ run: python3 -m pip install -r .github/scripts/coverage/requirements-ci.txt++ - name: Restore coverage notes+ run: |+ set -euo pipefail+ notes_root="${{ github.workspace }}/coverage_notes"+ if [[ -d "${notes_root}/coverage_build_notes" ]]; then+ notes_root="${notes_root}/coverage_build_notes"+ fi+ rm -rf "${BUILD_DIR}" "${BUILD_JS_DIR}"+ mkdir -p "${BUILD_DIR}" "${BUILD_JS_DIR}"+ cp -a "${notes_root}/main-build/." "${BUILD_DIR}/"+ if [[ -d "${notes_root}/js-build" ]]; then+ cp -a "${notes_root}/js-build/." "${BUILD_DIR}/"+ cp -a "${notes_root}/js-build/." "${BUILD_JS_DIR}/"+ fi++ - name: Install electron deps and run Xvfb+ run: Xvfb "$DISPLAY" &++ - name: Run CPU JS coverage tests+ run: python3 .github/scripts/coverage/coverage.py step run-js-tests- - name: Collect coverage+ - name: Generate CPU native C/C++ coverage report+ run: python3 .github/scripts/coverage/coverage.py step collect-cpp-coverage++ - name: Collect JS CPU results+ id: cpu_artifact+ if: ${{ always() }}+ run: |+ dir="${RUNNER_TEMP}/coverage-js-cpu"+ python3 .github/scripts/coverage/ci_reports.py collect-suite-results \+ --workspace "${{ env.OV_WORKSPACE }}" \+ --suite js \+ --profile cpu \+ --lane cpu \+ --artifact-name coverage-js-cpu \+ --artifact-dir "${dir}"+ echo "dir=${dir}" >> "$GITHUB_OUTPUT"++ - name: Upload Codecov (JS bindings, CPU)+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2+ with:+ files: ${{ env.OV_WORKSPACE }}/js-lcov.info+ disable_search: true+ plugins: noop+ flags: nodejs-bindings-unit-e2e-cpu+ override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}+ override_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}+ fail_ci_if_error: true+ verbose: true++ - name: Upload Codecov (C++ runtime, JS suite, CPU)uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2with:+ files: ${{ env.OV_WORKSPACE }}/coverage.info+ disable_search: true+ plugins: noop+ flags: cpp-runtime-js-cpu+ override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}+ override_pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}+ fail_ci_if_error: trueverbose: true++ - name: Upload JS CPU artifact+ if: ${{ always() }}+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0+ with:+ name: coverage-js-cpu+ path: ${{ steps.cpu_artifact.outputs.dir }}+ if-no-files-found: warn+ retention-days: 14+ compression-level: 0+ overwrite: true++ CoverageSummary:+ if: ${{ always() && needs.Build.result == 'success' }}+ needs: [Build, CoverageCpp, CoveragePython, CoverageJS]+ runs-on: ubuntu-latest+ steps:+ - name: Checkout sources+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries+ timeout-minutes: 15+ with:+ sparse-checkout: |+ .github/scripts/coverage+ submodules: 'false'++ - name: Download C++ artifacts+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0+ with:+ pattern: coverage-cpp-*+ path: ${{ github.workspace }}/artifacts/cpp++ - name: Download Python artifacts+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0+ with:+ pattern: coverage-python-*+ path: ${{ github.workspace }}/artifacts/python++ - name: Download JS artifacts+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0+ with:+ pattern: coverage-js-*+ path: ${{ github.workspace }}/artifacts/js++ - name: Generate final summary+ run: |+ python3 .github/scripts/coverage/ci_reports.py render-summary \+ --workspace "${{ github.workspace }}" \+ --summary-file "${GITHUB_STEP_SUMMARY}" \+ --selection "cpu" \+ --selected-lanes "cpu"++ - name: Merge duration reports+ run: |+ python3 .github/scripts/coverage/ci_reports.py merge-durations \+ --workspace "${{ github.workspace }}" \+ --output "${{ github.workspace }}/coverage-test-durations-all.csv"++ - name: Upload merged duration artifact+ if: ${{ always() }}+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0+ with:+ name: coverage-test-durations+ path: coverage-test-durations-all.csv+ if-no-files-found: warn+ retention-days: 14+ compression-level: 0+ overwrite: truediff --git a/.github/workflows/job_build_linux.yml b/.github/workflows/job_build_linux.ymlindex 4bef15435f6..830458ca0a8 100644--- a/.github/workflows/job_build_linux.yml+++ b/.github/workflows/job_build_linux.yml@@ -65,6 +65,11 @@ on:type: booleanrequired: falsedefault: true+ upload-coverage-notes:+ description: 'Whether to upload gcno notes captured from the build directory'+ type: boolean+ required: false+ default: falsepermissions: read-all@@ -109,6 +114,7 @@ jobs:ARTIFACTS_SHARE: "/mount/build-artifacts"MANIFEST_PATH: '${{ github.workspace }}/openvino/manifest.yml'PRODUCT_TYPE: public_linux_${{ inputs.os }}_${{ inputs.arch }}_release+ COVERAGE_NOTES_DIR: ${{ github.workspace }}/coverage_build_notessteps:- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from fileshell: bash@@ -269,6 +275,16 @@ jobs:run: tar -cvf - * | pigz > ${BUILD_DIR}/openvino_tests.tar.gzworking-directory: ${{ env.INSTALL_TEST_DIR }}+ - name: Capture coverage notes for main build+ if: ${{ inputs.upload-coverage-notes }}+ run: |+ rm -rf "${COVERAGE_NOTES_DIR}/main-build"+ mkdir -p "${COVERAGE_NOTES_DIR}/main-build"+ (+ cd "${BUILD_DIR}"+ find . -type f -name '*.gcno' -exec cp --parents {} "${COVERAGE_NOTES_DIR}/main-build/" \;+ )+- name: Build Debian packagesif: ${{ inputs.build-debian-packages }}env:@@ -324,6 +340,15 @@ jobs:tar -czvf ${BUILD_DIR}/openvino_node_npm_package.tar.gz bin openvino-node-*working-directory: ${{ env.OPENVINO_REPO }}/src/bindings/js/node+ - name: Capture coverage notes for JS build+ if: ${{ inputs.upload-coverage-notes && fromJSON(inputs.affected-components).JS_API && inputs.build-js }}+ run: |+ mkdir -p "${COVERAGE_NOTES_DIR}/js-build"+ (+ cd "${BUILD_DIR}"+ find . -type f -name '*.gcno' -exec cp --parents {} "${COVERAGE_NOTES_DIR}/js-build/" \;+ )+- name: Build RPM packagesif: ${{ inputs.build-rpm-packages }}run: |@@ -411,6 +436,14 @@ jobs:path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gzif-no-files-found: 'error'+ - name: Upload coverage build notes+ if: ${{ inputs.upload-coverage-notes }}+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0+ with:+ name: coverage_build_notes+ path: ${{ env.COVERAGE_NOTES_DIR }}+ if-no-files-found: 'error'+- name: Prepare debian packages for storage on shareif: ${{ always() }}continue-on-error: truediff --git a/.gitignore b/.gitignoreindex ca469371d4c..9a3ef7f9f84 100644--- a/.gitignore+++ b/.gitignore@@ -58,6 +58,8 @@ __tests__/runner/*node_modules# Coverage directory used by tools like istanbulcoverage+!.github/scripts/coverage/+!.github/scripts/coverage/***.lcov# Optional npm cache directory.npm