Open Bug 1209248 Opened 5 years ago Updated 3 years ago

Trying to run tests without a build should fail with a better description


(Firefox Build System :: Mach Core, enhancement)

35 Branch
Not set


(Not tracked)


(Reporter: whimboo, Unassigned)


When you run `./mach reftest` or any other kind of test without having done a build before, mach will fail with the following unhelpful exception:

IOError: [Errno 2] No such file or directory: u'/mozilla/code/obj/debug/_tests/testing/mochitest/'

  File "/mozilla/code/gecko/python/mach/mach/", line 336, in run
    return self._run(argv)
  File "/mozilla/code/gecko/python/mach/mach/", line 382, in _run
    args = parser.parse_args(argv)
  File "/usr/lib/python2.7/", line 1701, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python2.7/", line 1733, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python2.7/", line 1942, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/usr/lib/python2.7/", line 1898, in consume_positionals
    take_action(action, args)
  File "/usr/lib/python2.7/", line 1807, in take_action
    action(self, namespace, argument_values, option_string)
  File "/mozilla/code/gecko/python/mach/mach/", line 185, in __call__
    if handler.parser:
  File "/mozilla/code/gecko/python/mach/mach/", line 77, in parser
    self._parser = self._parser()
  File "/mozilla/code/gecko/testing/mochitest/", line 417, in setup_argument_parser
    with open(path, 'r') as fh:

It would be good to display more help in pointing the user to build first.
Running in --verbose mode actually gives a better message:

Exception: config.status not available. Run configure.

  File "/mozilla/code/gecko/layout/tools/reftest/", line 239, in run_reftest
    return self._run_reftest(**kwargs)
  File "/mozilla/code/gecko/layout/tools/reftest/", line 281, in _run_reftest
    return reftest.run_desktop_test(**kwargs)
  File "/mozilla/code/gecko/layout/tools/reftest/", line 213, in run_desktop_test
    rv =**kwargs)
  File "/mozilla/code/gecko/layout/tools/reftest/", line 716, in run
    parser.validate(options, reftest)
  File "/mozilla/code/gecko/layout/tools/reftest/", line 327, in validate
    self.build_obj and self.build_obj.substs[
  File "/mozilla/code/gecko/python/mozbuild/mozbuild/", line 273, in substs
    return self.config_environment.substs
  File "/mozilla/code/gecko/python/mozbuild/mozbuild/", line 260, in config_environment
    raise Exception('config.status not available. Run configure.')
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.