Skip to content

Commit

Permalink
Add a decision task for try-windows-ami
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Nov 7, 2019
1 parent 7474b30 commit b3ca13c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
25 changes: 17 additions & 8 deletions etc/taskcluster/decision_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def main(task_for):

linux_tidy_unit_untrusted()

elif task_for == "try-windows-ami":
CONFIG.git_sha_is_current_head()
windows_unit(os.environ["NEW_AMI_WORKER_TYPE"], cached=False)

# https://tools.taskcluster.net/hooks/project-servo/daily
elif task_for == "daily":
daily_tasks_setup()
Expand Down Expand Up @@ -447,9 +451,9 @@ def uwp_nightly():
)


def windows_unit():
return (
windows_build_task("Dev build + unit tests")
def windows_unit(worker_type=None, cached=True):
task = (
windows_build_task("Dev build + unit tests", worker_type=worker_type)
.with_treeherder("Windows x64", "Unit")
.with_script(
# Not necessary as this would be done at the start of `build`,
Expand All @@ -464,8 +468,11 @@ def windows_unit():
)
.with_artifacts("repo/target/debug/msi/Servo.exe",
"repo/target/debug/msi/Servo.zip")
.find_or_create("build.windows_x64_dev." + CONFIG.task_id())
)
if cached:
return task.find_or_create("build.windows_x64_dev." + CONFIG.task_id())
else:
return task.create()


def windows_release():
Expand Down Expand Up @@ -744,10 +751,12 @@ def linux_task(name):
)


def windows_task(name):
def windows_task(name, worker_type=None):
if worker_type is None:
worker_type = "servo-win2016" if CONFIG.legacy_tc_deployment else "win2016"
return (
decisionlib.WindowsGenericWorkerTask(name)
.with_worker_type("servo-win2016" if CONFIG.legacy_tc_deployment else "win2016")
.with_worker_type(worker_type)
.with_treeherder_required()
)

Expand Down Expand Up @@ -799,7 +808,7 @@ def android_build_task(name):
)


def windows_build_task(name, package=True, arch="x86_64"):
def windows_build_task(name, package=True, arch="x86_64", worker_type=None):
hashes = {
"devel": {
"x86_64": "c136cbfb0330041d52fe6ec4e3e468563176333c857f6ed71191ebc37fc9d605",
Expand All @@ -813,7 +822,7 @@ def windows_build_task(name, package=True, arch="x86_64"):
}
version = "1.16.0"
task = (
windows_task(name)
windows_task(name, worker_type=worker_type)
.with_max_run_time_minutes(90)
.with_env(
**build_env,
Expand Down
4 changes: 4 additions & 0 deletions etc/taskcluster/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def findTask(self, path):
os.environ["GIT_REF"] = "refs/heads/auto"
os.environ["TASKCLUSTER_ROOT_URL"] = "https://taskcluster.net"
os.environ["TASKCLUSTER_PROXY_URL"] = "http://taskcluster"
os.environ["NEW_AMI_WORKER_TYPE"] = "-"
import decision_task
print("\n# Push:")
Expand All @@ -64,6 +65,9 @@ def findTask(self, path):
print("\n# Daily:")
decision_task.main("daily")
print("\n# Try AMI:")
decision_task.main("try-windows-ami")
print("\n# PR:")
decision_task.main("github-pull-request")
Expand Down

0 comments on commit b3ca13c

Please sign in to comment.