Skip to content

Commit

Permalink
Now can he write a test pipeline in just one commit?
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Jan 18, 2024
1 parent cf5bc49 commit 3da0ff1
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 22 deletions.
1 change: 1 addition & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ treeherder:
'TL': 'Toolchain Tasks'
'rpk': 'Re-Package Tasks'
'BM': 'Beetmover Tasks'
'T': 'Test Tasks'

task-priority:
by-project:
Expand Down
33 changes: 33 additions & 0 deletions taskcluster/kinds/test/junit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---

android-junit:
worker-type: b-linux-large
worker:
docker-image: {in-tree: base}
max-run-time: 3600
description: "Run JUnit tests"
treeherder:
symbol: T(JUnit)
kind: test
platform: android/arm64-v8a
tier: 1
dependencies:
build: build-android-arm64/debug
fetches:
toolchain:
- conda-android-arm64-6.2.4
build:
- artifact: android-build.tar.gz
run:
using: run-task
use-caches: true
cwd: '{checkout}'
command: >-
source $TASK_WORKDIR/fetches/bin/activate
conda-unpack
cd $TASK_WORKDIR/android-build
ls
./gradlew test
30 changes: 8 additions & 22 deletions taskcluster/kinds/test/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,11 @@ transforms:
- taskgraph.transforms.run:transforms
- taskgraph.transforms.task:transforms

tasks:
taskgraph-definition:
worker-type: b-linux
worker:
docker-image: {in-tree: base}
max-run-time: 3600
description: "Test the full `mozilla_vpn_taskgraph` to validate the latest changes"
treeherder:
symbol: test-taskgraph-definition
kind: test
platform: tests/opt
tier: 1
run:
using: run-task
use-caches: true
cwd: '{checkout}'
command: >-
pip3 install -r taskcluster/requirements.txt &&
for param in `ls taskcluster/test/params`; do
taskgraph full -p taskcluster/test/params/$param
done &&
taskgraph full

kind-dependencies:
- toolchain
- build

tasks-from:
- taskgraph.yml
- junit.yml
26 changes: 26 additions & 0 deletions taskcluster/kinds/test/taskgraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---

taskgraph-definition:
worker-type: b-linux
worker:
docker-image: {in-tree: base}
max-run-time: 3600
description: "Test the full `mozilla_vpn_taskgraph` to validate the latest changes"
treeherder:
symbol: test-taskgraph-definition
kind: test
platform: tests/opt
tier: 1
run:
using: run-task
use-caches: true
cwd: '{checkout}'
command: >-
pip3 install -r taskcluster/requirements.txt &&
for param in `ls taskcluster/test/params`; do
taskgraph full -p taskcluster/test/params/$param
done &&
taskgraph full
5 changes: 5 additions & 0 deletions taskcluster/scripts/build/android_build_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ mv /builds/worker/artifacts/android-build-x86-debug.apk /builds/worker/artifacts

ls /builds/worker/artifacts/

# Zip up the
(cd .tmp/src/; zip -r android-build.zip android-build)
cp .tmp/src/android-build.zip /builds/worker/artifacts/


if test -n "$(find /builds/worker/artifacts/ -maxdepth 0 -empty)" ; then
echo "Output File not present, maybe build error?"
exit -1
Expand Down

0 comments on commit 3da0ff1

Please sign in to comment.