From 309829e5e3bc9fdeaf5ad01fa035e72d4e9cb460 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 29 Sep 2023 09:15:23 +0100 Subject: [PATCH] Set and make use of the `TOOLS_DISTRO_SLUG` environment variable in CI Signed-off-by: Pedro Algarvio --- noxfile.py | 12 ++++++++++++ tools/vm.py | 1 + 2 files changed, 13 insertions(+) diff --git a/noxfile.py b/noxfile.py index 22d8fedb76b..cc3723c44f3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -326,6 +326,18 @@ def _install_coverage_requirement(session): coverage_requirement = COVERAGE_REQUIREMENT if coverage_requirement is None: coverage_requirement = "coverage==7.3.1" + if IS_LINUX: + distro_slug = os.environ.get("TOOLS_DISTRO_SLUG") + if distro_slug is not None and distro_slug in ( + "centos-7", + "debian-10", + "photonos-3", + ): + # Keep the old coverage requirement version since the new one, on these + # plaforms turns the test suite quite slow. + # Unit tests don't finish before the 5 hours timeout when they should + # finish within 1 to 2 hours. + coverage_requirement = "coverage==5.2" session.install( "--progress-bar=off", coverage_requirement, silent=PIP_INSTALL_SILENT ) diff --git a/tools/vm.py b/tools/vm.py index e6ff0ade9b2..ad45dbed6f0 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -1331,6 +1331,7 @@ class VM: if not env: return write_env = {k: str(v) for (k, v) in env.items()} + write_env["TOOLS_DISTRO_SLUG"] = self.name write_env_filename = ".ci-env" write_env_filepath = tools.utils.REPO_ROOT / ".ci-env" write_env_filepath.write_text(json.dumps(write_env))