Skip to content

Commit 77829a2

Browse files
committed
Add test that translates a new task definition field
1 parent a18262d commit 77829a2

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

tools/d2g/d2gtest/testdata/testcases/task_def_test.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,89 @@ testSuite:
166166
tags: {}
167167
taskGroupId: PIxhISDQSDa98W9ppGUNsw
168168
workerType: gw-ubuntu-22-04
169+
- name: Task definition test with a new, fake field set, foo
170+
description: >-
171+
d2g should properly translate this Docker Worker task definition
172+
into a valid Generic Worker task definition, with foo resulting
173+
in an extra field in the Generic Worker task definition
174+
dockerWorkerTaskDefinition:
175+
foo: bar
176+
provisionerId: proj-taskcluster
177+
workerType: gw-ubuntu-22-04
178+
taskQueueId: proj-taskcluster/gw-ubuntu-22-04
179+
schedulerId: taskcluster-ui
180+
projectId: none
181+
taskGroupId: PIxhISDQSDa98W9ppGUNsw
182+
dependencies: []
183+
requires: all-completed
184+
routes: []
185+
priority: lowest
186+
retries: 5
187+
created: '2023-10-26T14:06:09.867Z'
188+
deadline: '2023-10-26T17:06:09.867Z'
189+
expires: '2024-10-26T17:06:09.867Z'
190+
scopes:
191+
- docker-worker:apples
192+
payload:
193+
image: ubuntu:latest
194+
command:
195+
- /bin/bash
196+
- '-c'
197+
- for ((i=1;i<=600;i++)); do echo $i; sleep 1; done
198+
maxRunTime: 630
199+
capabilities:
200+
devices:
201+
kvm: true
202+
metadata:
203+
name: example-task
204+
205+
source: https://community-tc.services.mozilla.com/tasks/create
206+
description: An **example** task
207+
tags: {}
208+
extra: {}
209+
genericWorkerTaskDefinition:
210+
created: "2023-10-26T14:06:09.867Z"
211+
deadline: "2023-10-26T17:06:09.867Z"
212+
dependencies: []
213+
expires: "2024-10-26T17:06:09.867Z"
214+
extra: {}
215+
foo: bar
216+
metadata:
217+
description: An **example** task
218+
name: example-task
219+
220+
source: https://community-tc.services.mozilla.com/tasks/create
221+
payload:
222+
command:
223+
- - bash
224+
- -cx
225+
- podman run -t --rm --device=/dev/kvm -e RUN_ID -e TASKCLUSTER_ROOT_URL -e TASKCLUSTER_WORKER_LOCATION
226+
-e TASK_ID ubuntu:latest /bin/bash -c 'for ((i=1;i<=600;i++)); do echo $i; sleep
227+
1; done'
228+
features:
229+
backingLog: true
230+
liveLog: true
231+
logs:
232+
backing: public/logs/live_backing.log
233+
live: public/logs/live.log
234+
maxRunTime: 630
235+
onExitStatus:
236+
retry:
237+
- 125
238+
osGroups:
239+
- kvm
240+
priority: lowest
241+
projectId: none
242+
provisionerId: proj-taskcluster
243+
requires: all-completed
244+
retries: 5
245+
routes: []
246+
schedulerId: taskcluster-ui
247+
scopes:
248+
- generic-worker:apples
249+
- generic-worker:os-group:proj-taskcluster/gw-ubuntu-22-04/kvm
250+
tags: {}
251+
taskGroupId: PIxhISDQSDa98W9ppGUNsw
252+
taskQueueId: proj-taskcluster/gw-ubuntu-22-04
253+
workerType: gw-ubuntu-22-04
169254
payloadTests: []

0 commit comments

Comments
 (0)