From 28425635bff2f5955cf9f34f2b4b554dde322b64 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 24 May 2019 14:09:26 -0700 Subject: [PATCH] getdeps: configure testpilot to use collections and tag tests Summary: This should enable test pilot to skip broken/flakey tests. The `--tag-new-tests` flag is only appropriate for code that has been landed on master and is used by the FB infra to classify new tests appropriately. For continuous builds we use a test collection with different parameters from the normal developer facing flow so that the infra can re-assess their status and enable/disable high-signal/noisy tests. Depends: D15495344 Reviewed By: Ben0mega Differential Revision: D15500955 fbshipit-source-id: f3b7976cec6a5cf70f5d128b38bde11620b26918 --- build/fbcode_builder/getdeps/builder.py | 74 ++++++++++++++++++++----- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/build/fbcode_builder/getdeps/builder.py b/build/fbcode_builder/getdeps/builder.py index 0684cea4d..5f4339280 100644 --- a/build/fbcode_builder/getdeps/builder.py +++ b/build/fbcode_builder/getdeps/builder.py @@ -329,21 +329,65 @@ class CMakeBuilder(BuilderBase): env.set("http_proxy", "") env.set("https_proxy", "") - self._run_cmd( - [ - 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, - ], - cwd=self.build_opts.fbcode_builder_dir, - env=env, - ) + + runs = [] + + 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, + ] + + if schedule_type == "continuous": + runs.append( + [ + "--tag-new-tests", + "--collection", + "oss-continuous", + "--purpose", + "continuous", + ] + ) + elif schedule_type == "testwarden": + # One run to assess new tests + runs.append( + [ + "--tag-new-tests", + "--collection", + "oss-new-test-stress", + "--stress-runs", + "10", + "--purpose", + "stress-run-new-test", + ] + ) + # And another for existing tests + runs.append( + [ + "--tag-new-tests", + "--collection", + "oss-existing-test-stress", + "--stress-runs", + "10", + "--purpose", + "stress-run", + ] + ) + else: + runs.append(["--collection", "oss-diff", "--purpose", "diff"]) + + for run in runs: + self._run_cmd( + testpilot_args + run, + cwd=self.build_opts.fbcode_builder_dir, + env=env, + ) else: self._run_cmd( [ctest, "--output-on-failure", "-j", str(self.build_opts.num_jobs)],