Skip to content

Commit f1aff95

Browse files
Sandeep Kumar Panifacebook-github-bot
authored andcommitted
OSS jobs to tpx
Summary: Tpx works well for all OSS jobs, we should migrate to Tpx instead of relying testpilot. Reviewed By: marcelogomez Differential Revision: D27396539 fbshipit-source-id: dd1994be0eb3b4396764c1f3e68ddd6763b60139
1 parent a07b0f3 commit f1aff95

File tree

2 files changed

+51
-21
lines changed

2 files changed

+51
-21
lines changed

build/fbcode_builder/getdeps/builder.py

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -668,18 +668,29 @@ def list_tests():
668668
for test in data["tests"]:
669669
working_dir = get_property(test, "WORKING_DIRECTORY")
670670
labels = []
671+
machine_suffix = self.build_opts.host_type.as_tuple_string()
672+
labels.append("tpx_test_config::buildsystem=getdeps")
673+
labels.append("tpx_test_config::platform={}".format(machine_suffix))
674+
671675
if get_property(test, "DISABLED"):
672676
labels.append("disabled")
673677
command = test["command"]
674678
if working_dir:
675679
command = [cmake, "-E", "chdir", working_dir] + command
680+
681+
import os
682+
676683
tests.append(
677684
{
678685
"type": "custom",
679686
"target": "%s-%s-getdeps-%s"
680687
% (self.manifest.name, test["name"], machine_suffix),
681688
"command": command,
682689
"labels": labels,
690+
"env": {},
691+
"required_paths": [],
692+
"contacts": [],
693+
"cwd": os.getcwd(),
683694
}
684695
)
685696
return tests
@@ -689,36 +700,51 @@ def list_tests():
689700
# better signals for flaky tests.
690701
retry = 0
691702

703+
from sys import platform
704+
692705
testpilot = path_search(env, "testpilot")
693-
if testpilot and not no_testpilot:
706+
tpx = path_search(env, "tpx")
707+
if (tpx or testpilot) and not no_testpilot:
694708
buck_test_info = list_tests()
709+
import os
710+
695711
buck_test_info_name = os.path.join(self.build_dir, ".buck-test-info.json")
696712
with open(buck_test_info_name, "w") as f:
697713
json.dump(buck_test_info, f)
698714

699715
env.set("http_proxy", "")
700716
env.set("https_proxy", "")
701-
machine_suffix = self.build_opts.host_type.as_tuple_string()
702-
703717
runs = []
704-
705-
testpilot_args = [
706-
testpilot,
707-
# Need to force the repo type otherwise testpilot on windows
708-
# can be confused (presumably sparse profile related)
709-
"--force-repo",
710-
"fbcode",
711-
"--force-repo-root",
712-
self.build_opts.fbsource_dir,
713-
"--buck-test-info",
714-
buck_test_info_name,
715-
"--retry=%d" % retry,
716-
"-j=%s" % str(self.build_opts.num_jobs),
717-
"--test-config",
718-
"platform=%s" % machine_suffix,
719-
"buildsystem=getdeps",
720-
"--print-long-results",
721-
]
718+
from sys import platform
719+
720+
if platform == "win32":
721+
machine_suffix = self.build_opts.host_type.as_tuple_string()
722+
testpilot_args = [
723+
testpilot,
724+
# Need to force the repo type otherwise testpilot on windows
725+
# can be confused (presumably sparse profile related)
726+
"--force-repo",
727+
"fbcode",
728+
"--force-repo-root",
729+
self.build_opts.fbsource_dir,
730+
"--buck-test-info",
731+
buck_test_info_name,
732+
"--retry=%d" % retry,
733+
"-j=%s" % str(self.build_opts.num_jobs),
734+
"--test-config",
735+
"platform=%s" % machine_suffix,
736+
"buildsystem=getdeps",
737+
"--print-long-results",
738+
]
739+
else:
740+
testpilot_args = [
741+
tpx,
742+
"--buck-test-info",
743+
buck_test_info_name,
744+
"--retry=%d" % retry,
745+
"-j=%s" % str(self.build_opts.num_jobs),
746+
"--print-long-results",
747+
]
722748

723749
if owner:
724750
testpilot_args += ["--contacts", owner]

build/fbcode_builder/getdeps/envfuncs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ def add_flag(env, name, flag, append=True):
154154
_not_found = object()
155155

156156

157+
def tpx_path():
158+
return "xplat/testinfra/tpx/ctp.tpx"
159+
160+
157161
def path_search(env, exename, defval=None):
158162
"""Search for exename in the PATH specified in env.
159163
exename is eg: `ninja` and this function knows to append a .exe

0 commit comments

Comments
 (0)