Enhancement to tox behave tests (#2889)

* Add `etcd3` as a DCS option for behave tests in `tox.ini`

Currently behave tests run through `tox` accept only `etcd` as a DCS.

This commit adds the option of using `etcd3` too.

* Add JSON report to `tox` behave tests

This commit adds a JSON report when running behave tests through
`tox`.

That makes it easier to parse the results.

---------

Signed-off-by: Israel Barth Rubio <israel.barth@enterprisedb.com>
This commit is contained in:
Israel
2023-10-06 05:48:55 -03:00
committed by GitHub
parent efacc6c16b
commit 28a604983b

15
tox.ini
View File

@@ -125,10 +125,11 @@ commands =
--file features/Dockerfile
allowlist_externals = docker
[testenv:pg{12,13,14,15,16}-docker-behave-{etcd}-{lin,mac}]
[testenv:pg{12,13,14,15,16}-docker-behave-{etcd,etcd3}-{lin,mac}]
description = Run behaviour tests in patroni-dev docker container
setenv =
etcd: DCS=etcd
etcd3: DCS=etcd3
{[common]postgres_matrix}
CONTAINER_NAME = tox-{env_name}-{env:PYTHONHASHSEED}
labels =
@@ -149,7 +150,7 @@ commands =
--tty \
{env:PATRONI_DEV_IMAGE:patroni-dev:{env:PG_MAJOR}} \
tox run -x 'tox.env_list=py{[common]python_matrix}-behave-{env:DCS}-lin' \
-- --format plain {posargs}
-- {posargs}
allowlist_externals =
docker
@@ -159,7 +160,7 @@ platform =
; win: win32
mac: darwin
[testenv:py{36,38,39,310,311}-behave-{etcd}-{lin,win,mac}]
[testenv:py{36,38,39,310,311}-behave-{etcd,etcd3}-{lin,win,mac}]
description = Run behaviour tests (locally with tox)
deps =
-r requirements.txt
@@ -167,11 +168,15 @@ deps =
coverage
{[common]psycopg_deps}
setenv =
DCS = {env:DCS:etcd}
etcd: DCS = {env:DCS:etcd}
etcd3: DCS = {env:DCS:etcd3}
passenv =
ETCD_UNSUPPORTED_ARCH
commands =
python3 -m behave {posargs}
python3 -m behave --format json --format plain --outfile result.json {posargs}
mv result.json features/output
allowlist_externals =
mv
platform =
{[common]platforms}