Skip to content

Commit 5dc7dfe

Browse files
committed
Use .env file for propagating environment variables to Docker Compose
1 parent d1920a4 commit 5dc7dfe

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ grafana-wtf changelog
66
in progress
77
===========
88
- Upgrade to ``colored==1.4.3``
9+
- Tests: Use ``.env`` file for propagating environment variables to Docker Compose
910

1011
2021-10-01 0.10.0
1112
=================

tests/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GRAFANA_VERSION=8.3.1

tests/conftest.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ def clean_environment():
1313
pass
1414

1515

16-
def update_environment():
17-
18-
# Set default Grafana version.
19-
GRAFANA_VERSION_DEFAULT = "8.1.5"
20-
if "GRAFANA_VERSION" not in os.environ:
21-
os.environ["GRAFANA_VERSION"] = GRAFANA_VERSION_DEFAULT
22-
23-
# Report about Grafana version.
24-
GRAFANA_VERSION = os.environ["GRAFANA_VERSION"]
25-
sys.stderr.write(f"INFO: Running tests against Grafana version {GRAFANA_VERSION}\n")
26-
sys.stderr.flush()
27-
28-
2916
@pytest.fixture(scope="session")
3017
def docker_compose_files(pytestconfig):
3118
"""
@@ -51,4 +38,3 @@ def docker_grafana(docker_services):
5138

5239

5340
clean_environment()
54-
update_environment()

tests/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: '3'
22
services:
33

44
grafana:
5+
container_name: grafana-wtf-test
56
image: grafana/grafana:${GRAFANA_VERSION}
67
volumes:
78
- ./grafana/datasources:/etc/grafana/provisioning/datasources/

0 commit comments

Comments
 (0)