Bug 1277413: add a task to run taskgraph unit tests; r?Callek draft
authorDustin J. Mitchell <dustin@mozilla.com>
Mon, 13 Jun 2016 03:37:23 +0100
changeset 380098 e0e1b8fe7069f5401bc7c544cba1d208b4b36955
parent 378223 5748a69df90b4f22108b67c01a1e331ef9018c29
child 523646 e9922d6c8a2d6e46aa3d2a18d22944e1dd4e7c8f
push id21139
push userdmitchell@mozilla.com
push dateMon, 20 Jun 2016 18:47:11 +0000
reviewersCallek
bugs1277413
milestone50.0a1
Bug 1277413: add a task to run taskgraph unit tests; r?Callek MozReview-Commit-ID: n8122F3ocx
taskcluster/ci/legacy/tasks/branches/base_jobs.yml
taskcluster/ci/legacy/tasks/tests/taskgraph-tests.yml
taskcluster/mach_commands.py
--- 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',