From 12d25c26dbae004a2a4c78786f96acf781ad034e Mon Sep 17 00:00:00 2001 From: Samuel Remis Date: Mon, 15 Apr 2024 15:35:42 -0400 Subject: [PATCH 1/2] Updated tests CI script to be able to take inputs for markers and junit output --- pyproject.toml | 1 + scripts/ci/run-tests | 14 ++++++++++++++ tests/functional/test_paginator_config.py | 1 + 3 files changed, 16 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 71db99e393..5b2146b409 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [tool.pytest.ini_options] markers = [ "slow: marks tests as slow", + "validates_models: marks tests as one which validates service models", ] [tool.isort] diff --git a/scripts/ci/run-tests b/scripts/ci/run-tests index ea7b2db3d9..b0d35efee4 100755 --- a/scripts/ci/run-tests +++ b/scripts/ci/run-tests @@ -36,6 +36,10 @@ def process_args(args): test_args += "-n auto --dist=loadfile --maxprocesses=4 " if args.with_cov: test_args += f"--cov={PACKAGE} --cov-report xml " + if args.junitxmlfile: + test_args += f"--junitxml={args.junitxmlfile} " + if args.marker: + test_args += f"-m {args.marker} " dirs = " ".join(args.test_dirs) return runner, test_args, dirs @@ -69,6 +73,16 @@ if __name__ == "__main__": action="store_true", help="Run default test-runner with parallelization.", ) + parser.add_argument( + "-j", + "--junitxmlfile", + help="Run default test-runner with junix xml output at given path.", + ) + parser.add_argument( + "-m", + "--marker", + help="Run only tests with a given marker.", + ) raw_args = parser.parse_args() test_runner, test_args, test_dirs = process_args(raw_args) diff --git a/tests/functional/test_paginator_config.py b/tests/functional/test_paginator_config.py index 3b159416d3..418a029da4 100644 --- a/tests/functional/test_paginator_config.py +++ b/tests/functional/test_paginator_config.py @@ -150,6 +150,7 @@ def _pagination_configs(): yield (op_name, single_config, service_model) +@pytest.mark.validates_models @pytest.mark.parametrize( "operation_name, page_config, service_model", _pagination_configs() ) From 25f219cdfe8f5f01dd44bd6e30e6b3a2c0173e4f Mon Sep 17 00:00:00 2001 From: Samuel Remis Date: Mon, 22 Apr 2024 11:22:45 -0400 Subject: [PATCH 2/2] remove changes to run-tests --- scripts/ci/run-tests | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/ci/run-tests b/scripts/ci/run-tests index b0d35efee4..ea7b2db3d9 100755 --- a/scripts/ci/run-tests +++ b/scripts/ci/run-tests @@ -36,10 +36,6 @@ def process_args(args): test_args += "-n auto --dist=loadfile --maxprocesses=4 " if args.with_cov: test_args += f"--cov={PACKAGE} --cov-report xml " - if args.junitxmlfile: - test_args += f"--junitxml={args.junitxmlfile} " - if args.marker: - test_args += f"-m {args.marker} " dirs = " ".join(args.test_dirs) return runner, test_args, dirs @@ -73,16 +69,6 @@ if __name__ == "__main__": action="store_true", help="Run default test-runner with parallelization.", ) - parser.add_argument( - "-j", - "--junitxmlfile", - help="Run default test-runner with junix xml output at given path.", - ) - parser.add_argument( - "-m", - "--marker", - help="Run only tests with a given marker.", - ) raw_args = parser.parse_args() test_runner, test_args, test_dirs = process_args(raw_args)