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

getdeps: allow tagging a build with its schedule type

Summary:
The schedule type is used to differentiate between a build run during
code review (and thus runs code that isn't yet in the master branch),
from continuous or other types of run that operate on landed code.

This doesn't change any behavior yet; this diff just adds
the plumbing to pass down an optional arbitrary schedule type string
from the CI system.

In the future, we'll use the schedule type to influence the behavior
of running tests.

Reviewed By: strager

Differential Revision: D15300120

fbshipit-source-id: 3b46afef2ff171b3fa095763dd5006a54ea328b8
This commit is contained in:
Wez Furlong
2019-05-20 10:54:11 -07:00
committed by Facebook Github Bot
parent be5d15164f
commit 49c1659695
2 changed files with 9 additions and 3 deletions

View File

@@ -302,6 +302,9 @@ class BuildCmd(SubCmd):
"is able to execute tests"
),
)
parser.add_argument(
"--schedule-type", help="Indicates how the build was activated"
)
@cmd("test", "test a given project")
@@ -336,7 +339,7 @@ class TestCmd(SubCmd):
return 1
src_dir = fetcher.get_src_dir()
builder = m.create_builder(opts, src_dir, build_dir, inst_dir, ctx)
builder.run_tests(install_dirs)
builder.run_tests(install_dirs, schedule_type=args.schedule_type)
install_dirs.append(inst_dir)
@@ -354,6 +357,9 @@ class TestCmd(SubCmd):
default=False,
help="Enable running tests for the named project and all of its deps",
)
parser.add_argument(
"--schedule-type", help="Indicates how the build was activated"
)
def build_argparser():

View File

@@ -86,7 +86,7 @@ class BuilderBase(object):
self._build(install_dirs=install_dirs, reconfigure=reconfigure)
def run_tests(self, install_dirs):
def run_tests(self, install_dirs, schedule_type):
""" Execute any tests that we know how to run. If they fail,
raise an exception. """
pass
@@ -279,7 +279,7 @@ class CMakeBuilder(BuilderBase):
env=env,
)
def run_tests(self, install_dirs):
def run_tests(self, install_dirs, schedule_type):
env = self._compute_env(install_dirs)
ctest = path_search(env, "ctest")
cmake = path_search(env, "cmake")