Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GHA][Coverage] Add GPU tests code coverage (#35236)

Marcin Kruszynskie9187467d18f
diff --git a/.github/scripts/coverage/ci_reports.py b/.github/scripts/coverage/ci_reports.py
index 06f3e6e789c..83c39a705e9 100644
--- a/.github/scripts/coverage/ci_reports.py
+++ b/.github/scripts/coverage/ci_reports.py
@@ -22,6 +22,23 @@ from coverage import load_cpp_tests, load_js_tests, load_python_tests
METADATA_FILE = "coverage-artifact-metadata.json"
+UPLOAD_DEFS = {
+ "cpp_cpu": ("coverage-cpp-cpu", "coverage.info"),
+ "cpp_igpu_unit": ("coverage-cpp-igpu-unit", "coverage.info"),
+ "cpp_igpu_func": ("coverage-cpp-igpu-func", "coverage.info"),
+ "cpp_dgpu_unit": ("coverage-cpp-dgpu-unit", "coverage.info"),
+ "cpp_dgpu_func": ("coverage-cpp-dgpu-func", "coverage.info"),
+ "python_cpu_xml": ("coverage-python-cpu", "python-coverage.xml"),
+ "python_cpu_info": ("coverage-python-cpu", "coverage.info"),
+ "python_igpu_xml": ("coverage-python-igpu", "python-coverage.xml"),
+ "python_igpu_info": ("coverage-python-igpu", "coverage.info"),
+ "python_dgpu_xml": ("coverage-python-dgpu", "python-coverage.xml"),
+ "python_dgpu_info": ("coverage-python-dgpu", "coverage.info"),
+ "js_cpu_lcov": ("coverage-js-cpu", "js-lcov.info"),
+ "js_cpu_info": ("coverage-js-cpu", "coverage.info"),
+}
+
+
SUITE_DEFS = {
"cpp": {
"label": "C++",
@@ -310,6 +327,37 @@ def merge_durations(*, workspace: Path, output: Path) -> None:
print(f"Wrote {len(rows)} duration row(s) to {output}")
+def _find_upload_file(*, workspace: Path, artifact_name: str, filename: str) -> Path | None:
+ root = workspace / "artifacts"
+ if not root.exists():
+ return None
+
+ for metadata_path in sorted(root.rglob(METADATA_FILE)):
+ metadata = _read_json_file(metadata_path)
+ if str(metadata.get("artifact_name", "")).strip() != artifact_name:
+ continue
+ candidate = metadata_path.parent / filename
+ if candidate.is_file():
+ return candidate.resolve()
+
+ for candidate in sorted(root.rglob(filename)):
+ if candidate.is_file() and artifact_name in candidate.parts:
+ return candidate.resolve()
+
+ return None
+
+
+def resolve_uploads(*, workspace: Path, output_file: Path) -> None:
+ output_lines = []
+ for output_name, (artifact_name, filename) in UPLOAD_DEFS.items():
+ path = _find_upload_file(workspace=workspace, artifact_name=artifact_name, filename=filename)
+ output_lines.append(f"{output_name}={path or ''}")
+ print(f"{output_name}: {path or '<missing>'}")
+
+ with output_file.open("a", encoding="utf-8") as handle:
+ handle.write("\n".join(output_lines) + "\n")
+
+
def _parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Coverage CI report helpers")
subparsers = parser.add_subparsers(dest="command", required=True)
@@ -332,6 +380,10 @@ def _parse_args() -> argparse.Namespace:
merge.add_argument("--workspace", type=Path, required=True)
merge.add_argument("--output", type=Path, required=True)
+ uploads = subparsers.add_parser("resolve-uploads", help="Resolve Codecov upload files from downloaded artifacts")
+ uploads.add_argument("--workspace", type=Path, required=True)
+ uploads.add_argument("--output-file", type=Path, required=True)
+
return parser.parse_args()
@@ -358,6 +410,9 @@ def main() -> int:
if args.command == "merge-durations":
merge_durations(workspace=args.workspace.resolve(), output=args.output.resolve())
return 0
+ if args.command == "resolve-uploads":
+ resolve_uploads(workspace=args.workspace.resolve(), output_file=args.output_file.resolve())
+ return 0
raise ValueError(f"Unsupported command: {args.command}")
diff --git a/.github/scripts/coverage/collect_cpp_coverage.py b/.github/scripts/coverage/collect_cpp_coverage.py
index 678b39ffb12..6aeeae6a9e6 100644
--- a/.github/scripts/coverage/collect_cpp_coverage.py
+++ b/.github/scripts/coverage/collect_cpp_coverage.py
@@ -199,17 +199,17 @@ def _classify_unwanted_source(rel_path: Path) -> str | None:
return None
-def _classify_profile_unwanted_source(rel_path: Path, *, run_gpu_tests: bool, run_npu_tests: bool) -> str | None:
+def _classify_profile_unwanted_source(rel_path: Path, *, run_gpu_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/"):
+ if 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:
+def _prune_unwanted_gcda(root: Path, *, label: str, run_gpu_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
@@ -224,7 +224,7 @@ def _prune_unwanted_gcda(root: Path, *, label: str, run_gpu_tests: bool, run_npu
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)
+ reason = _classify_profile_unwanted_source(rel, run_gpu_tests=run_gpu_tests)
if reason is None:
continue
try:
@@ -292,7 +292,6 @@ def _normalize_and_filter_tracefile(
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] = {
@@ -342,7 +341,6 @@ def _normalize_and_filter_tracefile(
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
@@ -669,14 +667,12 @@ def run(ctx: CoverageContext) -> None:
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")
@@ -760,7 +756,6 @@ def run(ctx: CoverageContext) -> None:
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:
diff --git a/.github/scripts/coverage/config/tests_cpp.yml b/.github/scripts/coverage/config/tests_cpp.yml
index 0d5891d8b8a..a5a07067317 100644
--- a/.github/scripts/coverage/config/tests_cpp.yml
+++ b/.github/scripts/coverage/config/tests_cpp.yml
@@ -3,34 +3,48 @@ suite: cpp
tests:
- name: ov_api_conformance_tests
binary: ov_api_conformance_tests
- mode: gtest_single
- args: "*mandatory*"
+ mode: raw
+ profiles: [cpu, gpu]
+ args:
+ cpu: "--device=CPU --gtest_filter=*mandatory*"
+ gpu: "--device=GPU --gtest_filter=*mandatory*"
- name: ov_auto_batch_func_tests
binary: ov_auto_batch_func_tests
mode: gtest_single
- args: "*smoke*"
+ profiles: [cpu, gpu]
+ args:
+ cpu: "*smoke*"
+ gpu: "*GPU*:*nightly_OVClassCompiledModelGetPropertyTest*:*nightly_OVClassCompiledModelGetIncorrectPropertyTest*:*nightly_Auto_Batch_OVClassCompileModelWithCorrectPropertiesAutoBatchingTest*"
- name: ov_auto_batch_unit_tests
binary: ov_auto_batch_unit_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_auto_func_tests
binary: ov_auto_func_tests
mode: gtest_single
+ profiles: [cpu]
args: "*smoke*"
- name: ov_auto_unit_tests
binary: ov_auto_unit_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_capi_test
binary: ov_capi_test
mode: gtest_single
+ profiles: [cpu, gpu]
+ args:
+ cpu: "-*ov_core_gpu*:*intel_gpu*"
+ gpu: "*ov_core_gpu*:*intel_gpu*"
- name: ov_conditional_compilation_tests
binary: ov_conditional_compilation_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_core_unit_tests
binary: ov_core_unit_tests
@@ -39,45 +53,55 @@ tests:
args:
cpu: "-*IE_GPU*"
gpu: "*IE_GPU*"
- default: ""
- name: ov_cpu_func_tests
binary: ov_cpu_func_tests
mode: gtest_single
+ profiles: [cpu]
args: "*smoke*"
- name: ov_cpu_unit_tests
binary: ov_cpu_unit_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_cpu_unit_tests_vectorized
binary: ov_cpu_unit_tests_vectorized
mode: gtest_single
+ profiles: [cpu]
- name: ov_hetero_func_tests
binary: ov_hetero_func_tests
mode: gtest_single
- args: "*smoke*:-nightly*"
+ profiles: [cpu, gpu]
+ args:
+ cpu: "*smoke*:-nightly*"
+ gpu: "*GPU*:*nightly_HETERO_OVClassCompileModelWithCorrectPropertiesTest*/*/2:*nightly_HETERO_OVClassCompileModelWithCorrectPropertiesTest*/*/4:*nightly_HETERO_OVClassCompileModelWithCorrectSecondaryPropertiesTest*:*nightly_OVClassCompiledModelGetPropertyTest*:*nightly_OVClassCompiledModelGetIncorrectPropertyTest*"
- name: ov_hetero_unit_tests
binary: ov_hetero_unit_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_inference_functional_tests
binary: ov_inference_functional_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_inference_unit_tests
binary: ov_inference_unit_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_ir_frontend_tests
binary: ov_ir_frontend_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_lp_transformations_tests
binary: ov_lp_transformations_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_onnx_frontend_tests
binary: ov_onnx_frontend_tests
@@ -86,7 +110,6 @@ tests:
args:
cpu: "-*IE_GPU*"
gpu: "*IE_GPU*"
- default: ""
- name: ov_onnx_frontend_tests (ONNX_ITERATOR=0)
binary: ov_onnx_frontend_tests
@@ -96,33 +119,40 @@ tests:
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*"
+ profiles: [cpu, gpu]
+ args:
+ cpu: "--device=TEMPLATE --gtest_filter=*OpImpl*"
+ gpu: "--device=GPU --gtest_filter=*OpImpl*"
- name: ov_proxy_plugin_tests
binary: ov_proxy_plugin_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_snippets_func_tests
binary: ov_snippets_func_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_subgraphs_dumper_tests
binary: ov_subgraphs_dumper_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_template_func_tests
binary: ov_template_func_tests
mode: gtest_single
+ profiles: [cpu]
args: "*smoke*"
- name: ov_tensorflow_common_tests
binary: ov_tensorflow_common_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_tensorflow_frontend_tests
binary: ov_tensorflow_frontend_tests
@@ -131,69 +161,50 @@ tests:
args:
cpu: "-*IE_GPU*"
gpu: "*IE_GPU*"
- default: ""
- name: ov_tensorflow_lite_frontend_tests
binary: ov_tensorflow_lite_frontend_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_transformations_tests
binary: ov_transformations_tests
mode: gtest_single
+ profiles: [cpu]
- name: ov_util_tests
binary: ov_util_tests
mode: gtest_single
+ profiles: [cpu]
- 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"
+ profiles: [cpu]
- 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
+ binary: memory_tests/test_inference_async
mode: raw
- profiles: [cpu, gpu, npu]
+ profiles: [cpu, gpu]
args:
+ cpu: "__MODEL_PATH__ CPU"
gpu: "__MODEL_PATH__ GPU"
- npu: "__MODEL_PATH__ NPU"
- default: "__MODEL_PATH__ CPU"
- name: test_inference_sync
- binary: test_inference_sync
+ binary: memory_tests/test_inference_sync
mode: raw
- profiles: [cpu, gpu, npu]
+ profiles: [cpu, gpu]
args:
+ cpu: "__MODEL_PATH__ CPU"
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.yml
index 2f0d6d08578..9f6c7fc9553 100644
--- a/.github/scripts/coverage/config/tests_js.yml
+++ b/.github/scripts/coverage/config/tests_js.yml
@@ -3,58 +3,65 @@ suite: js
tests:
- name: node tests/setup.js (covered)
kind: command
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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
+ profiles: [cpu]
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.yml
index f50573ca1ad..7a1d94e3f6d 100644
--- a/.github/scripts/coverage/config/tests_python.yml
+++ b/.github/scripts/coverage/config/tests_python.yml
@@ -3,136 +3,149 @@ suite: python
tests:
- name: pyopenvino
kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/pyopenvino"
- args: "-sv -k 'not cuda' --ignore=${TESTS_DIR}/pyopenvino/tests/test_utils/test_utils.py"
+ env:
+ cpu: "TEST_DEVICE=CPU"
+ gpu: "TEST_DEVICE=GPU"
+ args:
+ cpu: "-sv -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -k 'not cuda and not npu_'"
- name: onnx_python
kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/onnx"
- args: "-sv -k 'not cuda' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py"
+ env:
+ cpu: "TEST_DEVICE=CPU"
+ gpu: "TEST_DEVICE=GPU"
+ args:
+ cpu: "-sv --backend=CPU -k 'not gpu and not cuda and not npu_ and not zoo' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py --ignore=${TESTS_DIR}/onnx/tests/tests_python/test_zoo_models.py"
+ gpu: "-sv --backend=GPU -k 'not cuda and not npu_ and not zoo' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py --ignore=${TESTS_DIR}/onnx/tests/tests_python/test_zoo_models.py"
+
+ - name: onnx_python_legacy_iterator
+ kind: pytest
+ profiles: [cpu, gpu]
+ target: "${TESTS_DIR}/onnx"
+ env:
+ cpu: "TEST_DEVICE=CPU ONNX_ITERATOR=0"
+ gpu: "TEST_DEVICE=GPU ONNX_ITERATOR=0"
+ args:
+ cpu: "-sv --backend=CPU -k 'not gpu and not cuda and not npu_ and not zoo' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py --ignore=${TESTS_DIR}/onnx/tests/tests_python/test_zoo_models.py"
+ gpu: "-sv --backend=GPU -k 'not cuda and not npu_ and not zoo' --ignore=${TESTS_DIR}/onnx/test_python/test_zoo_models.py --ignore=${TESTS_DIR}/onnx/tests/tests_python/test_zoo_models.py"
- name: ovc_unit
kind: pytest
+ profiles: [cpu]
target: "${TESTS_DIR}/ovc/unit_tests"
- args: "-sv -k 'not cuda'"
+ args: "-sv -k 'not gpu and not cuda and not npu_'"
- name: py_frontend
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu]
target: "${TESTS_DIR}/layer_tests/py_frontend_tests"
- args: "-sv -v"
+ args: "-sv -k 'not gpu and not cuda and not npu_'"
- name: tensorflow_lite_layers
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/layer_tests/tensorflow_lite_tests"
- env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"
- args: "-sv -v"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP16"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16"
+ args:
+ cpu: "-sv -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -k 'not cuda and not npu_'"
- name: tensorflow_layers
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/layer_tests/tensorflow_tests"
- env: "TEST_DEVICE=CPU TEST_PRECISION=FP16"
- args: "-sv -m precommit -v"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP16"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16"
+ args:
+ cpu: "-sv -m precommit -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit -k 'not cuda and not npu_'"
- name: tensorflow2_keras_layers
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/layer_tests/tensorflow2_keras_tests"
- env: "TEST_DEVICE=CPU"
- args: "-sv -m precommit -v"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION="
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16"
+ args:
+ cpu: "-sv -m precommit -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit -k 'not cuda and not npu_'"
- name: onnx_layers
- kind: pytest_if_dir
- profiles: [cpu, gpu, npu]
+ kind: pytest
+ profiles: [cpu, gpu]
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'"
+ cpu: "-sv -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -k 'not cuda and not npu_'"
- name: pytorch_layers
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
target: "${TESTS_DIR}/layer_tests/pytorch_tests"
- env: "TEST_DEVICE=CPU TEST_PRECISION=FP32"
- args: "-sv -m precommit -v"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP32"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP32"
+ args:
+ cpu: "-sv -m precommit -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit -k 'not cuda and not npu_'"
- name: pytorch_layers_export
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
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"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=EXPORT"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=EXPORT"
+ args:
+ cpu: "-sv -m precommit_torch_export -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit_torch_export -k 'not cuda and not npu_'"
- name: pytorch_layers_fx_backend
- kind: pytest_if_dir
+ kind: pytest
+ profiles: [cpu, gpu]
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"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=TORCHFX"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=TORCHFX"
+ args:
+ cpu: "-sv -m precommit_fx_backend -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit_fx_backend -k 'not cuda and not npu_'"
- 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'"
+ profiles: [cpu, gpu]
+ target: "${TESTS_DIR}/layer_tests/jax_tests"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP16 JAX_TRACE_MODE=JAXPR"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16 JAX_TRACE_MODE=JAXPR"
+ args:
+ cpu: "-sv -m precommit_jax_fe -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -m precommit_jax_fe -k 'not cuda and not npu_'"
- - name: src_py_runtime_remote_api_gpu
+ - name: ovc_python_api
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
+ profiles: [cpu, gpu]
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'"
+ env:
+ cpu: "TEST_DEVICE=CPU TEST_PRECISION=FP16"
+ gpu: "TEST_DEVICE=GPU TEST_PRECISION=FP16"
+ args:
+ cpu: "-sv -k 'not gpu and not cuda and not npu_'"
+ gpu: "-sv -k 'not cuda and not npu_'"
- - name: ovc_cli_help
+ - name: docs_python_snippets
kind: command
- command: "python3 -m coverage run -a -m openvino.tools.ovc --help"
+ profiles: [cpu]
+ command: "PYTHONPATH=docs/articles_en/assets:${PYTHONPATH} python3 -m coverage run -a docs/articles_en/assets/snippets/main.py"
diff --git a/.github/scripts/coverage/coverage.py b/.github/scripts/coverage/coverage.py
index 7aec77902ad..80be466b733 100644
--- a/.github/scripts/coverage/coverage.py
+++ b/.github/scripts/coverage/coverage.py
@@ -24,7 +24,7 @@ if str(SCRIPT_DIR) not in sys.path:
sys.modules.setdefault("coverage_workflow", sys.modules[__name__])
-SUPPORTED_PROFILES = {"cpu", "gpu", "npu"}
+SUPPORTED_PROFILES = {"cpu", "gpu"}
def _build_logger() -> logging.Logger:
@@ -47,8 +47,6 @@ LOGGER = _build_logger()
@dataclass(frozen=True)
class CppTestCase:
name: str
- enabled: bool
- skip_reason: str
binary: str
mode: str
args: str
@@ -58,8 +56,6 @@ class CppTestCase:
@dataclass(frozen=True)
class PythonTestCase:
name: str
- enabled: bool
- skip_reason: str
kind: str
target: str
args: str
@@ -70,8 +66,6 @@ class PythonTestCase:
@dataclass(frozen=True)
class JsTestCase:
name: str
- enabled: bool
- skip_reason: str
kind: str
command: str
@@ -87,14 +81,6 @@ class Paths:
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
@@ -225,29 +211,14 @@ def _repo_root(default: Path) -> Path:
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
@@ -274,9 +245,6 @@ class CoverageContext:
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"))),
@@ -287,51 +255,28 @@ class CoverageContext:
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
+ return self.test_profile == "gpu"
def log_profile(self) -> None:
- """Print the resolved profile and accelerator flags."""
+ """Print the resolved profile."""
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:
@@ -344,38 +289,18 @@ def _as_text(value: Any) -> str:
def _resolve_profile_value(value: Any, profile: str) -> str:
- """Pick a profile-specific config value when a mapping is provided."""
+ """Pick an explicit 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.get(profile, ""))
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()
+def _configured_profiles(test: dict[str, Any]) -> tuple[str, ...]:
+ """Return the explicit profiles configured for a test."""
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, ""
+ if not isinstance(profiles, list):
+ return ()
+ return tuple(_as_text(profile).strip() for profile in profiles)
def _load_yaml(path: Path) -> dict[str, Any]:
@@ -412,12 +337,11 @@ def load_cpp_tests(path: Path, profile: str) -> list[CppTestCase]:
loaded: list[CppTestCase] = []
for test in _load_tests(path, "cpp"):
- enabled, reason = _resolve_enabled(test, profile)
+ if profile not in _configured_profiles(test):
+ continue
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(),
@@ -434,12 +358,11 @@ def load_python_tests(path: Path, profile: str) -> list[PythonTestCase]:
loaded: list[PythonTestCase] = []
for test in _load_tests(path, "python"):
- enabled, reason = _resolve_enabled(test, profile)
+ if profile not in _configured_profiles(test):
+ continue
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(),
@@ -457,12 +380,11 @@ def load_js_tests(path: Path, profile: str) -> list[JsTestCase]:
loaded: list[JsTestCase] = []
for test in _load_tests(path, "js"):
- enabled, reason = _resolve_enabled(test, profile)
+ if profile not in _configured_profiles(test):
+ continue
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(),
)
@@ -470,6 +392,17 @@ def load_js_tests(path: Path, profile: str) -> list[JsTestCase]:
return loaded
+def _profile_value_fields(suite: str) -> tuple[str, ...]:
+ """Return config fields that may contain per-profile mappings."""
+ if suite == "cpp":
+ return ("args", "extra_env")
+ if suite == "python":
+ return ("target", "args", "env", "command")
+ if suite == "js":
+ return ("command",)
+ return ()
+
+
def validate_configs(config_dir: Path) -> list[ConfigValidationIssue]:
"""Validate coverage YAML configs and return any issues found."""
issues: list[ConfigValidationIssue] = []
@@ -484,13 +417,29 @@ def validate_configs(config_dir: Path) -> list[ConfigValidationIssue]:
tests = _load_tests(path, suite)
for idx, test in enumerate(tests):
name = _as_text(test.get("name", f"<index:{idx}>"))
+ profiles = test.get("profiles")
+ expected_profiles = _configured_profiles(test)
if not _as_text(test.get("name", "")).strip():
issues.append(ConfigValidationIssue(suite, name, "missing 'name'"))
+ if not isinstance(profiles, list) or not profiles:
+ issues.append(ConfigValidationIssue(suite, name, "'profiles' must be a non-empty list"))
+ else:
+ for profile_name in expected_profiles:
+ if profile_name not in SUPPORTED_PROFILES:
+ issues.append(ConfigValidationIssue(suite, name, f"unsupported profile '{profile_name}'"))
+ for field in _profile_value_fields(suite):
+ value = test.get(field)
+ if not isinstance(value, dict):
+ continue
+ mapped_profiles = {_as_text(profile).strip() for profile in value}
+ for profile_name in expected_profiles:
+ if profile_name in SUPPORTED_PROFILES and profile_name not in mapped_profiles:
+ issues.append(ConfigValidationIssue(suite, name, f"'{field}' missing '{profile_name}' value"))
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"}:
+ if kind not in {"pytest", "command"}:
issues.append(ConfigValidationIssue(suite, name, f"unsupported kind '{kind}'"))
if suite == "js":
kind = _as_text(test.get("kind", "command")).strip() or "command"
@@ -558,19 +507,16 @@ def _command_step(args: argparse.Namespace) -> int:
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")
+ print("name\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,
@@ -580,14 +526,12 @@ def _command_list_tests(args: argparse.Namespace) -> int:
)
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")
+ print("name\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,
@@ -598,14 +542,12 @@ def _command_list_tests(args: argparse.Namespace) -> int:
)
else:
tests = load_js_tests(config_dir / "tests_js.yml", args.profile)
- print("name\tenabled\tskip_reason\tkind\tcommand")
+ print("name\tkind\tcommand")
for t in tests:
print(
"\t".join(
[
t.name,
- "1" if t.enabled else "0",
- t.skip_reason,
t.kind,
t.command,
]
@@ -618,7 +560,6 @@ def _command_list_tests(args: argparse.Namespace) -> int:
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:
diff --git a/.github/scripts/coverage/run_tests.py b/.github/scripts/coverage/run_tests.py
index 86aec212818..8a1af4c0238 100644
--- a/.github/scripts/coverage/run_tests.py
+++ b/.github/scripts/coverage/run_tests.py
@@ -222,7 +222,7 @@ def _append_summary(
lines.extend(extra_lines)
lines.extend(
[
- f"{suite.label} test selection: {', '.join(selected_names) if selected_names else 'all enabled tests'}",
+ f"{suite.label} test selection: {', '.join(selected_names) if selected_names else 'all configured tests'}",
f"{suite.label} tests executed: {executed}",
f"{suite.label} tests passed: {passed}",
f"{suite.label} tests failed: {len(failed)}",
@@ -639,16 +639,11 @@ def run_cpp(ctx: CoverageContext) -> None:
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))))
+ configured_tests = [(test, test.args.replace("__MODEL_PATH__", str(ctx.paths.model_path))) for test in tests]
- if enabled_tests:
+ if configured_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):
+ for result in _run_cpp_tests_serial(ctx, configured_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]
@@ -661,14 +656,9 @@ def run_cpp(ctx: CoverageContext) -> None:
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
- ),
+ no_execution_warning=f"No C++ tests were executed. Check restored binaries under: {ctx.paths.bin_dir}",
failure_warning="One or more C++ tests failed; continuing to coverage generation.",
)
@@ -680,24 +670,19 @@ def run_python(ctx: CoverageContext) -> None:
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})"))
+ if not tests:
_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.",
+ no_execution_warning=f"No Python tests are configured 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"
@@ -727,8 +712,6 @@ def run_python(ctx: CoverageContext) -> None:
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)
@@ -746,10 +729,6 @@ def run_python(ctx: CoverageContext) -> None:
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)
@@ -758,13 +737,6 @@ def run_python(ctx: CoverageContext) -> None:
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}",
@@ -844,16 +816,13 @@ def run_js(ctx: CoverageContext) -> None:
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})"))
+ if not tests:
_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.",
+ no_execution_warning=f"No JS tests are configured for TEST_PROFILE={ctx.test_profile}; skipping JS suite.",
)
return
@@ -863,9 +832,6 @@ def run_js(ctx: CoverageContext) -> None:
).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
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index d99457ffaca..e3e938e56b5 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -5,23 +5,47 @@ on:
# run daily at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch:
+ inputs:
+ run-cpu-tests:
+ description: 'Run the standard CPU coverage lanes'
+ type: boolean
+ required: false
+ default: true
+ run-gpu-tests:
+ description: 'Build with GPU support and run the GPU coverage lanes'
+ type: boolean
+ required: false
+ default: true
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+ group: ${{ github.event_name == 'pull_request' && github.run_id || format('{0}-{1}', github.workflow, github.ref) }}
+ cancel-in-progress: false
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
+ IGPU_DRIVER_PACKAGES: |-
+ https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.15985.7/intel-igc-core_1.0.15985.7_amd64.deb
+ https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.15985.7/intel-igc-opencl_1.0.15985.7_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.05.28454.6/intel-level-zero-gpu_1.3.28454.6_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.05.28454.6/intel-opencl-icd_24.05.28454.6_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.05.28454.6/libigdgmm12_22.3.11_amd64.deb
+ DGPU_DRIVER_PACKAGES: |-
+ https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.17791.9/intel-igc-core_1.0.17791.9_amd64.deb
+ https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.17791.9/intel-igc-opencl_1.0.17791.9_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.39.31294.12/intel-level-zero-gpu_1.6.31294.12_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.39.31294.12/intel-opencl-icd_24.39.31294.12_amd64.deb
+ https://github.com/intel/compute-runtime/releases/download/24.39.31294.12/libigdgmm12_22.5.2_amd64.deb
jobs:
Docker:
+ name: Coverage Docker Images
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-cpu-tests == 'true' || github.event.inputs.run-gpu-tests == 'true' }}
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
@@ -45,8 +69,9 @@ jobs:
changed_components: '{"docker_env":false,"dockerfiles":false}'
Build:
- name: Build coverage artifacts
+ name: Coverage Build Artifacts
needs: Docker
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-cpu-tests == 'true' || github.event.inputs.run-gpu-tests == 'true' }}
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
@@ -76,14 +101,15 @@ jobs:
-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
+ ${{ (github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-gpu-tests == 'true') && '-DENABLE_INTEL_GPU=ON' || '-DENABLE_INTEL_GPU=OFF' }}
+ ${{ (github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-gpu-tests == 'true') && '-DENABLE_ONEDNN_FOR_GPU=ON' || '-DENABLE_ONEDNN_FOR_GPU=OFF' }}
CoverageCpp:
- name: Coverage C++
+ name: Coverage C++ (CPU)
needs: [Docker, Build]
- runs-on: aks-linux-8-cores-32gb
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-cpu-tests == 'true' }}
+ runs-on: aks-linux-16-cores-32gb
container:
image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}
volumes:
@@ -95,6 +121,7 @@ jobs:
shell: bash
working-directory: ${{ github.workspace }}
env:
+ TEST_PROFILE: cpu
OV_WORKSPACE: ${{ github.workspace }}
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
@@ -179,34 +206,183 @@ jobs:
--artifact-dir "${dir}"
echo "dir=${dir}" >> "$GITHUB_OUTPUT"
- - name: Upload Codecov (C++ runtime, CPU)
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- 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: Upload C++ CPU artifact
if: ${{ always() }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
with:
name: coverage-cpp-cpu
path: ${{ steps.cpu_artifact.outputs.dir }}
if-no-files-found: warn
- retention-days: 14
+ retention-days: 7
+ compression-level: 0
+ overwrite: true
+
+ CoverageCppGpu:
+ name: Coverage C++ (${{ matrix.gpu.name }}, ${{ matrix.lane.name }})
+ needs: Build
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-gpu-tests == 'true' }}
+ runs-on: ${{ fromJSON(matrix.gpu.runs_on) }}
+ container:
+ image: ubuntu:22.04
+ volumes:
+ - /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro
+ - /mount:/mount
+ - ${{ github.workspace }}:${{ github.workspace }}
+ options: ${{ matrix.gpu.container_options }}
+ strategy:
+ fail-fast: false
+ max-parallel: 4
+ matrix:
+ gpu:
+ - id: igpu
+ name: iGPU
+ runs_on: '["self-hosted","igpu"]'
+ container_options: "--group-add 44 --group-add 993 --device /dev/dri/card1:/dev/dri/card1 --device /dev/dri/renderD128:/dev/dri/renderD128"
+ - id: dgpu
+ name: dGPU Arc A770
+ runs_on: '["self-hosted","dgpu","Arc-A770","Linux"]'
+ container_options: "--group-add 44 --group-add 993 --device /dev/dri/renderD129:/dev/dri/renderD129"
+ lane:
+ - id: unit
+ name: GPU Unit Tests
+ test_names: ov_onnx_frontend_tests,ov_onnx_frontend_tests (ONNX_ITERATOR=0),ov_gpu_unit_tests,test_inference_async,test_inference_sync
+ - id: func
+ name: GPU Functional Tests
+ test_names: ov_gpu_func_tests
+ defaults:
+ run:
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ env:
+ TEST_PROFILE: gpu
+ CXX_TEST_NAMES: ${{ matrix.lane.test_names }}
+ 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: Prepare ${{ matrix.gpu.name }} test container
+ run: |
+ apt-get update && apt-get install -y pigz wget software-properties-common ca-certificates gpg-agent tzdata clinfo git lcov python3-yaml
+ env:
+ DEBIAN_FRONTEND: noninteractive
+ TZ: "Europe/London"
+
+ - 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.0
+ with:
+ 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: Install GPU driver dependencies
+ run: |
+ set -euo pipefail
+ "${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh" -c=core -c=dev -c=gpu -y
+
+ case "${{ matrix.gpu.id }}" in
+ igpu)
+ driver_packages="${IGPU_DRIVER_PACKAGES}"
+ ;;
+ dgpu)
+ driver_packages="${DGPU_DRIVER_PACKAGES}"
+ ;;
+ *)
+ echo "Unsupported GPU device '${{ matrix.gpu.id }}'"
+ exit 1
+ ;;
+ esac
+
+ tmp_dir="$(mktemp -d)"
+ trap 'rm -rf "${tmp_dir}"' EXIT
+ pushd "${tmp_dir}"
+ while IFS= read -r package_url; do
+ [[ -n "${package_url}" ]] || continue
+ wget "${package_url}"
+ done <<< "${driver_packages}"
+ dpkg -i *.deb
+ popd
+
+ - name: Verify GPU device availability
+ run: clinfo
+
+ - 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: Run ${{ matrix.gpu.name }} ${{ matrix.lane.name }} C++ coverage tests
+ run: python3 .github/scripts/coverage/coverage.py step run-cpp-tests
+
+ - name: Generate ${{ matrix.gpu.name }} ${{ matrix.lane.name }} native C/C++ coverage report
+ run: python3 .github/scripts/coverage/coverage.py step collect-cpp-coverage
+
+ - name: Collect C++ ${{ matrix.gpu.name }} ${{ matrix.lane.name }} results
+ id: lane_artifact
+ if: ${{ always() }}
+ run: |
+ dir="${RUNNER_TEMP}/coverage-cpp-${{ matrix.gpu.id }}-${{ matrix.lane.id }}"
+ python3 .github/scripts/coverage/ci_reports.py collect-suite-results \
+ --workspace "${{ env.OV_WORKSPACE }}" \
+ --suite cpp \
+ --profile gpu \
+ --lane "${{ matrix.gpu.id }}-${{ matrix.lane.id }}" \
+ --artifact-name "coverage-cpp-${{ matrix.gpu.id }}-${{ matrix.lane.id }}" \
+ --artifact-dir "${dir}"
+ echo "dir=${dir}" >> "$GITHUB_OUTPUT"
+
+ - name: Upload C++ ${{ matrix.gpu.name }} ${{ matrix.lane.name }} artifact
+ if: ${{ always() }}
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
+ with:
+ name: coverage-cpp-${{ matrix.gpu.id }}-${{ matrix.lane.id }}
+ path: ${{ steps.lane_artifact.outputs.dir }}
+ if-no-files-found: warn
+ retention-days: 7
compression-level: 0
overwrite: true
CoveragePython:
- name: Coverage Python
+ name: Coverage Python (CPU)
needs: [Docker, Build]
- runs-on: aks-linux-4-cores-16gb
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-cpu-tests == 'true' }}
+ runs-on: aks-linux-16-cores-32gb
container:
image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}
volumes:
@@ -218,6 +394,7 @@ jobs:
shell: bash
working-directory: ${{ github.workspace }}
env:
+ TEST_PROFILE: cpu
OV_WORKSPACE: ${{ github.workspace }}
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
@@ -323,46 +500,206 @@ jobs:
--artifact-dir "${dir}"
echo "dir=${dir}" >> "$GITHUB_OUTPUT"
- - name: Upload Codecov (Python API, CPU)
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ - name: Upload Python CPU artifact
+ if: ${{ always() }}
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
with:
- token: ${{ secrets.CODECOV_TOKEN }}
- 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: coverage-python-cpu
+ path: ${{ steps.cpu_artifact.outputs.dir }}
+ if-no-files-found: warn
+ retention-days: 7
+ compression-level: 0
+ overwrite: true
- - name: Upload Codecov (C++ runtime, Python suite, CPU)
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ CoveragePythonGpu:
+ name: Coverage Python (${{ matrix.gpu.name }})
+ needs: Build
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-gpu-tests == 'true' }}
+ runs-on: ${{ fromJSON(matrix.gpu.runs_on) }}
+ container:
+ image: ubuntu:22.04
+ volumes:
+ - /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro
+ - /mount:/mount
+ - ${{ github.workspace }}:${{ github.workspace }}
+ options: ${{ matrix.gpu.container_options }}
+ strategy:
+ fail-fast: false
+ matrix:
+ gpu:
+ - id: igpu
+ name: iGPU
+ runs_on: '["self-hosted","igpu"]'
+ container_options: "--group-add 44 --group-add 993 --device /dev/dri/card1:/dev/dri/card1 --device /dev/dri/renderD128:/dev/dri/renderD128"
+ - id: dgpu
+ name: dGPU Arc A770
+ runs_on: '["self-hosted","dgpu","Arc-A770","Linux"]'
+ container_options: "--group-add 44 --group-add 993 --device /dev/dri/renderD129:/dev/dri/renderD129"
+ defaults:
+ run:
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ env:
+ TEST_PROFILE: gpu
+ 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'
+ REQUESTS_CA_BUNDLE: /usr/local/share/ca-certificates/IntelProxyRootCA-Base64.crt
+ steps:
+ - name: Prepare ${{ matrix.gpu.name }} test container
+ run: |
+ apt-get update && apt-get install -y pigz wget software-properties-common ca-certificates gpg-agent tzdata clinfo git lcov python3-yaml
+ env:
+ DEBIAN_FRONTEND: noninteractive
+ TZ: "Europe/London"
+
+ - name: Checkout sources
+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
+ timeout-minutes: 15
with:
- token: ${{ secrets.CODECOV_TOKEN }}
- 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
+ submodules: 'true'
- - name: Upload Python CPU artifact
+ - 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 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: Install GPU driver dependencies
+ run: |
+ set -euo pipefail
+ "${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh" -c=core -c=dev -c=gpu -y
+
+ case "${{ matrix.gpu.id }}" in
+ igpu)
+ driver_packages="${IGPU_DRIVER_PACKAGES}"
+ ;;
+ dgpu)
+ driver_packages="${DGPU_DRIVER_PACKAGES}"
+ ;;
+ *)
+ echo "Unsupported GPU device '${{ matrix.gpu.id }}'"
+ exit 1
+ ;;
+ esac
+
+ tmp_dir="$(mktemp -d)"
+ trap 'rm -rf "${tmp_dir}"' EXIT
+ pushd "${tmp_dir}"
+ while IFS= read -r package_url; do
+ [[ -n "${package_url}" ]] || continue
+ wget "${package_url}"
+ done <<< "${driver_packages}"
+ dpkg -i *.deb
+ popd
+
+ - name: Verify GPU device availability
+ run: clinfo
+
+ - 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: 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 dependencies
+ run: |
+ 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: Run ${{ matrix.gpu.name }} Python coverage tests
+ run: python3 .github/scripts/coverage/coverage.py step run-python-tests
+
+ - name: Generate ${{ matrix.gpu.name }} native C/C++ coverage report
+ run: python3 .github/scripts/coverage/coverage.py step collect-cpp-coverage
+
+ - name: Collect Python ${{ matrix.gpu.name }} results
+ id: gpu_artifact
if: ${{ always() }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ run: |
+ dir="${RUNNER_TEMP}/coverage-python-${{ matrix.gpu.id }}"
+ python3 .github/scripts/coverage/ci_reports.py collect-suite-results \
+ --workspace "${{ env.OV_WORKSPACE }}" \
+ --suite python \
+ --profile gpu \
+ --lane "${{ matrix.gpu.id }}" \
+ --artifact-name "coverage-python-${{ matrix.gpu.id }}" \
+ --artifact-dir "${dir}"
+ echo "dir=${dir}" >> "$GITHUB_OUTPUT"
+
+ - name: Upload Python ${{ matrix.gpu.name }} artifact
+ if: ${{ always() }}
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
with:
- name: coverage-python-cpu
- path: ${{ steps.cpu_artifact.outputs.dir }}
+ name: coverage-python-${{ matrix.gpu.id }}
+ path: ${{ steps.gpu_artifact.outputs.dir }}
if-no-files-found: warn
- retention-days: 14
+ retention-days: 7
compression-level: 0
overwrite: true
CoverageJS:
- name: Coverage JS
+ name: Coverage JS (CPU)
needs: [Docker, Build]
+ if: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event.inputs.run-cpu-tests == 'true' }}
runs-on: aks-linux-4-cores-16gb
container:
image: ${{ fromJSON(needs.Docker.outputs.images).ov_test.ubuntu_22_04_x64 }}
@@ -375,6 +712,7 @@ jobs:
shell: bash
working-directory: ${{ github.workspace }}
env:
+ TEST_PROFILE: cpu
OV_WORKSPACE: ${{ github.workspace }}
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_PKG_DIR: ${{ github.workspace }}/install
@@ -481,83 +819,91 @@ jobs:
--artifact-dir "${dir}"
echo "dir=${dir}" >> "$GITHUB_OUTPUT"
- - name: Upload Codecov (JS bindings, CPU)
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- 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.2
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- 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: true
- verbose: true
-
- name: Upload JS CPU artifact
if: ${{ always() }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
with:
name: coverage-js-cpu
path: ${{ steps.cpu_artifact.outputs.dir }}
if-no-files-found: warn
- retention-days: 14
+ retention-days: 7
compression-level: 0
overwrite: true
CoverageSummary:
+ name: Coverage Summary
if: ${{ always() && needs.Build.result == 'success' }}
- needs: [Build, CoverageCpp, CoveragePython, CoverageJS]
+ needs: [Build, CoverageCpp, CoverageCppGpu, CoveragePython, CoveragePythonGpu, CoverageJS]
+ outputs:
+ cpp_cpu: ${{ steps.coverage_files.outputs.cpp_cpu }}
+ cpp_igpu_unit: ${{ steps.coverage_files.outputs.cpp_igpu_unit }}
+ cpp_igpu_func: ${{ steps.coverage_files.outputs.cpp_igpu_func }}
+ cpp_dgpu_unit: ${{ steps.coverage_files.outputs.cpp_dgpu_unit }}
+ cpp_dgpu_func: ${{ steps.coverage_files.outputs.cpp_dgpu_func }}
+ python_cpu_xml: ${{ steps.coverage_files.outputs.python_cpu_xml }}
+ python_cpu_info: ${{ steps.coverage_files.outputs.python_cpu_info }}
+ python_igpu_xml: ${{ steps.coverage_files.outputs.python_igpu_xml }}
+ python_igpu_info: ${{ steps.coverage_files.outputs.python_igpu_info }}
+ python_dgpu_xml: ${{ steps.coverage_files.outputs.python_dgpu_xml }}
+ python_dgpu_info: ${{ steps.coverage_files.outputs.python_dgpu_info }}
+ js_cpu_lcov: ${{ steps.coverage_files.outputs.js_cpu_lcov }}
+ js_cpu_info: ${{ steps.coverage_files.outputs.js_cpu_info }}
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
+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-cpp-*
path: ${{ github.workspace }}/artifacts/cpp
- name: Download Python artifacts
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-python-*
path: ${{ github.workspace }}/artifacts/python
- name: Download JS artifacts
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-js-*
path: ${{ github.workspace }}/artifacts/js
+ - name: Resolve selected lanes
+ id: lanes
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ RUN_CPU_TESTS: ${{ github.event.inputs.run-cpu-tests || '' }}
+ RUN_GPU_TESTS: ${{ github.event.inputs.run-gpu-tests || '' }}
+ run: |
+ selected_lanes='none'
+ if [[ "$EVENT_NAME" == 'schedule' || "$EVENT_NAME" == 'pull_request' ]]; then
+ selected_lanes='cpu,igpu,igpu-unit,igpu-func,dgpu,dgpu-unit,dgpu-func'
+ elif [[ "$RUN_CPU_TESTS" == 'true' && "$RUN_GPU_TESTS" == 'true' ]]; then
+ selected_lanes='cpu,igpu,igpu-unit,igpu-func,dgpu,dgpu-unit,dgpu-func'
+ elif [[ "$RUN_CPU_TESTS" == 'true' ]]; then
+ selected_lanes='cpu'
+ elif [[ "$RUN_GPU_TESTS" == 'true' ]]; then
+ selected_lanes='igpu,igpu-unit,igpu-func,dgpu,dgpu-unit,dgpu-func'
+ fi
+ echo "selected_lanes=${selected_lanes}" >> "$GITHUB_OUTPUT"
+
- name: Generate final summary
+ if: ${{ always() }}
run: |
python3 .github/scripts/coverage/ci_reports.py render-summary \
--workspace "${{ github.workspace }}" \
--summary-file "${GITHUB_STEP_SUMMARY}" \
- --selection "cpu" \
- --selected-lanes "cpu"
+ --selection "${{ steps.lanes.outputs.selected_lanes }}" \
+ --selected-lanes "${{ steps.lanes.outputs.selected_lanes }}"
- name: Merge duration reports
+ if: ${{ always() }}
run: |
python3 .github/scripts/coverage/ci_reports.py merge-durations \
--workspace "${{ github.workspace }}" \
@@ -565,11 +911,117 @@ jobs:
- name: Upload merged duration artifact
if: ${{ always() }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 We are not using newest version v6.0.0 due to very frequent issues with 'Error: Unable to make request: ECONNRESET'
with:
name: coverage-test-durations
path: coverage-test-durations-all.csv
if-no-files-found: warn
- retention-days: 14
+ retention-days: 7
compression-level: 0
overwrite: true
+
+ - name: Resolve Codecov upload files
+ id: coverage_files
+ if: ${{ always() }}
+ run: |
+ python3 .github/scripts/coverage/ci_reports.py resolve-uploads \
+ --workspace "${{ github.workspace }}" \
+ --output-file "${GITHUB_OUTPUT}"
+
+ CoverageCodecovUploads:
+ name: Coverage Codecov Upload (${{ matrix.upload.name }})
+ if: ${{ always() && needs.CoverageSummary.result != 'skipped' && needs.CoverageSummary.result != 'cancelled' }}
+ needs: CoverageSummary
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ upload:
+ - name: C++ runtime, CPU
+ artifact_name: coverage-cpp-cpu
+ output_key: cpp_cpu
+ flag: cpp-runtime-cpp-cpu
+ - name: C++ runtime, iGPU Unit
+ artifact_name: coverage-cpp-igpu-unit
+ output_key: cpp_igpu_unit
+ flag: cpp-runtime-cpp-igpu-unit
+ - name: C++ runtime, iGPU Func
+ artifact_name: coverage-cpp-igpu-func
+ output_key: cpp_igpu_func
+ flag: cpp-runtime-cpp-igpu-func
+ - name: C++ runtime, dGPU Unit
+ artifact_name: coverage-cpp-dgpu-unit
+ output_key: cpp_dgpu_unit
+ flag: cpp-runtime-cpp-dgpu-unit
+ - name: C++ runtime, dGPU Func
+ artifact_name: coverage-cpp-dgpu-func
+ output_key: cpp_dgpu_func
+ flag: cpp-runtime-cpp-dgpu-func
+ - name: Python API, CPU
+ artifact_name: coverage-python-cpu
+ output_key: python_cpu_xml
+ flag: python-api-frontend-layer-ovc-cpu
+ - name: C++ runtime, Python suite, CPU
+ artifact_name: coverage-python-cpu
+ output_key: python_cpu_info
+ flag: cpp-runtime-python-cpu
+ - name: Python API, iGPU
+ artifact_name: coverage-python-igpu
+ output_key: python_igpu_xml
+ flag: python-api-frontend-layer-ovc-igpu
+ - name: C++ runtime, Python suite, iGPU
+ artifact_name: coverage-python-igpu
+ output_key: python_igpu_info
+ flag: cpp-runtime-python-igpu
+ - name: Python API, dGPU
+ artifact_name: coverage-python-dgpu
+ output_key: python_dgpu_xml
+ flag: python-api-frontend-layer-ovc-dgpu
+ - name: C++ runtime, Python suite, dGPU
+ artifact_name: coverage-python-dgpu
+ output_key: python_dgpu_info
+ flag: cpp-runtime-python-dgpu
+ - name: JS bindings, CPU
+ artifact_name: coverage-js-cpu
+ output_key: js_cpu_lcov
+ flag: nodejs-bindings-unit-e2e-cpu
+ - name: C++ runtime, JS suite, CPU
+ artifact_name: coverage-js-cpu
+ output_key: js_cpu_info
+ flag: cpp-runtime-js-cpu
+ steps:
+ - name: Checkout sources
+ if: ${{ needs.CoverageSummary.outputs[matrix.upload.output_key] != '' }}
+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
+ timeout-minutes: 15
+ with:
+ submodules: 'false'
+
+ - name: Download coverage artifact
+ if: ${{ needs.CoverageSummary.outputs[matrix.upload.output_key] != '' }}
+ uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
+ with:
+ name: ${{ matrix.upload.artifact_name }}
+ path: ${{ github.workspace }}/artifacts/${{ matrix.upload.artifact_name }}
+
+ - name: Resolve Codecov upload file
+ id: coverage_files
+ if: ${{ needs.CoverageSummary.outputs[matrix.upload.output_key] != '' }}
+ run: |
+ python3 .github/scripts/coverage/ci_reports.py resolve-uploads \
+ --workspace "${{ github.workspace }}" \
+ --output-file "${GITHUB_OUTPUT}"
+
+ - name: Upload Codecov (${{ matrix.upload.name }})
+ if: ${{ steps.coverage_files.outputs[matrix.upload.output_key] != '' }}
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ files: ${{ steps.coverage_files.outputs[matrix.upload.output_key] }}
+ disable_search: true
+ plugins: noop
+ flags: ${{ matrix.upload.flag }}
+ 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