Skip to content

Commit ecdfa9c

Browse files
committed
add README.md
1 parent 4fe8d25 commit ecdfa9c

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

tests/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
# Mamonsu autotests
3+
4+
Mamonsu testing with different Postgres version, different operation systems(not supported yet). Uses docker-compose to run all services.
5+
6+
7+
## Installation
8+
9+
10+
```bash
11+
pip3 install -e requirement.txt
12+
```
13+
14+
## Usage/Examples
15+
16+
You can simly run tests with only pytest mark "bash" and it will be ran with Postgres version from env variable POSTGRES_VERSION which is specified in .env file
17+
18+
```bash
19+
pytest -m bash
20+
```
21+
22+
You can run tests with different Postgres versions with POSTGRES_VERSIONS variable
23+
24+
```bash
25+
POSTGRES_VERSIONS=12,13 pytest -m bash
26+
```
27+
28+
To run specific test you have to use -k flag with function name
29+
30+
```bash
31+
POSTGRES_VERSIONS=12,13 pytest -k test_export_zabbix_params
32+
```

tests/tests/conftest.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@ def mamonsu_container(docker_compose) -> Container: # noqa
3434
container.remove()
3535

3636

37-
def parametrize(pg_version: int) -> int:
38-
os.environ["POSTGRES_VERSION"] = str(pg_version)
39-
return pg_version
40-
41-
42-
@pytest.fixture(scope="session", params=[12, 13, 14, 15, 16, 17])
37+
@pytest.fixture(scope="session", params=os.getenv('POSTGRES_VERSIONS', str(Config().POSTGRES_VERSION)).split(','))
4338
def docker_compose(config: Config, request) -> None:
4439
subprocess.run(
4540
["docker", "rmi", f"{ContainersEnum.MAMONSU}:latest"]
4641
)
47-
4842
os.environ["POSTGRES_VERSION"] = str(request.param)
43+
4944
subprocess.run(
5045
[
5146
"docker-compose",

0 commit comments

Comments
 (0)