From 3d6bbc492f3cf1eec248f359410da4ee7f85f2df Mon Sep 17 00:00:00 2001 From: Yunchu Lee Date: Tue, 12 Sep 2023 14:22:20 +0900 Subject: [PATCH] add marker to new feature tests --- tests/conftest.py | 2 ++ tests/integration/cli/test_merge.py | 2 -- tests/integration/cli/test_tabular_format.py | 1 + tests/integration/cli/test_video.py | 1 + tests/unit/algorithms/test_corrector.py | 1 - tests/unit/data_formats/test_roboflow.py | 1 + tests/unit/test_configurable_validator.py | 1 + tests/unit/test_framework_converter.py | 1 + tests/unit/test_tabular_format.py | 1 + tests/unit/test_validator.py | 2 ++ tests/unit/test_video.py | 1 + tests/unit/transforms/test_sam_transforms.py | 1 + tox.ini | 5 ++++- 13 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index c3a43be250..9217fd88d0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,8 @@ def pytest_configure(config): config.addinivalue_line("markers", "reqids(ids): link a test with a requirement") config.addinivalue_line("markers", "bugs(ids): link a test with a bug") + config.addinivalue_line("markers", "new: mark the tests for the new features") + @pytest.fixture(scope="function") def test_dir(): diff --git a/tests/integration/cli/test_merge.py b/tests/integration/cli/test_merge.py index 0ea0a1f170..2361687e3f 100644 --- a/tests/integration/cli/test_merge.py +++ b/tests/integration/cli/test_merge.py @@ -20,7 +20,6 @@ from tests.utils.test_utils import run_datum as run -@pytest.mark.v1_3_0 class MergeTest: @pytest.fixture() def fxt_homogenous(self, test_dir): @@ -250,7 +249,6 @@ def test_merge(self, test_case, merge_policy, test_dir, helper_tc): compare_datasets(helper_tc, expected, actual, require_media=True) -@pytest.mark.v1_3_0 class IntersectMergeTest(TestCase): @mark_requirement(Requirements.DATUM_GENERAL_REQ) def test_can_run_self_merge(self): diff --git a/tests/integration/cli/test_tabular_format.py b/tests/integration/cli/test_tabular_format.py index f062bf8078..be617e4503 100644 --- a/tests/integration/cli/test_tabular_format.py +++ b/tests/integration/cli/test_tabular_format.py @@ -46,6 +46,7 @@ def fxt_buddy(fxt_buddy_path, fxt_buddy_target): yield Dataset.import_from(fxt_buddy_path, "tabular", target=fxt_buddy_target) +@pytest.mark.new class TabularIntegrationTest: @mark_requirement(Requirements.DATUM_GENERAL_REQ) @pytest.mark.parametrize( diff --git a/tests/integration/cli/test_video.py b/tests/integration/cli/test_video.py index 05ce77a383..37742c8d16 100644 --- a/tests/integration/cli/test_video.py +++ b/tests/integration/cli/test_video.py @@ -140,6 +140,7 @@ def test_can_extract_keyframes_from_video(self): compare_datasets(self, expected, parsed_dataset) + @pytest.mark.new @mark_requirement(Requirements.DATUM_GENERAL_REQ) def test_can_export_video_dataset(self): with TestDir() as test_dir: diff --git a/tests/unit/algorithms/test_corrector.py b/tests/unit/algorithms/test_corrector.py index ecf2f1eb22..b9ae6ffeab 100644 --- a/tests/unit/algorithms/test_corrector.py +++ b/tests/unit/algorithms/test_corrector.py @@ -827,7 +827,6 @@ def fxt_refined_det_dataset(fxt_original_det_dataset): return refined -@pytest.mark.v1_3_0 class ValidationCorrectionTest: @pytest.mark.parametrize( "fxt_original_dataset, fxt_validator, fxt_refined_dataset", diff --git a/tests/unit/data_formats/test_roboflow.py b/tests/unit/data_formats/test_roboflow.py index 428a3e961f..77bc06a5dc 100644 --- a/tests/unit/data_formats/test_roboflow.py +++ b/tests/unit/data_formats/test_roboflow.py @@ -292,6 +292,7 @@ def fxt_tfrecord_dataset(): IDS = ["COCO", "VOC", "YOLO", "YOLO_OBB", "CREATE_ML", "MULTICLASS"] +@pytest.mark.new class RoboflowImporterTest(TestDataFormatBase): @pytest.mark.parametrize( ["fxt_dataset_dir", "importer"], diff --git a/tests/unit/test_configurable_validator.py b/tests/unit/test_configurable_validator.py index 5dbca937f5..58f8cf7861 100644 --- a/tests/unit/test_configurable_validator.py +++ b/tests/unit/test_configurable_validator.py @@ -469,6 +469,7 @@ def fxt_dataset(): } +@pytest.mark.new class ConfigurableValidatorTest: @pytest.mark.parametrize( "fxt_tasks,fxt_warnings", diff --git a/tests/unit/test_framework_converter.py b/tests/unit/test_framework_converter.py index db2a10bab4..3c0fb9efb5 100644 --- a/tests/unit/test_framework_converter.py +++ b/tests/unit/test_framework_converter.py @@ -142,6 +142,7 @@ def fxt_dataset(): ) +@pytest.mark.new @mark_requirement(Requirements.DATUM_GENERAL_REQ) class FrameworkConverterFactoryTest(TestCase): @skipIf(not TORCH_AVAILABLE, reason="PyTorch is not installed") diff --git a/tests/unit/test_tabular_format.py b/tests/unit/test_tabular_format.py index 5a7a32bfbf..953e4ccedc 100644 --- a/tests/unit/test_tabular_format.py +++ b/tests/unit/test_tabular_format.py @@ -38,6 +38,7 @@ def fxt_buddy(fxt_tabular_root, fxt_buddy_target): yield Dataset.import_from(path, "tabular", target=fxt_buddy_target) +@pytest.mark.new class TabularImporterTest: @mark_requirement(Requirements.DATUM_GENERAL_REQ) def test_can_import_tabular_file(self, txf_electricity) -> None: diff --git a/tests/unit/test_validator.py b/tests/unit/test_validator.py index 1942487d6b..3b98d683ed 100644 --- a/tests/unit/test_validator.py +++ b/tests/unit/test_validator.py @@ -6,6 +6,7 @@ from unittest import TestCase import numpy as np +import pytest from datumaro.components.annotation import ( AnnotationType, @@ -894,6 +895,7 @@ def test_validate_annotations_classification(self): self.assertEqual(actual_summary, expected_summary) + @pytest.mark.new @mark_requirement(Requirements.DATUM_GENERAL_REQ) def test_validate_multilabel_annotations_classification(self): label_cat = LabelCategories.from_iterable(["car", "bicycle", "dog", "cat", "plate", "pan"]) diff --git a/tests/unit/test_video.py b/tests/unit/test_video.py index eb166d0bf7..73d4eba23e 100644 --- a/tests/unit/test_video.py +++ b/tests/unit/test_video.py @@ -250,6 +250,7 @@ def test_can_release_resources_on_checkout(self, fxt_sample_video): assert len(project.working_tree.make_dataset()) == 1 +@pytest.mark.new class VideoAnnotationTest: @mark_requirement(Requirements.DATUM_GENERAL_REQ) @pytest.mark.parametrize("dataset_format", ["datumaro", "datumaro_binary"]) diff --git a/tests/unit/transforms/test_sam_transforms.py b/tests/unit/transforms/test_sam_transforms.py index 9885172169..aa4494d1eb 100644 --- a/tests/unit/transforms/test_sam_transforms.py +++ b/tests/unit/transforms/test_sam_transforms.py @@ -46,6 +46,7 @@ def create_bbox_item(n_bboxes: int, n_labels: int, idx: int) -> DatasetItem: return DatasetItem(id=f"test_{idx}", media=media, annotations=annotations) +@pytest.mark.new class SAMModelInterpreterTest: def test_encoder(self): interp = SAMEncoderInterpreter() diff --git a/tox.ini b/tox.ini index 2ccc24ec76..ec45546147 100644 --- a/tox.ini +++ b/tox.ini @@ -74,14 +74,17 @@ commands = [testenv:validation] commands = - python -m pytest -v --csv={toxworkdir}/results_val_{envname}.csv -m {posargs:v1_3_0} + python -m pytest -v --csv={toxworkdir}/results_val_{envname}.csv -m {posargs:new} [testenv:stability-{darwin,lin,win}] deps = {[testenv]deps} pytest-loop +allowlist_externals = + bash commands_pre = + bash -c 'cargo -V; echo "cargo (rust) version checking exit code = $?"' python -m pip uninstall pytest-stress -y commands = python -m pytest -v --csv={toxworkdir}/results-{envname}.csv -x {posargs:--loop 5}