Improve documentation for `mach test`
Categories
(Testing :: General, enhancement)
Tracking
(firefox84 fixed)
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: hexagonrecursion, Assigned: hexagonrecursion)
Details
Attachments
(1 file)
|
47 bytes,
text/x-phabricator-request
|
Details |
-
I spent several hours trying to figure out why
mach testproduces strange errors about missing symbolic link targets. The answer? I forgot to runmach buildafterhg checkout. I suspect that this might be a common newbie error. -
By default
mach testprints a ton of spam to the console. There is an option that produces a nice animated summary instead (--log-grouped), butmach testhas too many options and --log-grouped is buried in the middle of the help page. In addition --log-grouped is not an intuitive name.
The patch below is my attempt to improve the situation in the easiest way I can as a newbie: improving the documentation. It might not be the beast solution, but it's an improvement.
| Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
(In reply to Andrey Bienkowski from comment #0)
- I spent several hours trying to figure out why
mach testproduces strange errors about missing symbolic link targets. The answer? I forgot to runmach buildafterhg checkout. I suspect that this might be a common newbie error.
That sounds frustrating.
I know if there's no build, 'mach test' detects that condition and fails with "No build detected, test metadata may be incomplete."
I think it was possible to run tests against a stale checkout, as long as a build was available -- but maybe that is no longer the case. I pulled and tried running 'mach test' without building and that failed:
ErrorMessage: Error: Symlink target path does not exist: /home/gbrown/src/gfx/tests/gtest/icc_profiles/lcms_samsung_syncmaster.icc
File "/home/gbrown/src/testing/mach_commands.py", line 447, in test
**kwargs
File "/home/gbrown/src/python/mach/mach/registrar.py", line 161, in dispatch
return self._run_command_handler(handler, context, **kwargs)
File "/home/gbrown/src/python/mach/mach/registrar.py", line 107, in _run_command_handler
result = fn(**kwargs)
File "/home/gbrown/src/testing/mochitest/mach_commands.py", line 378, in run_mochitest_general
driver.install_tests()
File "/home/gbrown/src/python/mozbuild/mozbuild/controller/building.py", line 1548, in install_tests
install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir, "_tests")
File "/home/gbrown/src/python/mozbuild/mozbuild/testing.py", line 214, in install_test_files
copier.copy(mozpath.join(topobjdir, tests_root), remove_unaccounted=False)
File "/home/gbrown/src/python/mozbuild/mozpack/copier.py", line 434, in copy
copy_results.append((destfile, f.copy(destfile, skip_if_older)))
File "/home/gbrown/src/python/mozbuild/mozpack/files.py", line 392, in copy
errors.fatal("Symlink target path does not exist: %s" % self.path)
File "/home/gbrown/src/python/mozbuild/mozpack/errors.py", line 104, in fatal
self._handle(self.FATAL, msg)
File "/home/gbrown/src/python/mozbuild/mozpack/errors.py", line 99, in _handle
raise ErrorMessage(msg)
Would it make sense to catch exceptions from install_tests() and suggest a way forward ("test installation failed; is your build up to date?")?
| Assignee | ||
Comment 3•5 years ago
|
||
In theory the most foolprof fix would be to make mach test automatically run mach build every time, but that would require no-op builds to be nearly instant.
| Assignee | ||
Comment 4•5 years ago
|
||
s/foolprof/foolproof/
Comment 6•5 years ago
|
||
| bugherder | ||
Description
•