Commit 6f1d51be authored by Sandeep Kumar Pani's avatar Sandeep Kumar Pani Committed by Facebook GitHub Bot

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
parent 105cc30d
......@@ -668,11 +668,18 @@ if __name__ == "__main__":
for test in data["tests"]:
working_dir = get_property(test, "WORKING_DIRECTORY")
labels = []
machine_suffix = self.build_opts.host_type.as_tuple_string()
labels.append("tpx_test_config::buildsystem=getdeps")
labels.append("tpx_test_config::platform={}".format(machine_suffix))
if get_property(test, "DISABLED"):
labels.append("disabled")
command = test["command"]
if working_dir:
command = [cmake, "-E", "chdir", working_dir] + command
import os
tests.append(
{
"type": "custom",
......@@ -680,6 +687,10 @@ if __name__ == "__main__":
% (self.manifest.name, test["name"], machine_suffix),
"command": command,
"labels": labels,
"env": {},
"required_paths": [],
"contacts": [],
"cwd": os.getcwd(),
}
)
return tests
......@@ -689,19 +700,25 @@ if __name__ == "__main__":
# better signals for flaky tests.
retry = 0
from sys import platform
testpilot = path_search(env, "testpilot")
if testpilot and not no_testpilot:
tpx = path_search(env, "tpx")
if (tpx or testpilot) and not no_testpilot:
buck_test_info = list_tests()
import os
buck_test_info_name = os.path.join(self.build_dir, ".buck-test-info.json")
with open(buck_test_info_name, "w") as f:
json.dump(buck_test_info, f)
env.set("http_proxy", "")
env.set("https_proxy", "")
machine_suffix = self.build_opts.host_type.as_tuple_string()
runs = []
from sys import platform
if platform == "win32":
machine_suffix = self.build_opts.host_type.as_tuple_string()
testpilot_args = [
testpilot,
# Need to force the repo type otherwise testpilot on windows
......@@ -719,6 +736,15 @@ if __name__ == "__main__":
"buildsystem=getdeps",
"--print-long-results",
]
else:
testpilot_args = [
tpx,
"--buck-test-info",
buck_test_info_name,
"--retry=%d" % retry,
"-j=%s" % str(self.build_opts.num_jobs),
"--print-long-results",
]
if owner:
testpilot_args += ["--contacts", owner]
......
......@@ -154,6 +154,10 @@ _path_search_cache = {}
_not_found = object()
def tpx_path():
return "xplat/testinfra/tpx/ctp.tpx"
def path_search(env, exename, defval=None):
"""Search for exename in the PATH specified in env.
exename is eg: `ninja` and this function knows to append a .exe
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment