Bug 1547380 - Reject attempts to run the `rusttests` command from artifact builds. r=nalexander
authorChris Manchester <cmanchester@mozilla.com>
Tue, 30 Apr 2019 23:03:14 +0000
changeset 530957 e5916542e1e1de4834af3b84dedfd1196f7c83ae
parent 530956 9010230aec8a82e3444fa368484b1cb20b76e968
child 530958 a7ad04ab4ba4a7444f9091a810d7f4eaa6247f5a
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1547380
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547380 - Reject attempts to run the `rusttests` command from artifact builds. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D29436
python/mozbuild/mozbuild/base.py
testing/mach_commands.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -985,16 +985,21 @@ class MachCommandConditions(object):
         """Must have a git source checkout."""
         return getattr(cls, 'substs', {}).get('VCS_CHECKOUT_TYPE') == 'git'
 
     @staticmethod
     def is_artifact_build(cls):
         """Must be an artifact build."""
         return getattr(cls, 'substs', {}).get('MOZ_ARTIFACT_BUILDS')
 
+    @staticmethod
+    def is_non_artifact_build(cls):
+        """Must not be an artifact build."""
+        return not MachCommandConditions.is_artifact_build(cls)
+
 
 class PathArgument(object):
     """Parse a filesystem path argument and transform it in various ways."""
 
     def __init__(self, arg, topsrcdir, topobjdir, cwd=None):
         self.arg = arg
         self.topsrcdir = topsrcdir
         self.topobjdir = topobjdir
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -1136,14 +1136,15 @@ class TestInfoCommand(MachCommandBase):
                        threshold_pct, max_run_time))
         else:
             print("No tasks found.")
 
 
 @CommandProvider
 class RustTests(MachCommandBase):
     @Command('rusttests', category='testing',
+             conditions=[conditions.is_non_artifact_build],
              description="Run rust unit tests (via cargo test).")
     def run_rusttests(self, **kwargs):
         return self._mach_context.commands.dispatch('build', self._mach_context,
                                                     what=['pre-export',
                                                           'export',
                                                           'recurse_rusttests'])