Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/unit/external_repository/test_external_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""
import logging
import os
import re
import shutil
import unittest
from typing import final
Expand Down Expand Up @@ -55,8 +56,12 @@ def setUpClass(cls):
# This file is not needed
except FileNotFoundError:
logging.debug("No bazel version set, using system default")
_, stdout, _ = cls.run_command("bazel --version")
cls.BAZEL_VERSION = stdout.split(" ")[2].strip()
_, stdout, _ = cls.run_command("bazel version --gnu_format")
match = re.search(r'bazel\s+([\d\.]+)', stdout, re.MULTILINE)
if match:
cls.BAZEL_VERSION = match.group(1)
else:
raise RuntimeError(f"Bazel version not found: {stdout}")
logging.debug("Using Bazel %s", cls.BAZEL_VERSION)

@final
Expand Down
Loading