From 59ba316b6562db4af1b7523e69919f09c93af4d4 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 3 Sep 2019 17:07:16 -0700 Subject: [PATCH] getdeps: assign test owner in continuous runs Summary: Feed the first-party oncall data through to the testpilot invocation. This will set the owner of the test in continuous runs. The oncall is passed through via the sandcastle module, which means that you will have to manually pass it through for local testing (see test plan), but it should automatically get picked up when sandcastle schedules the `test` step of the job. Reviewed By: chadaustin Differential Revision: D17146802 fbshipit-source-id: a4f0e65853a46ed8709594c96db859ede2530b00 --- build/fbcode_builder/getdeps.py | 7 ++++++- build/fbcode_builder/getdeps/builder.py | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 7e5ee1659..8f7b82cda 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -386,7 +386,11 @@ class TestCmd(ProjectCmdBase): builder = m.create_builder( loader.build_opts, src_dir, build_dir, inst_dir, ctx ) - builder.run_tests(install_dirs, schedule_type=args.schedule_type) + builder.run_tests( + install_dirs, + schedule_type=args.schedule_type, + owner=args.test_owner, + ) install_dirs.append(inst_dir) @@ -394,6 +398,7 @@ class TestCmd(ProjectCmdBase): parser.add_argument( "--schedule-type", help="Indicates how the build was activated" ) + parser.add_argument("--test-owner", help="Owner for testpilot") def get_arg_var_name(args): diff --git a/build/fbcode_builder/getdeps/builder.py b/build/fbcode_builder/getdeps/builder.py index 8b0447fb3..e1afda101 100644 --- a/build/fbcode_builder/getdeps/builder.py +++ b/build/fbcode_builder/getdeps/builder.py @@ -75,7 +75,7 @@ class BuilderBase(object): self._build(install_dirs=install_dirs, reconfigure=reconfigure) - def run_tests(self, install_dirs, schedule_type): + def run_tests(self, install_dirs, schedule_type, owner): """ Execute any tests that we know how to run. If they fail, raise an exception. """ pass @@ -408,7 +408,7 @@ if __name__ == "__main__": env=env, ) - def run_tests(self, install_dirs, schedule_type): + def run_tests(self, install_dirs, schedule_type, owner): env = self._compute_env(install_dirs) ctest = path_search(env, "ctest") cmake = path_search(env, "cmake") @@ -484,6 +484,9 @@ if __name__ == "__main__": "buildsystem=getdeps", ] + if owner: + testpilot_args += ["--contacts", owner] + if schedule_type == "continuous": runs.append( [