diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8ee9c96..9a51d2642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Use pipenv for python dependency management. #1091 - Moved unit tests to a dedicated `tests/` directory to improve pytest collection time. #1102 +- Added `--run-performance-tests` flag to BB tests. If this flag is not specified, + performance tests are skipped. ### Fixed - Attempted to delete a directory when monkey config reset was called. #1054 diff --git a/envs/monkey_zoo/blackbox/conftest.py b/envs/monkey_zoo/blackbox/conftest.py index 9004ae921..cc608fae8 100644 --- a/envs/monkey_zoo/blackbox/conftest.py +++ b/envs/monkey_zoo/blackbox/conftest.py @@ -22,10 +22,10 @@ def pytest_addoption(parser): "instead will just test performance of already present island state.", ) parser.addoption( - "--no-performance-tests", + "--run-performance-tests", action="store_true", default=False, - help="If enabled all performance tests will be skipped.", + help="If enabled performance tests will be run.", ) @@ -45,7 +45,9 @@ def quick_performance_tests(request): def pytest_runtest_setup(item): - if "no_performance_tests" in item.keywords and item.config.getoption("--no-performance-tests"): + if "run_performance_tests" in item.keywords and not item.config.getoption( + "--run-performance-tests" + ): pytest.skip( - "Skipping performance test because " "--no-performance-tests flag is specified." + "Skipping performance test because " "--run-performance-tests flag isn't specified." ) diff --git a/envs/monkey_zoo/blackbox/test_blackbox.py b/envs/monkey_zoo/blackbox/test_blackbox.py index 0d90fc6c6..4de60ef55 100644 --- a/envs/monkey_zoo/blackbox/test_blackbox.py +++ b/envs/monkey_zoo/blackbox/test_blackbox.py @@ -254,15 +254,15 @@ class TestMonkeyBlackbox: LOGGER.error("This test doesn't support 'quick_performance_tests' option.") assert False - @pytest.mark.no_performance_tests + @pytest.mark.run_performance_tests def test_report_generation_from_fake_telemetries(self, island_client, quick_performance_tests): ReportGenerationFromTelemetryTest(island_client, quick_performance_tests).run() - @pytest.mark.no_performance_tests + @pytest.mark.run_performance_tests def test_map_generation_from_fake_telemetries(self, island_client, quick_performance_tests): MapGenerationFromTelemetryTest(island_client, quick_performance_tests).run() - @pytest.mark.no_performance_tests + @pytest.mark.run_performance_tests def test_telem_performance(self, island_client, quick_performance_tests): TelemetryPerformanceTest( island_client, quick_performance_tests