Skip to content

Commit

Permalink
Set and make use of the TOOLS_DISTRO_SLUG environment variable in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Sep 29, 2023
1 parent 8c243a6 commit 309829e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions tools/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ def write_and_upload_dot_env(self, env: dict[str, str]):
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))
Expand Down

0 comments on commit 309829e

Please sign in to comment.