Skip to content

Commit d5b772f

Browse files
committed
Stop relying on the task name prefix to detect coverage tasks
Fixes #351
1 parent f56f3cf commit d5b772f

File tree

8 files changed

+345
-43
lines changed

8 files changed

+345
-43
lines changed

bot/code_coverage_bot/taskcluster.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,39 +99,24 @@ def perform_download():
9999
retry(perform_download)
100100

101101

102-
BUILD_PLATFORMS = [
103-
"build-linux64-ccov/opt",
104-
"build-win64-ccov/debug",
105-
"build-android-test-ccov/opt",
106-
]
107-
108-
TEST_PLATFORMS = [
109-
"test-linux64-ccov/opt",
110-
"test-windows10-64-ccov/debug",
111-
"test-android-em-4.3-arm7-api-16-ccov/debug",
112-
] + BUILD_PLATFORMS
113-
114-
115102
def is_coverage_task(task):
116-
return any(task["metadata"]["name"].startswith(t) for t in TEST_PLATFORMS)
103+
return "ccov" in task["metadata"]["name"].split("/")[0].split("-")
117104

118105

119-
def name_to_chunk(name):
106+
def name_to_chunk(name: str):
120107
"""
121108
Helper to convert a task name to a chunk
122109
Used by chunk mapping
123110
"""
124-
assert isinstance(name, str)
125-
126111
# Some tests are run on build machines, we define a placeholder chunk for those.
127-
if name in BUILD_PLATFORMS:
112+
if name.startswith("build-"):
128113
return "build"
129114

130-
for t in TEST_PLATFORMS:
131-
if name.startswith(t):
132-
name = name[len(t) + 1 :]
133-
break
134-
return "-".join([p for p in name.split("-") if p != "e10s"])
115+
name = name[name.find("/") + 1 :]
116+
117+
return "-".join(
118+
[p for p in name.split("-") if p not in ("opt", "debug", "e10s", "1proc")]
119+
)
135120

136121

137122
def chunk_to_suite(chunk):
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"provisionerId": "gecko-t",
3+
"workerType": "t-linux-xlarge",
4+
"schedulerId": "gecko-level-3",
5+
"taskGroupId": "S5_GgKsuQvuxsHqLKGXpow",
6+
"dependencies": [
7+
"LLq0pXcjRQSeeqX39y0LIg",
8+
"T6iDE8yqQryKzJiVSvfpiQ",
9+
"cCf9pNwMTp-U1DLCivF6ew"
10+
],
11+
"requires": "all-completed",
12+
"routes": [
13+
"tc-treeherder.v2.mozilla-central.1fd87ec46d80675d2a8b18b47029f53a28d43a38.36976"
14+
],
15+
"priority": "medium",
16+
"retries": 5,
17+
"created": "2020-01-03T16:09:04.017Z",
18+
"deadline": "2020-01-04T16:09:04.017Z",
19+
"expires": "2021-01-02T16:09:04.017Z",
20+
"scopes": [
21+
"secrets:get:project/taskcluster/gecko/hgfingerprint",
22+
"secrets:get:project/taskcluster/gecko/hgmointernal",
23+
"project:releng:services/tooltool/api/download/public",
24+
"docker-worker:feature:allowPtrace",
25+
"docker-worker:cache:gecko-level-3-checkouts-v3-75316e4022f196ea1700",
26+
"docker-worker:cache:gecko-level-3-tooltool-cache-v3-75316e4022f196ea1700"
27+
],
28+
"payload": {
29+
"onExitStatus": {
30+
"retry": [
31+
4,
32+
72
33+
],
34+
"purgeCaches": [
35+
72
36+
]
37+
},
38+
"maxRunTime": 3600,
39+
"image": {
40+
"path": "public/image.tar.zst",
41+
"type": "task-image",
42+
"taskId": "LLq0pXcjRQSeeqX39y0LIg"
43+
},
44+
"cache": {
45+
"gecko-level-3-checkouts-v3-75316e4022f196ea1700": "/builds/worker/checkouts",
46+
"gecko-level-3-tooltool-cache-v3-75316e4022f196ea1700": "/builds/worker/tooltool-cache"
47+
},
48+
"artifacts": {
49+
"public/logs/": {
50+
"path": "/builds/worker/workspace/logs/",
51+
"expires": "2021-01-02T16:09:04.017Z",
52+
"type": "directory"
53+
},
54+
"public/test": {
55+
"path": "/builds/worker/artifacts/",
56+
"expires": "2021-01-02T16:09:04.017Z",
57+
"type": "directory"
58+
},
59+
"public/test_info/": {
60+
"path": "/builds/worker/workspace/build/blobber_upload_dir/",
61+
"expires": "2021-01-02T16:09:04.017Z",
62+
"type": "directory"
63+
}
64+
},
65+
"command": [
66+
"/builds/worker/bin/run-task",
67+
"--fetch-hgfingerprint",
68+
"--",
69+
"/builds/worker/bin/test-linux.sh",
70+
"--cppunittest-suite=cppunittest",
71+
"--code-coverage",
72+
"--disable-e10s",
73+
"--allow-software-gl-layers",
74+
"--download-symbols=ondemand"
75+
],
76+
"env": {
77+
"MOZ_AUTOMATION": "1",
78+
"TOOLTOOL_CACHE": "/builds/worker/tooltool-cache",
79+
"MOZ_FETCHES_DIR": "fetches",
80+
"MOZHARNESS_SCRIPT": "desktop_unittest.py",
81+
"MOZ_NODE_PATH": "/usr/local/bin/node",
82+
"HG_STORE_PATH": "/builds/worker/checkouts/hg-store",
83+
"MOZILLA_BUILD_URL": "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/T6iDE8yqQryKzJiVSvfpiQ/artifacts/public/build/target.tar.bz2",
84+
"GECKO_PATH": "/builds/worker/checkouts/gecko",
85+
"GECKO_HEAD_REPOSITORY": "https://hg.mozilla.org/mozilla-central",
86+
"EXTRA_MOZHARNESS_CONFIG": "{\"test_packages_url\": \"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/T6iDE8yqQryKzJiVSvfpiQ/artifacts/public/build/target.test_packages.json\", \"installer_url\": \"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/T6iDE8yqQryKzJiVSvfpiQ/artifacts/public/build/target.tar.bz2\"}",
87+
"SCCACHE_DISABLE": "1",
88+
"GECKO_HEAD_REV": "1fd87ec46d80675d2a8b18b47029f53a28d43a38",
89+
"NEED_COMPIZ": "false",
90+
"MOZ_SCM_LEVEL": "3",
91+
"TASKCLUSTER_VOLUMES": "/builds/worker/.cache;/builds/worker/checkouts;/builds/worker/tooltool-cache;/builds/worker/workspace",
92+
"MOZHARNESS_URL": "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/T6iDE8yqQryKzJiVSvfpiQ/artifacts/public/build/mozharness.zip",
93+
"GECKO_BASE_REPOSITORY": "https://hg.mozilla.org/mozilla-unified",
94+
"MOZ_FETCHES": "[{\"artifact\": \"public/build/grcov.tar.xz\", \"extract\": true, \"task\": \"cCf9pNwMTp-U1DLCivF6ew\"}]",
95+
"TASKCLUSTER_CACHES": "/builds/worker/checkouts;/builds/worker/tooltool-cache",
96+
"WORKING_DIR": "/builds/worker",
97+
"NEED_PULSEAUDIO": "true",
98+
"ENABLE_E10S": "false",
99+
"NEED_WINDOW_MANAGER": "true",
100+
"MOZHARNESS_CONFIG": "unittests/linux_unittest.py remove_executables.py"
101+
},
102+
"features": {
103+
"taskclusterProxy": true,
104+
"allowPtrace": true
105+
}
106+
},
107+
"metadata": {
108+
"owner": "[email protected]",
109+
"source": "https://hg.mozilla.org/mozilla-central/file/1fd87ec46d80675d2a8b18b47029f53a28d43a38/taskcluster/ci/test",
110+
"description": "CPP Unit Tests ([Treeherder push](https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=1fd87ec46d80675d2a8b18b47029f53a28d43a38))",
111+
"name": "test-linux1804-64-ccov/opt-cppunit-1proc"
112+
},
113+
"tags": {
114+
"kind": "test",
115+
"worker-implementation": "docker-worker",
116+
"createdForUser": "[email protected]",
117+
"retrigger": "true",
118+
"label": "test-linux1804-64-ccov/opt-cppunit-1proc",
119+
"os": "linux"
120+
},
121+
"extra": {
122+
"index": {
123+
"rank": 0
124+
},
125+
"parent": "S5_GgKsuQvuxsHqLKGXpow",
126+
"chunks": {
127+
"current": 1,
128+
"total": 1
129+
},
130+
"suite": "cppunittest",
131+
"treeherder": {
132+
"machine": {
133+
"platform": "linux1804-64-ccov"
134+
},
135+
"tier": 2,
136+
"symbol": "cppunit",
137+
"jobKind": "test",
138+
"collection": {
139+
"opt": true
140+
}
141+
},
142+
"treeherder-platform": "linux1804-64-ccov/opt"
143+
}
144+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{
2+
"provisionerId": "gecko-t",
3+
"workerType": "t-linux-xlarge",
4+
"schedulerId": "gecko-level-3",
5+
"taskGroupId": "UpVSSic1SeCw6sdDMidSLQ",
6+
"dependencies": [
7+
"EfaZjAzoQimatbNgqJd1zA",
8+
"LFz17jARRPOoUz4s3CKY4g",
9+
"Pq4D-RNFRHa_pSR7oP5CKg"
10+
],
11+
"requires": "all-completed",
12+
"routes": [
13+
"tc-treeherder.v2.mozilla-central.1e1617c67238dfb685fb3d07bf1793232c4469fa.36805",
14+
"coalesce.v1.mozilla-central.6b77c44ef9bf547dfe11"
15+
],
16+
"priority": "medium",
17+
"retries": 5,
18+
"created": "2019-11-15T09:55:53.069Z",
19+
"deadline": "2019-11-16T09:55:53.069Z",
20+
"expires": "2020-11-14T09:55:53.069Z",
21+
"scopes": [
22+
"secrets:get:project/taskcluster/gecko/hgfingerprint",
23+
"secrets:get:project/taskcluster/gecko/hgmointernal",
24+
"project:releng:services/tooltool/api/download/public",
25+
"docker-worker:feature:allowPtrace",
26+
"docker-worker:capability:device:loopbackVideo",
27+
"docker-worker:cache:gecko-level-3-checkouts-v3-e0773b586060dfe744c7",
28+
"docker-worker:cache:gecko-level-3-tooltool-cache-v3-e0773b586060dfe744c7"
29+
],
30+
"payload": {
31+
"supersederUrl": "https://coalesce.mozilla-releng.net/v1/list/3600/5/mozilla-central.6b77c44ef9bf547dfe11",
32+
"onExitStatus": {
33+
"retry": [
34+
4,
35+
72
36+
],
37+
"purgeCaches": [
38+
72
39+
]
40+
},
41+
"maxRunTime": 5400,
42+
"image": {
43+
"path": "public/image.tar.zst",
44+
"type": "task-image",
45+
"taskId": "Pq4D-RNFRHa_pSR7oP5CKg"
46+
},
47+
"cache": {
48+
"gecko-level-3-tooltool-cache-v3-e0773b586060dfe744c7": "/builds/worker/tooltool-cache",
49+
"gecko-level-3-checkouts-v3-e0773b586060dfe744c7": "/builds/worker/checkouts"
50+
},
51+
"capabilities": {
52+
"devices": {
53+
"loopbackVideo": true
54+
}
55+
},
56+
"artifacts": {
57+
"public/logs/": {
58+
"path": "/builds/worker/workspace/logs/",
59+
"expires": "2020-11-14T09:55:53.069Z",
60+
"type": "directory"
61+
},
62+
"public/test": {
63+
"path": "/builds/worker/artifacts/",
64+
"expires": "2020-11-14T09:55:53.069Z",
65+
"type": "directory"
66+
},
67+
"public/test_info/": {
68+
"path": "/builds/worker/workspace/build/blobber_upload_dir/",
69+
"expires": "2020-11-14T09:55:53.069Z",
70+
"type": "directory"
71+
}
72+
},
73+
"command": [
74+
"/builds/worker/bin/run-task",
75+
"--fetch-hgfingerprint",
76+
"--",
77+
"/builds/worker/bin/test-linux.sh",
78+
"--mochitest-suite=mochitest-plain",
79+
"--code-coverage",
80+
"--setpref=media.peerconnection.mtransport_process=false",
81+
"--setpref=network.process.enabled=false",
82+
"--total-chunk=10",
83+
"--this-chunk=1",
84+
"--download-symbols=ondemand"
85+
],
86+
"env": {
87+
"MOZ_AUTOMATION": "1",
88+
"MOCHITEST_FLAVOR": "plain",
89+
"TOOLTOOL_CACHE": "/builds/worker/tooltool-cache",
90+
"MOZ_FETCHES_DIR": "fetches",
91+
"MOZHARNESS_SCRIPT": "desktop_unittest.py",
92+
"MOZ_NODE_PATH": "/usr/local/bin/node",
93+
"HG_STORE_PATH": "/builds/worker/checkouts/hg-store",
94+
"MOZILLA_BUILD_URL": "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/EfaZjAzoQimatbNgqJd1zA/artifacts/public/build/target.tar.bz2",
95+
"GECKO_PATH": "/builds/worker/checkouts/gecko",
96+
"GECKO_HEAD_REPOSITORY": "https://hg.mozilla.org/mozilla-central",
97+
"EXTRA_MOZHARNESS_CONFIG": "{\"test_packages_url\": \"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/EfaZjAzoQimatbNgqJd1zA/artifacts/public/build/target.test_packages.json\", \"installer_url\": \"https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/EfaZjAzoQimatbNgqJd1zA/artifacts/public/build/target.tar.bz2\"}",
98+
"SCCACHE_DISABLE": "1",
99+
"GECKO_HEAD_REV": "1e1617c67238dfb685fb3d07bf1793232c4469fa",
100+
"NEED_COMPIZ": "true",
101+
"MOZ_SCM_LEVEL": "3",
102+
"TASKCLUSTER_VOLUMES": "/builds/worker/.cache;/builds/worker/checkouts;/builds/worker/tooltool-cache;/builds/worker/workspace",
103+
"MOZHARNESS_URL": "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/EfaZjAzoQimatbNgqJd1zA/artifacts/public/build/mozharness.zip",
104+
"GECKO_BASE_REPOSITORY": "https://hg.mozilla.org/mozilla-unified",
105+
"MOZ_FETCHES": "[{\"artifact\": \"public/build/grcov.tar.xz\", \"extract\": true, \"task\": \"LFz17jARRPOoUz4s3CKY4g\"}]",
106+
"TASKCLUSTER_CACHES": "/builds/worker/checkouts;/builds/worker/tooltool-cache",
107+
"WORKING_DIR": "/builds/worker",
108+
"NEED_PULSEAUDIO": "true",
109+
"ENABLE_E10S": "true",
110+
"NEED_WINDOW_MANAGER": "true",
111+
"MOZHARNESS_CONFIG": "unittests/linux_unittest.py remove_executables.py"
112+
},
113+
"features": {
114+
"taskclusterProxy": true,
115+
"allowPtrace": true
116+
}
117+
},
118+
"metadata": {
119+
"owner": "[email protected]",
120+
"source": "https://hg.mozilla.org/mozilla-central/file/1e1617c67238dfb685fb3d07bf1793232c4469fa/taskcluster/ci/test",
121+
"description": "Mochitest plain run ([Treeherder push](https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=1e1617c67238dfb685fb3d07bf1793232c4469fa))",
122+
"name": "test-linux1804-64-ccov/opt-mochitest-e10s-1"
123+
},
124+
"tags": {
125+
"kind": "test",
126+
"os": "linux",
127+
"createdForUser": "[email protected]",
128+
"retrigger": "true",
129+
"label": "test-linux1804-64-ccov/opt-mochitest-e10s-1",
130+
"test-type": "mochitest",
131+
"worker-implementation": "docker-worker"
132+
},
133+
"extra": {
134+
"index": {
135+
"rank": 0
136+
},
137+
"parent": "UpVSSic1SeCw6sdDMidSLQ",
138+
"chunks": {
139+
"current": 1,
140+
"total": 10
141+
},
142+
"suite": "mochitest-plain",
143+
"treeherder": {
144+
"jobKind": "test",
145+
"groupSymbol": "M",
146+
"collection": {
147+
"opt": true
148+
},
149+
"machine": {
150+
"platform": "linux1804-64-ccov"
151+
},
152+
"groupName": "Mochitests",
153+
"tier": 3,
154+
"symbol": "1"
155+
},
156+
"treeherder-platform": "linux1804-64-ccov/opt"
157+
}
158+
}

0 commit comments

Comments
 (0)