Skip to content

Commit 50e65a7

Browse files
committed
rust test
1 parent 1de5187 commit 50e65a7

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.taskcluster.yml

+37-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ tasks:
4545
- ['treescript', '37', '', '']
4646
- ['treescript', '38', '', 'mozilla/releng-treescript']
4747
- ['pypiscript', '38', '', 'mozilla/releng-pypiscript']
48+
- ['rust', 'rust', '', '']
4849
# -------------------------------------------------------------------------
4950

5051
HEAD_REV:
@@ -69,6 +70,8 @@ tasks:
6970
$if: 'tasks_for == "github-push" && event.ref[0:11] == "refs/heads/"'
7071
then: '${event.ref[11:]}'
7172
else: 'unknown'
73+
74+
rust_version: 1.43
7275
in:
7376
$flatten:
7477
$map: { "$eval": "PROJECTS" }
@@ -116,7 +119,7 @@ tasks:
116119
in:
117120
$match:
118121
# Run code linting and unit tests for each project
119-
'run_tests == "1"':
122+
'run_tests == "1" && project_name != "rust"':
120123
taskId: '${as_slugid(project_name + python_version)}'
121124
provisionerId: 'releng-t'
122125
workerType: 'linux'
@@ -148,6 +151,39 @@ tasks:
148151
description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1]}'
149152
owner: '${OWNER}'
150153
source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml'
154+
'run_tests == "1" && project_name == "rust"':
155+
taskId: '${as_slugid(rust)}'
156+
provisionerId: 'releng-t'
157+
workerType: 'linux'
158+
created: { $fromNow: '' }
159+
deadline: { $fromNow: '4 hours' }
160+
payload:
161+
maxRunTime: 3600
162+
image: 'rust:${rust_version}'
163+
command:
164+
- sh
165+
- -lxce
166+
- >-
167+
cd /tmp &&
168+
wget ${REPO_URL}/archive/${HEAD_REV}.tar.gz &&
169+
tar zxf ${HEAD_REV}.tar.gz &&
170+
mv scriptworker-scripts-${HEAD_REV} /src &&
171+
cd /src && ${setup_command}
172+
cargo test && cargo clippy
173+
pip install tox &&
174+
tox -e ${project_name}-py${python_version}
175+
metadata:
176+
name:
177+
$let:
178+
test_task_number:
179+
$if: 'dockerhub_repo != ""'
180+
then: '${i+1}.1'
181+
else: '${i+1}'
182+
in:
183+
'${number_prefix}${test_task_number}. ${project_name}-py${python_version}: Run tox [on ${BRANCH_NAME}]'
184+
description: 'Code linting and unit tests for rust code on rust ${rust_version}'
185+
owner: '${OWNER}'
186+
source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml'
151187
# Build docker image and (optionally) push to docker hub
152188
'run_tests == "1" && dockerhub_repo != ""':
153189
taskId: '${as_slugid(project_name + "docker_build_and_push")}'

0 commit comments

Comments
 (0)