Skip to content

Commit bfe11c1

Browse files
Running on tox on PR in gh
1 parent cfa8b8b commit bfe11c1

File tree

14 files changed

+479
-886
lines changed

14 files changed

+479
-886
lines changed

.github/workflows/tox.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run Tests using tox
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
pytest:
11+
strategy:
12+
matrix:
13+
python-version: [ '3.10', '3.11', '3.12' ]
14+
fail-fast: false
15+
env:
16+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
17+
USING_COVERAGE: "3.10"
18+
USING_COVERAGE_OS: "ubuntu-latest"
19+
20+
runs-on: "ubuntu-latest"
21+
name: os ${{ matrix.os }} python ${{ matrix.python-version }} Linting, testing, and compliance
22+
steps:
23+
- uses: actions/checkout@master
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install Poetry
31+
run: |
32+
curl -sSL https://install.python-poetry.org | python3 -
33+
34+
- name: Install Dev requirements
35+
run: |
36+
pip install -U setuptools wheel
37+
pip install -r dev_requirements.txt
38+
39+
- name: Run tox
40+
run: |
41+
tox
42+
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v2
45+
if: contains(env.USING_COVERAGE, matrix.python-version)
46+
with:
47+
token: ${{secrets.CODECOV_TOKEN}}
48+
fail_ci_if_error: true

dev_requirements.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
click==8.0.4
2-
black==22.3.0
3-
flake8==4.0.1
1+
click==8.1.7
2+
black==24.4.2
3+
flake8==7.1.0
44
flynt~=0.69.0
55
isort==5.10.1
66
mock==4.0.3
77
packaging>=20.4
8-
pytest==7.2.0
9-
pytest-timeout==2.0.1
10-
pytest-asyncio>=0.16.0
11-
tox==3.24.4
12-
tox-docker==4.0.0a2
13-
invoke==1.6.0
14-
pytest-cov>=3.0.0
8+
pytest==8.2.2
9+
pytest-timeout==2.3.1
10+
pytest-asyncio>=0.23.7
11+
tox>=4.16.0
12+
tox-docker>=5.0.0
13+
invoke==2.2.0
14+
pytest-cov>=5.0.0
1515
vulture>=2.3.0
1616
ujson>=4.2.0
17-
wheel>=0.30.0
17+
wheel>=0.43.0
18+
docker>=7.1.0

poetry.lock

Lines changed: 334 additions & 840 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,27 @@ typed-ast = "^1.5.0"
2525
oyaml = "^1.0"
2626
pandas = "^2.1.2"
2727
numpy = "^2.0.0"
28-
2928
jsonpath-ng = "^1.6.1"
30-
[tool.poetry.dev-dependencies]
31-
pytest = "^7.2.0"
32-
pytest-cov = "^4.0.0"
33-
black = "22.10.0"
34-
flake8 = "^6.0.0"
35-
tox-poetry-installer = {extras = ["poetry"], version = "^0.10.3"}
3629

37-
[tool.poetry.group.dev.dependencies]
38-
tox-poetry-installer = {extras = ["poetry"], version = "^0.10.3"}
39-
docker = "^7.1.0"
30+
[tool.poetry.dev-dependencies]
31+
click = "8.1.7"
32+
black = "24.4.2"
33+
flake8 = "7.1.0"
34+
flynt = "~0.69.0"
35+
isort = "5.10.1"
36+
mock = "4.0.3"
37+
packaging = ">=20.4"
38+
pytest = "8.2.2"
39+
pytest-timeout = "2.3.1"
40+
pytest-asyncio = ">=0.23.7"
41+
tox = ">=4.16.0"
42+
tox-docker = ">=5.0.0"
43+
invoke = "2.2.0"
44+
pytest-cov = ">=5.0.0"
45+
vulture = ">=2.3.0"
46+
ujson = ">=4.2.0"
47+
wheel = ">=0.43.0"
48+
docker = ">=7.1.0"
4049

4150
[build-system]
4251
requires = ["poetry_core>=1.0.0"]

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,9 @@ def builder_process_stream(
465465
assert bin_artifact_len > 0
466466
conn.set(bin_key, bytes(bin_artifact), ex=REDIS_BINS_EXPIRE_SECS)
467467
build_stream_fields[artifact] = bin_key
468-
build_stream_fields[
469-
"{}_len_bytes".format(artifact)
470-
] = bin_artifact_len
468+
build_stream_fields["{}_len_bytes".format(artifact)] = (
469+
bin_artifact_len
470+
)
471471
result = True
472472
if b"platform" in testDetails:
473473
build_stream_fields["platform"] = testDetails[b"platform"]

redis_benchmarks_specification/__cli__/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,11 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
348348
if result is True:
349349
stream_id = "n/a"
350350
if args.dry_run is False:
351-
(result, reply_fields, error_msg,) = request_build_from_commit_info(
351+
(
352+
result,
353+
reply_fields,
354+
error_msg,
355+
) = request_build_from_commit_info(
352356
conn,
353357
commit_dict,
354358
{},

redis_benchmarks_specification/__common__/runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ def exporter_datasink_common(
174174
git_hash,
175175
)
176176
logging.info("Collecting memory metrics")
177-
(_, _, overall_end_time_metrics,) = collect_redis_metrics(
177+
(
178+
_,
179+
_,
180+
overall_end_time_metrics,
181+
) = collect_redis_metrics(
178182
redis_conns,
179183
["memory"],
180184
{

redis_benchmarks_specification/__common__/timeseries.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ def from_metric_kv_to_timeserie(
334334

335335
target_table_dict[target_name] = target_value
336336

337-
target_table_dict[
338-
"{}:percent {}".format(target_name, comparison_type)
339-
] = target_value_pct_str
337+
target_table_dict["{}:percent {}".format(target_name, comparison_type)] = (
338+
target_value_pct_str
339+
)
340340
return target_table_keyname, target_table_dict
341341

342342

@@ -416,7 +416,10 @@ def extract_perversion_timeseries_from_results(
416416
):
417417
break_by_key = "version"
418418
break_by_str = "by.{}".format(break_by_key)
419-
(branch_time_series_dict, target_tables,) = common_timeseries_extraction(
419+
(
420+
branch_time_series_dict,
421+
target_tables,
422+
) = common_timeseries_extraction(
420423
break_by_key,
421424
break_by_str,
422425
datapoints_timestamp,
@@ -719,7 +722,10 @@ def common_exporter_logic(
719722
if (git_hash is not None) and (git_hash != ""):
720723
break_by_key = "hash"
721724
break_by_str = "by.{}".format(break_by_key)
722-
(per_hash_time_series_dict, hash_target_tables,) = common_timeseries_extraction(
725+
(
726+
per_hash_time_series_dict,
727+
hash_target_tables,
728+
) = common_timeseries_extraction(
723729
break_by_key,
724730
break_by_str,
725731
datapoints_timestamp,

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,10 @@ def delete_temporary_files(
758758
profiler_frequency = 99
759759

760760
# start the profile
761-
(profiler_name, profilers_map,) = profilers_start_if_required(
761+
(
762+
profiler_name,
763+
profilers_map,
764+
) = profilers_start_if_required(
762765
profilers_enabled,
763766
profilers_list,
764767
redis_pids,
@@ -823,7 +826,10 @@ def delete_temporary_files(
823826
benchmark_end_time, benchmark_start_time
824827
)
825828
)
826-
(_, overall_tabular_data_map,) = profilers_stop_if_required(
829+
(
830+
_,
831+
overall_tabular_data_map,
832+
) = profilers_stop_if_required(
827833
datasink_push_results_redistimeseries,
828834
benchmark_duration_seconds,
829835
collection_summary_str,
@@ -1069,7 +1075,10 @@ def print_results_table_stdout(
10691075
cpu_usage=None,
10701076
):
10711077
# check which metrics to extract
1072-
(_, metrics,) = merge_default_and_config_metrics(
1078+
(
1079+
_,
1080+
metrics,
1081+
) = merge_default_and_config_metrics(
10731082
benchmark_config,
10741083
default_metrics,
10751084
None,
@@ -1094,7 +1103,10 @@ def prepare_overall_total_test_results(
10941103
benchmark_config, default_metrics, results_dict, test_name, overall_results_matrix
10951104
):
10961105
# check which metrics to extract
1097-
(_, metrics,) = merge_default_and_config_metrics(
1106+
(
1107+
_,
1108+
metrics,
1109+
) = merge_default_and_config_metrics(
10981110
benchmark_config,
10991111
default_metrics,
11001112
None,

redis_benchmarks_specification/__self_contained_coordinator__/prepopulation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def data_prepopulation_step(
4343
full_benchmark_path = "/usr/local/bin/{}".format(preload_tool)
4444
client_mnt_point = "/mnt/client/"
4545
if "memtier_benchmark" in preload_tool:
46-
(_, preload_command_str,) = prepare_memtier_benchmark_parameters(
46+
(
47+
_,
48+
preload_command_str,
49+
) = prepare_memtier_benchmark_parameters(
4750
benchmark_config["dbconfig"]["preload_tool"],
4851
full_benchmark_path,
4952
port,

0 commit comments

Comments
 (0)