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__": ...@@ -668,11 +668,18 @@ if __name__ == "__main__":
for test in data["tests"]: for test in data["tests"]:
working_dir = get_property(test, "WORKING_DIRECTORY") working_dir = get_property(test, "WORKING_DIRECTORY")
labels = [] 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"): if get_property(test, "DISABLED"):
labels.append("disabled") labels.append("disabled")
command = test["command"] command = test["command"]
if working_dir: if working_dir:
command = [cmake, "-E", "chdir", working_dir] + command command = [cmake, "-E", "chdir", working_dir] + command
import os
tests.append( tests.append(
{ {
"type": "custom", "type": "custom",
...@@ -680,6 +687,10 @@ if __name__ == "__main__": ...@@ -680,6 +687,10 @@ if __name__ == "__main__":
% (self.manifest.name, test["name"], machine_suffix), % (self.manifest.name, test["name"], machine_suffix),
"command": command, "command": command,
"labels": labels, "labels": labels,
"env": {},
"required_paths": [],
"contacts": [],
"cwd": os.getcwd(),
} }
) )
return tests return tests
...@@ -689,36 +700,51 @@ if __name__ == "__main__": ...@@ -689,36 +700,51 @@ if __name__ == "__main__":
# better signals for flaky tests. # better signals for flaky tests.
retry = 0 retry = 0
from sys import platform
testpilot = path_search(env, "testpilot") 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() buck_test_info = list_tests()
import os
buck_test_info_name = os.path.join(self.build_dir, ".buck-test-info.json") buck_test_info_name = os.path.join(self.build_dir, ".buck-test-info.json")
with open(buck_test_info_name, "w") as f: with open(buck_test_info_name, "w") as f:
json.dump(buck_test_info, f) json.dump(buck_test_info, f)
env.set("http_proxy", "") env.set("http_proxy", "")
env.set("https_proxy", "") env.set("https_proxy", "")
machine_suffix = self.build_opts.host_type.as_tuple_string()
runs = [] runs = []
from sys import platform
testpilot_args = [
testpilot, if platform == "win32":
# Need to force the repo type otherwise testpilot on windows machine_suffix = self.build_opts.host_type.as_tuple_string()
# can be confused (presumably sparse profile related) testpilot_args = [
"--force-repo", testpilot,
"fbcode", # Need to force the repo type otherwise testpilot on windows
"--force-repo-root", # can be confused (presumably sparse profile related)
self.build_opts.fbsource_dir, "--force-repo",
"--buck-test-info", "fbcode",
buck_test_info_name, "--force-repo-root",
"--retry=%d" % retry, self.build_opts.fbsource_dir,
"-j=%s" % str(self.build_opts.num_jobs), "--buck-test-info",
"--test-config", buck_test_info_name,
"platform=%s" % machine_suffix, "--retry=%d" % retry,
"buildsystem=getdeps", "-j=%s" % str(self.build_opts.num_jobs),
"--print-long-results", "--test-config",
] "platform=%s" % machine_suffix,
"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: if owner:
testpilot_args += ["--contacts", owner] testpilot_args += ["--contacts", owner]
......
...@@ -154,6 +154,10 @@ _path_search_cache = {} ...@@ -154,6 +154,10 @@ _path_search_cache = {}
_not_found = object() _not_found = object()
def tpx_path():
return "xplat/testinfra/tpx/ctp.tpx"
def path_search(env, exename, defval=None): def path_search(env, exename, defval=None):
"""Search for exename in the PATH specified in env. """Search for exename in the PATH specified in env.
exename is eg: `ninja` and this function knows to append a .exe 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