From 92fc76d6a6ff4140eb9936bb0bda24dc3b2ebb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Thu, 26 Mar 2026 13:46:28 +0100 Subject: [PATCH] load TEST_VALUES_FILE using dotenv --- tests/integration/env/element-admin.rc | 4 ++-- tests/integration/env/element-web.rc | 4 ++-- tests/integration/env/hookshot-with-mas.rc | 2 +- tests/integration/env/hookshot.rc | 2 +- .../env/matrix-authentication-service-syn2mas.rc | 4 ++-- .../integration/env/matrix-authentication-service.rc | 4 ++-- tests/integration/env/matrix-rtc-standalone.rc | 4 ++-- tests/integration/env/matrix-rtc-synapse-wellknown.rc | 4 ++-- tests/integration/env/synapse.rc | 4 ++-- tests/integration/env/well-known-delegation.rc | 4 ++-- tests/integration/scripts.py | 5 +++-- tests/pyproject.toml | 1 + uv.lock | 11 +++++++++++ 13 files changed, 33 insertions(+), 20 deletions(-) diff --git a/tests/integration/env/element-admin.rc b/tests/integration/env/element-admin.rc index e055bd29..a611d54c 100644 --- a/tests/integration/env/element-admin.rc +++ b/tests/integration/env/element-admin.rc @@ -1,6 +1,6 @@ # Copyright 2025 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-element-admin-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-element-admin-values.yaml diff --git a/tests/integration/env/element-web.rc b/tests/integration/env/element-web.rc index 2c14a63b..5faf6ad2 100644 --- a/tests/integration/env/element-web.rc +++ b/tests/integration/env/element-web.rc @@ -1,6 +1,6 @@ # Copyright 2024 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-element-web-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-element-web-values.yaml diff --git a/tests/integration/env/hookshot-with-mas.rc b/tests/integration/env/hookshot-with-mas.rc index e51f6f64..ef0046d4 100644 --- a/tests/integration/env/hookshot-with-mas.rc +++ b/tests/integration/env/hookshot-with-mas.rc @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-hookshot-with-mas-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-hookshot-with-mas-values.yaml diff --git a/tests/integration/env/hookshot.rc b/tests/integration/env/hookshot.rc index 159dcb13..dbb18e14 100644 --- a/tests/integration/env/hookshot.rc +++ b/tests/integration/env/hookshot.rc @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-hookshot-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-hookshot-values.yaml diff --git a/tests/integration/env/matrix-authentication-service-syn2mas.rc b/tests/integration/env/matrix-authentication-service-syn2mas.rc index 8ddaca64..0c777142 100644 --- a/tests/integration/env/matrix-authentication-service-syn2mas.rc +++ b/tests/integration/env/matrix-authentication-service-syn2mas.rc @@ -1,6 +1,6 @@ # Copyright 2025 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-authentication-service-syn2mas-values.yaml \ No newline at end of file +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-authentication-service-syn2mas-values.yaml \ No newline at end of file diff --git a/tests/integration/env/matrix-authentication-service.rc b/tests/integration/env/matrix-authentication-service.rc index 8e509c73..356c15e4 100644 --- a/tests/integration/env/matrix-authentication-service.rc +++ b/tests/integration/env/matrix-authentication-service.rc @@ -1,6 +1,6 @@ # Copyright 2025 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-authentication-service-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-authentication-service-values.yaml diff --git a/tests/integration/env/matrix-rtc-standalone.rc b/tests/integration/env/matrix-rtc-standalone.rc index 8a9d4aec..179696f3 100644 --- a/tests/integration/env/matrix-rtc-standalone.rc +++ b/tests/integration/env/matrix-rtc-standalone.rc @@ -1,6 +1,6 @@ # Copyright 2025 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-rtc-standalone-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-rtc-standalone-values.yaml diff --git a/tests/integration/env/matrix-rtc-synapse-wellknown.rc b/tests/integration/env/matrix-rtc-synapse-wellknown.rc index 985782fb..fb3960bb 100644 --- a/tests/integration/env/matrix-rtc-synapse-wellknown.rc +++ b/tests/integration/env/matrix-rtc-synapse-wellknown.rc @@ -1,6 +1,6 @@ # Copyright 2025 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-rtc-synapse-wellknown-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-rtc-synapse-wellknown-values.yaml diff --git a/tests/integration/env/synapse.rc b/tests/integration/env/synapse.rc index 11bf522e..9f70f4b7 100644 --- a/tests/integration/env/synapse.rc +++ b/tests/integration/env/synapse.rc @@ -1,6 +1,6 @@ # Copyright 2024 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-synapse-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-synapse-values.yaml diff --git a/tests/integration/env/well-known-delegation.rc b/tests/integration/env/well-known-delegation.rc index 6a5fa3f6..e3180d7d 100644 --- a/tests/integration/env/well-known-delegation.rc +++ b/tests/integration/env/well-known-delegation.rc @@ -1,6 +1,6 @@ # Copyright 2024 New Vector Ltd -# Copyright 2025 Element Creations Ltd +# Copyright 2025-2026 Element Creations Ltd # # SPDX-License-Identifier: AGPL-3.0-only -export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-well-known-values.yaml +TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-well-known-values.yaml diff --git a/tests/integration/scripts.py b/tests/integration/scripts.py index 8e5dfdf4..207aa609 100644 --- a/tests/integration/scripts.py +++ b/tests/integration/scripts.py @@ -18,12 +18,13 @@ def run_tests(): import os import pytest + from dotenv import load_dotenv if not args: args = [] - test_values_file = HERE / "env" / f"{test_suite}.rc" - os.environ["TEST_VALUES_FILE"] = str(test_values_file) + test_suite_rc = HERE / "env" / f"{test_suite}.rc" + load_dotenv(test_suite_rc) if additional_test_values_file: os.environ["ADDITIONAL_TEST_VALUES_FILE"] = additional_test_values_file diff --git a/tests/pyproject.toml b/tests/pyproject.toml index 47a0fddf..dbb98f40 100644 --- a/tests/pyproject.toml +++ b/tests/pyproject.toml @@ -25,6 +25,7 @@ dependencies = [ "semver>=3.0.4", "rapidfuzz>=3.14.3", "pytest-asyncio-cooperative>=0.40.0", + "python-dotenv>=1.2.2", ] diff --git a/uv.lock b/uv.lock index c96bb6af..22b8e21d 100644 --- a/uv.lock +++ b/uv.lock @@ -856,6 +856,7 @@ dependencies = [ { name = "pytest" }, { name = "pytest-asyncio-cooperative" }, { name = "pytest-kubernetes" }, + { name = "python-dotenv" }, { name = "python-on-whales" }, { name = "pyyaml" }, { name = "rapidfuzz" }, @@ -878,6 +879,7 @@ requires-dist = [ { name = "pytest", specifier = ">=8.4.2" }, { name = "pytest-asyncio-cooperative", specifier = ">=0.40.0" }, { name = "pytest-kubernetes", specifier = ">=0.7.2" }, + { name = "python-dotenv", specifier = ">=1.2.2" }, { name = "python-on-whales", specifier = ">=0.80.0" }, { name = "pyyaml", specifier = ">=6.0.3" }, { name = "rapidfuzz", specifier = ">=3.14.3" }, @@ -2298,6 +2300,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0a/66/af49103279c07900b89b7ebac53111910aa8eb6d898be0b47220036b0b03/python_debian-1.1.0-py3-none-any.whl", hash = "sha256:3e553b6d0b886272a26649e13106e33c382bcd21c80b09f5c0c81fc7c8c8c743", size = 137984, upload-time = "2026-02-09T02:13:22.54Z" }, ] +[[package]] +name = "python-dotenv" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" }, +] + [[package]] name = "python-magic" version = "0.4.27"