Commit 74588469 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

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
parent 96f74144
......@@ -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():
......
......@@ -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")
......
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