Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give ./wpt test-jobs an --all argument #13801

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/ci/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def get_paths(**kwargs):


def get_jobs(paths, **kwargs):
if kwargs.get("all"):
return set(job_path_map.keys())

jobs = set()

rules = {}
Expand Down Expand Up @@ -121,6 +124,7 @@ def get_jobs(paths, **kwargs):
def create_parser():
parser = argparse.ArgumentParser()
parser.add_argument("revish", default=None, help="Commits to consider. Defaults to the commits on the current branch", nargs="?")
parser.add_argument("--all", help="List all jobs unconditionally.", action="store_true")
parser.add_argument("--includes", default=None, help="Jobs to check for. Return code is 0 if all jobs are found, otherwise 1", nargs="*")
return parser

Expand Down
26 changes: 22 additions & 4 deletions tools/ci/tests/test_jobs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
from tools.ci import jobs

all_jobs = set([
"build_css",
"lint",
"manifest_upload",
"resources_unittest",
"stability",
"tools_unittest",
"update_built",
"wpt_integration",
"wptrunner_infrastructure",
"wptrunner_unittest",
])

default_jobs = set(["lint", "manifest_upload"])


def test_all():
assert jobs.get_jobs(["README.md"], all=True) == all_jobs


def test_default():
assert jobs.get_jobs(["README.md"]) == default_jobs


def test_testharness():
assert jobs.get_jobs(["resources/testharness.js"]) == default_jobs | set(["resources_unittest"])
assert jobs.get_jobs(["resources/testharness.js"],
Expand Down Expand Up @@ -39,10 +60,6 @@ def test_stability():
includes=["stability"]) == set(["stability"])


def test_default():
assert jobs.get_jobs(["README.md"]) == default_jobs


def test_tools_unittest():
assert jobs.get_jobs(["tools/ci/test/test_jobs.py"],
includes=["tools_unittest"]) == set(["tools_unittest"])
Expand Down Expand Up @@ -83,6 +100,7 @@ def test_wpt_integration():
assert jobs.get_jobs(["tools/wptrunner/wptrunner/wptrunner.py"],
includes=["wpt_integration"]) == set(["wpt_integration"])


def test_wpt_infrastructure():
assert jobs.get_jobs(["tools/hammer.html"],
includes=["wptrunner_infrastructure"]) == set(["wptrunner_infrastructure"])
Expand Down