Skip to content

Tests refactor - #263

Open
kozlov721 wants to merge 67 commits into
mainfrom
tests/improvement
Open

Tests refactor#263
kozlov721 wants to merge 67 commits into
mainfrom
tests/improvement

Conversation

@kozlov721

@kozlov721 kozlov721 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Previous tests were insufficient. This PR completely refactors the tests, adding coverage reporting and simplified CI.

Specification

  • Adds new tests/conversion tests for more reliable testing of model conversions
  • More properly tested NN Archive conversion, TFLITE, multi-stage conversion
  • 100 % coverage (virtually) for the conversion part of modelconverter
  • --dev flag now also installs the dev requirements to the image and mounts tests/ from PWD
    • Makes it possible to run tests with modelconverter shell rvc4 --dev -c 'pytest -x'
  • benchmarking tests kept unchanged

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

AI Usage

Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]

Submitted code was reviewed by a human: YES/NO

The author is taking the responsibility for the contribution: YES/NO

Summary by CodeRabbit

  • New Features

    • Added per-input layout metadata support to image preprocessing and to how conversions/inference interpret inputs.
  • Bug Fixes

    • Fixed ONNX external-data handling so non-ONNX inputs don’t trigger ONNX-only logic.
    • Improved calibration data parsing (LDF format handling) and strengthened several layout/encoding edge cases during conversion.
    • Corrected channel remapping behavior for non-color inputs.
  • Chores

    • Updated CI workflows, Docker build/dev behavior, and test suite structure; refreshed README badges and tooling/coverage configuration.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR consolidates CI workflows, adds Docker development support, introduces layout-aware preprocessing, updates conversion behavior, replaces legacy package tests with host-side unit tests, and adds broad cross-platform conversion, precision, archive, calibration, evaluation, and type coverage.

Changes

CI and development environment

Layer / File(s) Summary
Consolidated CI and development setup
.github/workflows/ci.yaml, .github/workflows/publish.yaml, docker/*/Dockerfile, pyproject.toml, requirements-dev.txt, tests/conftest.py
Adds matrix CI with unit and integration jobs, development Docker builds, pytest/coverage configuration, updated tooling, and target-specific test selection. Legacy platform-specific workflows are removed.

Runtime conversion behavior

Layer / File(s) Summary
Layout-aware inference and exporter updates
modelconverter/packages/*, modelconverter/utils/image.py, modelconverter/utils/docker_utils.py
Propagates input layouts through inferers and image loading, adjusts color handling, calibration preparation, external-data handling, Docker mounts, environment forwarding, and backend-specific conversion behavior.

Conversion and evaluation coverage

Layer / File(s) Summary
Cross-platform conversion, precision, and evaluation tests
tests/conversion/*, tests/helpers/*
Adds generated model factories, reference inference, precision utilities, real-model metric checks, archive helpers, and conversion tests covering calibration formats, external data, multistage flows, encodings, compilation, and expected failures.

Host-side unit tests

Layer / File(s) Summary
Unit-test isolation and utility coverage
tests/unit/*, tests/conftest.py
Adds isolated fixtures and tests for configuration, calibration data, filesystem operations, metadata, image processing, layouts, encodings, environment handling, getters, archive processing, evaluation helpers, target versions, and data types.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: klemen1999, tersekmatija, conorsim

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague and generic to describe the main change in the PR. Use a more specific title, e.g. "Refactor test suite and add conversion coverage".
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tests/improvement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@kozlov721
kozlov721 force-pushed the tests/improvement branch from f295733 to c0f6bf2 Compare July 25, 2026 19:26
@kozlov721
kozlov721 requested review from conorsim, klemen1999 and tersekmatija and removed request for a team July 26, 2026 21:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
modelconverter/packages/hailo/exporter.py (1)

240-256: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Log configured normalization parameters ignored for non-3-channel Hailo inputs.

In HailoExporter._get_alls, inp.scale_values and inp.mean_values are only read for values_len == 3; for 1-channel inputs the configured preprocessing is dropped silently. Add a warning when these values are present but skipped, so users know which inputs are affected.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/packages/hailo/exporter.py` around lines 240 - 256, The
HailoExporter._get_alls normalization branch silently skips configured
scale_values or mean_values for non-3-channel inputs. Add a warning in the
values_len != 3 path when either preprocessing setting is present, identifying
the affected input, while preserving the existing behavior of omitting
normalization.
🧹 Nitpick comments (1)
pyproject.toml (1)

152-154: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Measure coverage for production code only.

Including tests in source makes test and fixture implementation part of the coverage denominator, so the reported percentage no longer represents modelconverter conversion coverage. Test execution is still recorded when only the package is a source.

Proposed change
 [tool.coverage.run]
-source = ["modelconverter", "tests"]
+source = ["modelconverter"]
 relative_files = true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` around lines 152 - 154, Update the [tool.coverage.run] source
configuration to measure only the modelconverter package by removing tests from
the source list. Preserve relative_files and the existing coverage behavior
while ensuring test execution remains recorded.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modelconverter/packages/rvc2/exporter.py`:
- Around line 118-120: Update the color-input handling around the reverse-only
channel conversion so `inp.encoding.from_` and `inp.encoding.to` are changed to
BGR only when that input’s channels were actually reversed. Preserve the
original encoding for unchanged RGB→RGB inputs while retaining the relabeling
for inputs converted from RGB to BGR.

In `@tests/conversion/test_precision.py`:
- Around line 124-130: Update the comparison loop in the precision test to match
converted outputs by key rather than dictionary iteration order: assert that
reference and converted keys match, then retrieve each converted tensor using
ref_name while iterating reference.items(). Preserve the existing output-count
validation and threshold comparison behavior.

In `@tests/conversion/test_toy_integration.py`:
- Around line 218-255: Update the output comparison loop in _assert_correct to
iterate over reference.items() and retrieve each converted tensor from converted
using the corresponding ref_name key, rather than pairing reference and
converted values positionally. Preserve the existing cosine-similarity threshold
assertion and error message.

In `@tests/helpers/onnx_reference.py`:
- Around line 67-94: Update the reference-feed construction around read_image to
pass inp.layout, derive transpose from whether the configured layout ends in C,
and preserve the resulting NHWC/NCHW shape. Use the layout’s channel-axis
position when reshaping mean and scale values, while retaining scalar
broadcasting for inputs without a channel axis.

In `@tests/unit/test_environ.py`:
- Around line 27-67: Add a multiprocessing start-method guard to the affected
tests in tests/unit/test_environ.py, especially test_returns_password and
test_keyring_exception_returns_none, so they skip when the active method is not
fork. Ensure the guard runs before monkeypatch-dependent child-process
assertions, preserving the existing test behavior on fork-based platforms and
avoiding failures under spawn.

---

Outside diff comments:
In `@modelconverter/packages/hailo/exporter.py`:
- Around line 240-256: The HailoExporter._get_alls normalization branch silently
skips configured scale_values or mean_values for non-3-channel inputs. Add a
warning in the values_len != 3 path when either preprocessing setting is
present, identifying the affected input, while preserving the existing behavior
of omitting normalization.

---

Nitpick comments:
In `@pyproject.toml`:
- Around line 152-154: Update the [tool.coverage.run] source configuration to
measure only the modelconverter package by removing tests from the source list.
Preserve relative_files and the existing coverage behavior while ensuring test
execution remains recorded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f6777492-16d6-494d-9e2e-2744035a00c2

📥 Commits

Reviewing files that changed from the base of the PR and between 8fb5256 and 76a8e68.

📒 Files selected for processing (100)
  • .dockerignore
  • .github/workflows/ci.yaml
  • .github/workflows/hailo_publish.yaml
  • .github/workflows/hailo_test.yaml
  • .github/workflows/modelconverter_test.yaml
  • .github/workflows/publish.yaml
  • .github/workflows/rvc2_publish.yaml
  • .github/workflows/rvc2_test.yaml
  • .github/workflows/rvc3_publish.yaml
  • .github/workflows/rvc3_test.yaml
  • .github/workflows/rvc4_publish.yaml
  • .github/workflows/rvc4_test.yaml
  • .github/workflows/unittests.yaml
  • .pre-commit-config.yaml
  • README.md
  • docker/hailo/Dockerfile
  • docker/rvc2/Dockerfile
  • docker/rvc3/Dockerfile
  • docker/rvc4/Dockerfile
  • modelconverter/__init__.py
  • modelconverter/packages/base_exporter.py
  • modelconverter/packages/base_inferer.py
  • modelconverter/packages/getters.py
  • modelconverter/packages/hailo/exporter.py
  • modelconverter/packages/hailo/inferer.py
  • modelconverter/packages/multistage_exporter.py
  • modelconverter/packages/rvc2/exporter.py
  • modelconverter/packages/rvc2/inferer.py
  • modelconverter/packages/rvc3/exporter.py
  • modelconverter/packages/rvc4/exporter.py
  • modelconverter/packages/rvc4/inferer.py
  • modelconverter/utils/calibration_data.py
  • modelconverter/utils/config.py
  • modelconverter/utils/docker_utils.py
  • modelconverter/utils/encodings.py
  • modelconverter/utils/environ.py
  • modelconverter/utils/image.py
  • modelconverter/utils/metadata.py
  • modelconverter/utils/nn_archive.py
  • modelconverter/utils/onnx_compatibility.py
  • pyproject.toml
  • requirements-dev.txt
  • tests/conftest.py
  • tests/conversion/__init__.py
  • tests/conversion/test_conversion.py
  • tests/conversion/test_conversion_variants.py
  • tests/conversion/test_external_data.py
  • tests/conversion/test_hailo_compile.py
  • tests/conversion/test_precision.py
  • tests/conversion/test_rvc4_encodings.py
  • tests/conversion/test_toy_integration.py
  • tests/conversion/test_toy_multistage.py
  • tests/conversion/test_toy_precision.py
  • tests/conversion/test_toy_tflite.py
  • tests/helpers/__init__.py
  • tests/helpers/archive_factory.py
  • tests/helpers/conversion.py
  • tests/helpers/data.py
  • tests/helpers/onnx_factory.py
  • tests/helpers/onnx_reference.py
  • tests/helpers/precision.py
  • tests/helpers/tflite_factory.py
  • tests/test_packages/common.py
  • tests/test_packages/metrics/__init__.py
  • tests/test_packages/metrics/base_metric.py
  • tests/test_packages/metrics/mnist_metric.py
  • tests/test_packages/metrics/resnet_metric.py
  • tests/test_packages/metrics/yolov6_metric.py
  • tests/test_packages/onnx_inferer.py
  • tests/test_packages/test_cross_format_export.py
  • tests/test_packages/test_hailo.py
  • tests/test_packages/test_rvc2.py
  • tests/test_packages/test_rvc3.py
  • tests/test_packages/test_rvc4.py
  • tests/test_utils/conftest.py
  • tests/test_utils/test_config.py
  • tests/test_utils/test_filesystem.py
  • tests/test_utils/test_image.py
  • tests/test_utils/test_layout.py
  • tests/test_utils/test_modifier.py
  • tests/test_utils/test_onnx_compatibility.py
  • tests/test_utils/test_telemetry.py
  • tests/unit/__init__.py
  • tests/unit/conftest.py
  • tests/unit/test_calibration_data.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_config_legacy_yaml.py
  • tests/unit/test_encodings.py
  • tests/unit/test_environ.py
  • tests/unit/test_filesystem_utils.py
  • tests/unit/test_general.py
  • tests/unit/test_getters.py
  • tests/unit/test_image.py
  • tests/unit/test_layout.py
  • tests/unit/test_metadata.py
  • tests/unit/test_nn_archive.py
  • tests/unit/test_random_calibration.py
  • tests/unit/test_target_versions.py
  • tests/unit/test_types.py
💤 Files with no reviewable changes (30)
  • .github/workflows/hailo_test.yaml
  • .github/workflows/rvc3_publish.yaml
  • .github/workflows/rvc2_test.yaml
  • .github/workflows/rvc2_publish.yaml
  • .github/workflows/rvc3_test.yaml
  • tests/test_packages/onnx_inferer.py
  • tests/test_packages/metrics/base_metric.py
  • tests/test_packages/test_cross_format_export.py
  • .github/workflows/unittests.yaml
  • tests/test_packages/common.py
  • .github/workflows/modelconverter_test.yaml
  • .github/workflows/hailo_publish.yaml
  • tests/test_utils/conftest.py
  • tests/test_packages/metrics/mnist_metric.py
  • tests/test_packages/metrics/resnet_metric.py
  • tests/test_utils/test_image.py
  • tests/test_utils/test_telemetry.py
  • .github/workflows/rvc4_publish.yaml
  • tests/test_packages/metrics/init.py
  • tests/test_utils/test_modifier.py
  • .github/workflows/rvc4_test.yaml
  • tests/test_packages/test_rvc2.py
  • tests/test_utils/test_onnx_compatibility.py
  • tests/test_packages/test_rvc3.py
  • tests/test_packages/test_hailo.py
  • tests/test_packages/test_rvc4.py
  • tests/test_packages/metrics/yolov6_metric.py
  • tests/test_utils/test_filesystem.py
  • tests/test_utils/test_config.py
  • tests/test_utils/test_layout.py

Comment thread modelconverter/packages/rvc2/exporter.py Outdated
Comment thread tests/conversion/test_precision.py Outdated
Comment thread tests/conversion/test_toy_integration.py
Comment thread tests/helpers/onnx_reference.py
Comment thread tests/unit/test_environ.py Outdated
kozlov721 and others added 2 commits July 27, 2026 11:36
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@kozlov721
kozlov721 force-pushed the tests/improvement branch from 7aee76c to 81b34fe Compare July 27, 2026 09:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
modelconverter/packages/hailo/exporter.py (1)

246-251: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate normalization vector lengths before emitting the Hailo script.

The config parse path now accepts scalar normalization lists as [v, v, v], so non-3-channel inputs can still be serialized with legacy 3-element means/scales. Reject mismatched mean_values and scale_values before appending the normalization_... command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/packages/hailo/exporter.py` around lines 246 - 251, Validate
mean_values and scale_values in the normalization emission flow before appending
the normalization command: each vector must match values_len, rejecting
mismatched lengths, including legacy 3-element values for non-3-channel inputs.
Preserve the existing defaults for missing values and only emit normalization
after both vectors pass validation.
🧹 Nitpick comments (2)
modelconverter/packages/base_exporter.py (1)

133-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Do not exclude reachable conversion paths from coverage.

Line 133 excludes the entire simplify_onnx body, while Lines 204 and 240 hide normal cleanup and explicit validation behavior. Add focused tests/mocks and reserve pragma: no cover for genuinely untestable external failures.

Suggested change
-    def simplify_onnx(self) -> Path:  # pragma: no cover
+    def simplify_onnx(self) -> Path:

Also applies to: 204-204, 240-240

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/packages/base_exporter.py` at line 133, Remove the `pragma: no
cover` exclusions from `simplify_onnx` and the cleanup and validation branches
at the referenced locations, then add focused tests with mocks that exercise
those reachable conversion paths. Keep coverage exclusions only for genuinely
untestable external failure handling.
tests/unit/test_evaluation.py (1)

37-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing coverage for the source-floor failure branch of assert_quality.

Only the max-drop failure path is exercised; the floor-check branch (reference[metric] < floor) is never triggered by a failing case, leaving that branch uncovered.

Suggested addition
+def test_assert_quality_checks_source_floor() -> None:
+    with pytest.raises(AssertionError, match="below floor"):
+        assert_quality(
+            {"AP": 0.10},
+            {"AP": 0.10},
+            floors={"AP": 0.39},
+            max_drops={"AP": 0.03},
+            case_id="test",
+            platform="rvc4",
+        )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/test_evaluation.py` around lines 37 - 55, Add a failing test case
to test_assert_quality_checks_source_floor_and_drop that makes reference[metric]
fall below its configured floor while avoiding the max-drop condition, and
assert that assert_quality raises AssertionError with the expected floor-related
message. Keep the existing max-drop coverage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modelconverter/packages/base_exporter.py`:
- Around line 252-255: Update the calibration handling around the is_raw_input
condition so raw inputs retain an array/raw-compatible calibration configuration
when random calibration writes .npy files; do not replace it with
ImageCalibrationConfig unless the data remains image-backed and compatible with
read_img_dir. Preserve the existing image calibration behavior for non-raw
inputs.

In `@tests/conversion/test_model_evaluation.py`:
- Around line 129-172: Update the return type annotation of
_lazy_eval_components to declare all five returned tuple elements, including the
callable corresponding to get_metric_ctx, while preserving the existing parser,
metrics, and mapping callable types.

---

Outside diff comments:
In `@modelconverter/packages/hailo/exporter.py`:
- Around line 246-251: Validate mean_values and scale_values in the
normalization emission flow before appending the normalization command: each
vector must match values_len, rejecting mismatched lengths, including legacy
3-element values for non-3-channel inputs. Preserve the existing defaults for
missing values and only emit normalization after both vectors pass validation.

---

Nitpick comments:
In `@modelconverter/packages/base_exporter.py`:
- Line 133: Remove the `pragma: no cover` exclusions from `simplify_onnx` and
the cleanup and validation branches at the referenced locations, then add
focused tests with mocks that exercise those reachable conversion paths. Keep
coverage exclusions only for genuinely untestable external failure handling.

In `@tests/unit/test_evaluation.py`:
- Around line 37-55: Add a failing test case to
test_assert_quality_checks_source_floor_and_drop that makes reference[metric]
fall below its configured floor while avoiding the max-drop condition, and
assert that assert_quality raises AssertionError with the expected floor-related
message. Keep the existing max-drop coverage unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 66ee9eb5-289c-462d-bffa-22640ee4478c

📥 Commits

Reviewing files that changed from the base of the PR and between 76a8e68 and 27672e9.

📒 Files selected for processing (16)
  • .github/workflows/ci.yaml
  • docker/rvc2/Dockerfile
  • docker/rvc4/Dockerfile
  • modelconverter/packages/base_exporter.py
  • modelconverter/packages/hailo/exporter.py
  • modelconverter/packages/rvc2/exporter.py
  • modelconverter/packages/rvc4/inferer.py
  • requirements-eval.txt
  • tests/conversion/test_model_evaluation.py
  • tests/conversion/test_precision.py
  • tests/conversion/test_toy_integration.py
  • tests/helpers/evaluation.py
  • tests/helpers/onnx_reference.py
  • tests/unit/test_environ.py
  • tests/unit/test_evaluation.py
  • tests/unit/test_random_calibration.py
🚧 Files skipped from review as they are similar to previous changes (8)
  • tests/unit/test_random_calibration.py
  • modelconverter/packages/rvc2/exporter.py
  • tests/conversion/test_precision.py
  • .github/workflows/ci.yaml
  • tests/unit/test_environ.py
  • tests/helpers/onnx_reference.py
  • docker/rvc4/Dockerfile
  • tests/conversion/test_toy_integration.py

Comment thread modelconverter/packages/base_exporter.py
Comment thread tests/conversion/test_model_evaluation.py
@kozlov721
kozlov721 force-pushed the tests/improvement branch from 1854081 to 9224bc2 Compare July 28, 2026 00:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_benchmark/test_benchmark_regression.py`:
- Around line 215-216: Update test_benchmark_fps to keep the FPS validation
independent of Influx configuration: remove the mandatory influx_token
assertion, allow the conftest-provided optional token, and guard telemetry
persistence so it runs only when influx_token is available while retaining the
FPS check regardless.
- Line 225: Update the expected_fps validation in the benchmark regression test
to accept valid JSON numeric values represented as integers by normalizing
expected_fps with float(...) before comparison, rather than requiring
isinstance(expected_fps, float). Preserve rejection of non-numeric values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d7bbde0-5386-458b-b957-7c9d9ef29afe

📥 Commits

Reviewing files that changed from the base of the PR and between 57c4de3 and 1db1822.

📒 Files selected for processing (12)
  • .github/workflows/ci.yaml
  • modelconverter/utils/nn_archive.py
  • tests/conversion/test_conversion.py
  • tests/conversion/test_model_evaluation.py
  • tests/helpers/onnx_reference.py
  • tests/test_benchmark/conftest.py
  • tests/test_benchmark/test_benchmark_regression.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_nn_archive.py
  • tests/unit/test_target_versions.py
  • tests/unit/test_types.py
🚧 Files skipped from review as they are similar to previous changes (10)
  • tests/unit/test_target_versions.py
  • modelconverter/utils/nn_archive.py
  • tests/helpers/onnx_reference.py
  • .github/workflows/ci.yaml
  • tests/conversion/test_conversion.py
  • tests/conversion/test_model_evaluation.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_types.py
  • tests/unit/test_nn_archive.py

@kozlov721
kozlov721 force-pushed the tests/improvement branch from 29204ed to f632f62 Compare July 28, 2026 03:48
@luxonis luxonis deleted a comment from coderabbitai Bot Jul 28, 2026
@luxonis luxonis deleted a comment from coderabbitai Bot Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants