From ba9713ec92b831bacd7a2393585ca7900ad8820e Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Mon, 23 Oct 2023 15:39:41 +0100 Subject: [PATCH] Fixed CI tests based uppon latest changes of tools --- .github/workflows/tox.yml | 2 +- redisbench_admin/compare/compare.py | 2 +- redisbench_admin/run_remote/remote_env.py | 2 +- redisbench_admin/run_remote/run_remote.py | 4 +++- redisbench_admin/utils/benchmark_config.py | 1 + redisbench_admin/utils/remote.py | 2 -- tests/test_common.py | 1 + tests/test_compare.py | 2 +- tests/test_export.py | 2 +- tests/test_local.py | 4 ++-- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index ba75b1c..2b70abb 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -9,7 +9,7 @@ jobs: pytest: strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.9', '3.10' ] env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true USING_COVERAGE: "3.10" diff --git a/redisbench_admin/compare/compare.py b/redisbench_admin/compare/compare.py index c292c44..62537b4 100644 --- a/redisbench_admin/compare/compare.py +++ b/redisbench_admin/compare/compare.py @@ -649,7 +649,7 @@ def get_by_strings( baseline_str = baseline_branch if comparison_branch is not None: comparison_covered = True - by_str_baseline = "branch" + by_str_comparison = "branch" comparison_str = comparison_branch if baseline_tag is not None: diff --git a/redisbench_admin/run_remote/remote_env.py b/redisbench_admin/run_remote/remote_env.py index a3470a1..1b44b5d 100644 --- a/redisbench_admin/run_remote/remote_env.py +++ b/redisbench_admin/run_remote/remote_env.py @@ -95,7 +95,7 @@ def remote_env_setup( pass else: logging.warning( - f"Even though there is a spot instance config, avoiding deploying it." + "Even though there is a spot instance config, avoiding deploying it." ) if spot_available_and_used is False: ( diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index 5a8b4f0..c6cb296 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -871,7 +871,9 @@ def run_remote_command_logic(args, project_name, project_version): ) return_code |= 1 raise Exception( - "Failed to run remote benchmark." + "Failed to run remote benchmark. {}".format( + e.__str__() + ) ) if setup_details["env"] is None: diff --git a/redisbench_admin/utils/benchmark_config.py b/redisbench_admin/utils/benchmark_config.py index b9e5eb8..41296e6 100644 --- a/redisbench_admin/utils/benchmark_config.py +++ b/redisbench_admin/utils/benchmark_config.py @@ -49,6 +49,7 @@ def parse_exporter_timemetric(metric_path: str, results_dict: dict): logging.error( "Unable to parse time-metric {}. Error: {}".format(metric_path, e.__str__()) ) + pass return datapoints_timestamp diff --git a/redisbench_admin/utils/remote.py b/redisbench_admin/utils/remote.py index fd818a6..5911b9b 100644 --- a/redisbench_admin/utils/remote.py +++ b/redisbench_admin/utils/remote.py @@ -578,8 +578,6 @@ def fetch_remote_setup_from_config( setup_type = remote_setup_property["type"] if "setup" in remote_setup_property: setup = remote_setup_property["setup"] - if "spot_instance" in remote_setup_property: - spot_path = "/terraform/" + remote_setup_property["spot_instance"] # fetch terraform folder path = "/terraform/{}-{}".format(setup_type, setup) terraform_working_dir = common_tf(branch, path, repo) diff --git a/tests/test_common.py b/tests/test_common.py index 739e93e..735943c 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -366,6 +366,7 @@ def test_extract_test_feasible_setups(): defaults_filename = "./tests/test_data/common-properties-v0.3.yml" ( default_kpis, + _, default_metrics, exporter_timemetric_path, default_specs, diff --git a/tests/test_compare.py b/tests/test_compare.py index 8a3217c..a0828b5 100644 --- a/tests/test_compare.py +++ b/tests/test_compare.py @@ -134,7 +134,7 @@ def test_compare_command_logic(): assert total_improvements == 0 assert detected_regressions == [] # ensure that we have testcases date - assert "(1 datapoints)" in comment_body + assert "0.0%" in comment_body assert ( "Detected a total of {} stable tests between versions".format(total_tests) in comment_body diff --git a/tests/test_export.py b/tests/test_export.py index b42ce9f..6f75d1f 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -90,7 +90,7 @@ def test_export_command_logic(): args = parser.parse_args( args=[ "--benchmark-result-file", - "./tests/test_data/result_report_1690282709.835491.json", + "./tests/test_data/results/result_report_1690282709.835491.json", "--exporter-spec-file", "./tests/test_data/common-properties-enterprise.yml", "--redistimeseries_host", diff --git a/tests/test_local.py b/tests/test_local.py index 9fa989b..d9fd170 100644 --- a/tests/test_local.py +++ b/tests/test_local.py @@ -124,7 +124,7 @@ def test_generate_standalone_redis_server_args(): "--dir", ".", "--loadmodule", - os.path.abspath(local_module_file), + local_module_file, ] cmd = generate_standalone_redis_server_args( @@ -156,7 +156,7 @@ def test_generate_standalone_redis_server_args(): "--dir", ".", "--loadmodule", - os.path.abspath(local_module_file), + local_module_file, "CHUNK_SIZE_BYTES", "128", ]