Create a new hook to select tests to run for a given Phabricator revision

This commit is contained in:
Marco Castelluccio 2019-11-19 15:40:45 +01:00
Родитель db318babcd
Коммит 343d301188
3 изменённых файлов: 111 добавлений и 0 удалений

Просмотреть файл

@ -409,6 +409,38 @@ tasks:
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("update_hook_test_select")}
dependencies:
- {$eval: as_slugid("docker_push")}
scopes:
- hooks:modify-hook:project-relman/bugbug-test-select
- assume:hook-id:project-relman/bugbug-test-select
created: {$fromNow: ''}
deadline: {$fromNow: '5 hours'}
provisionerId: proj-relman
workerType: ci
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py ${head_branch[10:]} infra/taskcluster-hook-test-select.json &&
taskboot --target . build-hook infra/taskcluster-hook-test-select.json project-relman bugbug-test-select"
metadata:
name: bugbug update test select hook
description: bugbug update test select hook
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
# It's the same task integration_test as in data-pipeline.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:

Просмотреть файл

@ -0,0 +1,78 @@
{
"metadata": {
"description": "",
"name": "BugBug test select",
"owner": "mcastelluccio@mozilla.com"
},
"task": {
"created": {
"$fromNow": "0 seconds"
},
"deadline": {
"$fromNow": "2 hours"
},
"expires": {
"$fromNow": "1 month"
},
"extra": {},
"metadata": {
"description": "",
"name": "BugBug test select",
"owner": "mcastelluccio@mozilla.com",
"source": "https://github.com/mozilla/bugbug"
},
"payload": {
"artifacts": {
"public/selected_tasks": {
"path": "/selected_tasks",
"type": "file"
}
},
"cache": {
"bugbug-mercurial-repository": "/cache"
},
"capabilities": {},
"env": {
"TC_SECRET_ID": "project/relman/bugbug/production"
},
"features": {
"taskclusterProxy": true
},
"command": [
"bugbug-classify-commit",
"testselect",
"/cache",
"${payload['DIFF_ID']}"
],
"image": "mozilla/bugbug-commit-retrieval",
"maxRunTime": 7200
},
"priority": "normal",
"provisionerId": "proj-relman",
"retries": 5,
"routes": [
"notify.email.release-mgmt-analysis@mozilla.com.on-failed",
"notify.irc-channel.#bugbug.on-failed",
"index.project.relman.bugbug.test_select.latest",
"index.project.relman.bugbug.test_select.diff.${payload['DIFF_ID']}"
],
"schedulerId": "-",
"scopes": [
"assume:hook-id:project-relman/bugbug-test-select"
],
"tags": {},
"workerType": "compute-large"
},
"triggerSchema": {
"additionalProperties": false,
"properties": {
"DIFF_ID": {
"type": "number"
}
},
"required": [
"DIFF_ID"
],
"type": "object"
}
}

Просмотреть файл

@ -21,6 +21,7 @@ parameters = [
(os.path.realpath("infra/taskcluster-hook-pipeline-start.json"), {}),
(os.path.realpath("infra/taskcluster-hook-check-models-start.json"), {}),
(os.path.realpath("infra/taskcluster-hook-classify-patch.json"), {"DIFF_ID": 123}),
(os.path.realpath("infra/taskcluster-hook-test-select.json"), {"DIFF_ID": 123}),
]
for f in os.listdir("infra"):