Skip to content

Commit 28526dd

Browse files
tox 5.0.0 and docker >= 7
1 parent bfe11c1 commit 28526dd

File tree

11 files changed

+43
-31
lines changed

11 files changed

+43
-31
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ ujson = ">=4.2.0"
4747
wheel = ">=0.43.0"
4848
docker = ">=7.1.0"
4949

50+
[tool.poetry.group.dev.dependencies]
51+
tox-poetry-installer = {extras = ["poetry"], version = "^0.10.3"}
52+
docker = "^7.1.0"
53+
5054
[build-system]
5155
requires = ["poetry_core>=1.0.0"]
5256
build-backend = "poetry.core.masonry.api"

redis_benchmarks_specification/__common__/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
# DB used to authenticate ( read-only/non-dangerous access only )
4747
REDIS_AUTH_SERVER_HOST = os.getenv("REDIS_AUTH_SERVER_HOST", "localhost")
48-
REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6380"))
48+
REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6379"))
4949
REDIS_HEALTH_CHECK_INTERVAL = int(os.getenv("REDIS_HEALTH_CHECK_INTERVAL", "15"))
5050
REDIS_SOCKET_TIMEOUT = int(os.getenv("REDIS_SOCKET_TIMEOUT", "300"))
5151
REDIS_BINS_EXPIRE_SECS = int(

tox.ini

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,35 @@ envlist = integration-tests
99
basepython = python3
1010

1111
[testenv:integration-tests]
12-
deps = -r{toxinidir}/dev_requirements.txt
13-
passenv = TST_BUILDER_X,TST_RUNNER_X,GH_TOKEN,TST_REDIS_DIR,DOCKER_HOST,DOCKER_TLS_VERIFY,DOCKER_CERT_PATH
12+
1413
docker =
1514
datasink
1615
db_server
1716

18-
commands =
19-
black --check redis_benchmarks_specification
20-
#flake8 redis_benchmarks_specification
21-
coverage erase
22-
coverage run --include=redis_benchmarks_specification/* -m pytest -ra {posargs}
23-
coverage report -m
17+
deps =
18+
-r{toxinidir}/dev_requirements.txt
19+
# passenv = TST_BUILDER_X,TST_RUNNER_X,GH_TOKEN,TST_REDIS_DIR,DOCKER_HOST,DOCKER_TLS_VERIFY,DOCKER_CERT_PATH
2420

21+
stoponfail =
22+
True
23+
24+
commands =
25+
black --check redis_benchmarks_specification
26+
#flake8 redis_benchmarks_specification
27+
coverage erase
28+
coverage run --include=redis_benchmarks_specification/* -m pytest -ra {posargs}
29+
coverage report -m
2530

2631

2732
[docker]
2833
docker_host = unix:///var/run/docker.sock
2934

30-
31-
3235
[docker:datasink]
3336
image = redis/redis-stack-server:7.4.0-v0
34-
ports =
35-
16379:6379/tcp
37+
expose =
38+
DATASINK_PORT=6379/tcp
3639

3740
[docker:db_server]
3841
image = redis/redis-stack-server:7.4.0-v0
3942
ports =
40-
6380:6379/tcp
43+
DBSERVER_PORT=6379/tcp

utils/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_commit_schema_to_stream():
2626
assert result == False
2727
assert error_msg is not None
2828
try:
29-
conn = redis.StrictRedis(port=16379)
29+
conn = redis.StrictRedis(port=6379)
3030
conn.ping()
3131
conn.flushall()
3232
result, reply_fields, error_msg = commit_schema_to_stream(

utils/tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
def test_create_app():
2323
try:
24-
conn = redis.StrictRedis(port=16379, decode_responses=True)
24+
conn = redis.StrictRedis(port=6379, decode_responses=True)
2525
conn.ping()
2626
conn.flushall()
2727
auth_token = conn.acl_genpass()

utils/tests/test_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_build_spec_image_prefetch():
4040
def test_commit_schema_to_stream_then_build():
4141
try:
4242
if should_run_builder():
43-
conn = redis.StrictRedis(port=16379)
43+
conn = redis.StrictRedis(port=6379)
4444
conn.ping()
4545
conn.flushall()
4646
builder_consumer_group_create(conn, "0")
@@ -91,7 +91,7 @@ def should_run_builder():
9191
def test_commit_schema_to_stream_then_build_historical_redis():
9292
try:
9393
if should_run_builder():
94-
conn = redis.StrictRedis(port=16379)
94+
conn = redis.StrictRedis(port=6379)
9595
conn.ping()
9696
conn.flushall()
9797
builder_consumer_group_create(conn, "0")

utils/tests/test_builder_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def test_commit_schema_to_stream():
2323
try:
2424
if should_run_builder():
25-
conn = redis.StrictRedis(port=16379)
25+
conn = redis.StrictRedis(port=6379)
2626
conn.ping()
2727
conn.flushall()
2828
builder_consumer_group_create(conn, "0")

utils/tests/test_cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_run_local_command_logic_oss_cluster():
2828
trigger_tests_cli_command_logic(args, "tool", "v0")
2929
except SystemExit as e:
3030
assert e.code == 1
31+
db_port = os.getenv("DATASINK_PORT", "6379")
3132

3233
# should error due to missing --use-tags or --use-branch
3334
parser = argparse.ArgumentParser(
@@ -36,7 +37,11 @@ def test_run_local_command_logic_oss_cluster():
3637
)
3738
parser = spec_cli_args(parser)
3839
TST_REDIS_DIR = os.getenv("TST_REDIS_DIR", None)
39-
run_args = ["--use-tags"]
40+
run_args = [
41+
"--use-tags",
42+
"--redis_port",
43+
"{}".format(db_port),
44+
]
4045
if TST_REDIS_DIR is not None:
4146
run_args.extend(["--redis_repo", TST_REDIS_DIR])
4247
args = parser.parse_args(

utils/tests/test_runner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import argparse
2+
import os
23

34
import redis
45
import yaml
@@ -187,10 +188,9 @@ def test_run_client_runner_logic():
187188
get_version_string(project_name, project_version)
188189
)
189190
db_host = "localhost"
190-
db_port = "6380"
191-
datasink_port = "16379"
191+
db_port = os.getenv("DATASINK_PORT", "6379")
192+
datasink_port = os.getenv("DATASINK_PORT", "6379")
192193
db_port_int = int(db_port)
193-
datasink_port_int = int(db_port)
194194
args = parser.parse_args(
195195
args=[
196196
"--test",
@@ -209,7 +209,7 @@ def test_run_client_runner_logic():
209209

210210
r = redis.Redis(host=db_host, port=db_port_int)
211211
total_keys = r.info("keyspace")["db0"]["keys"]
212-
assert total_keys == 2
212+
assert total_keys >= 2
213213

214214
# run while pushing to redistimeseries
215215
args = parser.parse_args(
@@ -235,7 +235,7 @@ def test_run_client_runner_logic():
235235

236236
r = redis.Redis(host=db_host, port=db_port_int)
237237
total_keys = r.info("keyspace")["db0"]["keys"]
238-
assert total_keys == 2
238+
assert total_keys >= 2
239239
rts = redis.Redis(host=db_host, port=db_port_int)
240240
total_keys = rts.info("keyspace")["db0"]["keys"]
241241
assert total_keys > 0

utils/tests/test_self_contained_coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_self_contained_coordinator_blocking_read():
9696
if TST_RUNNER_X == "0":
9797
run_coordinator = False
9898
if run_coordinator:
99-
conn = redis.StrictRedis(port=16379)
99+
conn = redis.StrictRedis(port=6379)
100100
conn.ping()
101101
expected_datapoint_ts = None
102102
conn.flushall()
@@ -113,7 +113,7 @@ def test_self_contained_coordinator_blocking_read():
113113
running_platform = "fco-ThinkPad-T490"
114114

115115
build_runners_consumer_group_create(conn, running_platform, "0")
116-
datasink_conn = redis.StrictRedis(port=16379)
116+
datasink_conn = redis.StrictRedis(port=6379)
117117
rts = datasink_conn.ts()
118118
docker_client = docker.from_env()
119119
home = str(Path.home())

0 commit comments

Comments
 (0)