Skip to content

Commit 5a0efb0

Browse files
ahornbyfacebook-github-bot
authored andcommitted
fix test execution when building OSS repo with tpx on path
Summary: X-link: facebookincubator/fizz#160 X-link: facebookincubator/zstrong#1192 Fix case when testing a github repo checkout, wth tpx on path, where --no-testpilot not specified. As workaround before this lands, if in this situation pass --no-testpilot Reviewed By: bigfootjon Differential Revision: D69852662 fbshipit-source-id: 5065cdf3acae3bc9c90df89ed96eab3fc3e19906
1 parent 35b8ed6 commit 5a0efb0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build/fbcode_builder/getdeps/builder.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -979,13 +979,19 @@ def list_tests():
979979
# better signals for flaky tests.
980980
retry = 0
981981

982-
tpx = path_search(env, "tpx")
982+
tpx = None
983+
try:
984+
from .facebook.testinfra import start_run
985+
986+
tpx = path_search(env, "tpx")
987+
except ImportError:
988+
# internal testinfra not available
989+
pass
990+
983991
if tpx and not no_testpilot:
984992
buck_test_info = list_tests()
985993
import os
986994

987-
from .facebook.testinfra import start_run
988-
989995
buck_test_info_name = os.path.join(self.build_dir, ".buck-test-info.json")
990996
with open(buck_test_info_name, "w") as f:
991997
json.dump(buck_test_info, f)

0 commit comments

Comments
 (0)