1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

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
This commit is contained in:
Sandeep Kumar Pani
2021-04-01 02:38:44 -07:00
committed by Facebook GitHub Bot
parent 50c5f27e05
commit ab6a30c61c
2 changed files with 50 additions and 20 deletions

View File

@@ -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,36 +700,51 @@ 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
testpilot_args = [
testpilot,
# Need to force the repo type otherwise testpilot on windows
# can be confused (presumably sparse profile related)
"--force-repo",
"fbcode",
"--force-repo-root",
self.build_opts.fbsource_dir,
"--buck-test-info",
buck_test_info_name,
"--retry=%d" % retry,
"-j=%s" % str(self.build_opts.num_jobs),
"--test-config",
"platform=%s" % machine_suffix,
"buildsystem=getdeps",
"--print-long-results",
]
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
# can be confused (presumably sparse profile related)
"--force-repo",
"fbcode",
"--force-repo-root",
self.build_opts.fbsource_dir,
"--buck-test-info",
buck_test_info_name,
"--retry=%d" % retry,
"-j=%s" % str(self.build_opts.num_jobs),
"--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:
testpilot_args += ["--contacts", owner]

View File

@@ -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