Bug 1277413: add a task to run taskgraph unit tests; r?Callek
MozReview-Commit-ID: n8122F3ocx
--- a/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
+++ b/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
@@ -537,16 +537,24 @@ tasks:
root: true
when:
file_patterns:
- '**/*.py'
- '**/.flake8'
- 'python/mozlint/**'
- 'tools/lint/**'
- 'testing/docker/lint/**'
+ taskgraph-tests:
+ task: tasks/tests/taskgraph-tests.yml
+ root: true
+ when:
+ file_patterns:
+ - 'taskcluster/**.py'
+ - 'config/mozunit.py'
+ - 'python/mach/**.py'
android-api-15-gradle-dependencies:
task: tasks/builds/android_api_15_gradle_dependencies.yml
root: true
when:
file_patterns:
- 'mobile/android/config/**'
- 'testing/docker/android-gradle-build/**'
- 'testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py'
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/legacy/tasks/tests/taskgraph-tests.yml
@@ -0,0 +1,39 @@
+---
+$inherits:
+ from: 'tasks/lint.yml'
+ variables:
+ build_product: 'lint'
+ build_name: 'taskgraph-tests'
+ build_type: 'opt'
+
+docker-image: lint
+task:
+ metadata:
+ name: '[TC] - Taskgraph Tests'
+ description: 'Run test suite for taskcluster/taskgraph'
+ payload:
+ image:
+ type: 'task-image'
+ path: 'public/image.tar'
+ taskId:
+ task-reference: "<docker-image>"
+ command:
+ - bash
+ - -cx
+ - >
+ tc-vcs checkout ./gecko {{base_repository}} {{head_repository}} {{head_rev}} {{head_ref}} &&
+ cd gecko &&
+ ./mach taskgraph python-tests
+ extra:
+ locations:
+ build: null
+ tests: null
+ treeherder:
+ machine:
+ # this should probably get a fresh new platform, but linux64 is what, for example, marionette uses
+ platform: linux64
+ symbol: tg
+ tier: 2
+ treeherderEnv:
+ - production
+ - staging
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -69,17 +69,17 @@ class MachCommands(MachCommandBase):
@SubCommand('taskgraph', 'python-tests',
description='Run the taskgraph unit tests')
def taskgraph_python_tests(self, **options):
import unittest
import mozunit
suite = unittest.defaultTestLoader.discover('taskgraph.test')
runner = mozunit.MozTestRunner(verbosity=2)
result = runner.run(suite)
- if not result.wasSuccessful:
+ if not result.wasSuccessful():
sys.exit(1)
@ShowTaskGraphSubCommand('taskgraph', 'tasks',
description="Show all tasks in the taskgraph")
def taskgraph_tasks(self, **options):
return self.show_taskgraph('full_task_set', options)
@ShowTaskGraphSubCommand('taskgraph', 'full',