From e778684327dc48dd9890f4443ae63f66baed68a7 Mon Sep 17 00:00:00 2001 From: katriendg Date: Thu, 23 Apr 2026 14:05:29 +0200 Subject: [PATCH] fix(ci): restore data-pipeline and training tests broken by #270 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move test_cli_args.py from data-pipeline/capture/tests to training/tests (tests RSL-RL CLI, not data-pipeline); switch to load_training_module helper - Replace missing common.config_models import in test_config_models_hypothesis.py with sys.path + models.config_models pattern used by sibling test file - Add matching E402 per-file ruff ignore for the hypothesis test PR validation skipped pytest-data-pipeline because the path filter only triggers on data-pipeline/capture/ changes, so the regression landed via #541 which touched training/ only. 🤖 - Generated by Copilot --- .../tests/test_config_models_hypothesis.py | 16 ++++++++++++---- pyproject.toml | 1 + .../capture => training}/tests/test_cli_args.py | 7 ++++++- 3 files changed, 19 insertions(+), 5 deletions(-) rename {data-pipeline/capture => training}/tests/test_cli_args.py (96%) diff --git a/data-pipeline/capture/tests/test_config_models_hypothesis.py b/data-pipeline/capture/tests/test_config_models_hypothesis.py index 83a8390a..b35b1170 100644 --- a/data-pipeline/capture/tests/test_config_models_hypothesis.py +++ b/data-pipeline/capture/tests/test_config_models_hypothesis.py @@ -1,9 +1,20 @@ """Hypothesis property-based tests for ROS 2 edge recording configuration models.""" +import sys import tempfile +from pathlib import Path import pytest -from common.config_models import ( +from hypothesis import assume, given +from hypothesis import strategies as st +from pydantic import ValidationError + +# data-pipeline contains a hyphen, making it an invalid Python package name. +_CAPTURE_DIR = str(Path(__file__).resolve().parent.parent) +if _CAPTURE_DIR not in sys.path: + sys.path.insert(0, _CAPTURE_DIR) + +from models.config_models import ( DiskThresholds, GapDetectionConfig, GpioTriggerConfig, @@ -12,9 +23,6 @@ TopicConfig, VrTriggerConfig, ) -from hypothesis import assume, given -from hypothesis import strategies as st -from pydantic import ValidationError @given( diff --git a/pyproject.toml b/pyproject.toml index 845055f1..894457d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ select = [ "training/rl/scripts/rsl_rl/*.py" = ["E402"] "data-management/viewer/backend/tests/*.py" = ["E402"] "data-pipeline/capture/tests/test_config_models.py" = ["E402"] +"data-pipeline/capture/tests/test_config_models_hypothesis.py" = ["E402"] [tool.ruff.lint.isort] known-first-party = ["training"] diff --git a/data-pipeline/capture/tests/test_cli_args.py b/training/tests/test_cli_args.py similarity index 96% rename from data-pipeline/capture/tests/test_cli_args.py rename to training/tests/test_cli_args.py index ed79974b..85fcf1d0 100644 --- a/data-pipeline/capture/tests/test_cli_args.py +++ b/training/tests/test_cli_args.py @@ -6,7 +6,12 @@ from types import SimpleNamespace import pytest -from common.cli_args import add_rsl_rl_args, update_rsl_rl_cfg + +from .conftest import load_training_module + +_CLI_ARGS = load_training_module("training_rl_cli_args", "training/rl/cli_args.py") +add_rsl_rl_args = _CLI_ARGS.add_rsl_rl_args +update_rsl_rl_cfg = _CLI_ARGS.update_rsl_rl_cfg class TestAddRslRlArgs: