Skip to content

Commit 5e8949f

Browse files
committed
Clear bazel folders to remove duplicate test in wrong directory
1 parent 6efbe89 commit 5e8949f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/unit/external_repository/test_external_repo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def setUpClass(cls):
3939
Copy bazelversion from main, otherwise bazelisk will download the latest
4040
bazel version.
4141
"""
42+
# The folder bazel-external_repository contains this script
43+
# and the unittest test discovery finds it.
44+
# This is why, it is imperative that these directories get cleared
45+
cls.run_command("bazel clean")
4246
super().setUpClass()
4347
try:
4448
shutil.copy("../../../.bazelversion", ".bazelversion")
@@ -49,12 +53,17 @@ def setUpClass(cls):
4953
logging.debug("No bazel version set, using system default")
5054
_, stdout, _ = cls.run_command("bazel --version")
5155
cls.BAZEL_VERSION = stdout.split(' ')[2].strip()
56+
logging.debug(cls.BAZEL_VERSION)
5257

5358
@final
5459
@classmethod
5560
def tearDownClass(cls):
5661
"""Remove bazelversion from this test"""
5762
super().tearDownClass()
63+
# The folder bazel-external_repository contains this script
64+
# and the unittest test discovery finds it.
65+
# This is why, it is imperative that these directories get cleared
66+
cls.run_command("bazel clean")
5867
try:
5968
os.remove(".bazelversion")
6069
except:

0 commit comments

Comments
 (0)