Closed Bug 1291335 Opened 5 years ago Closed 3 years ago

Check for --disable-tests when running mach test commands


(Testing :: General, defect)

Version 3
Not set


(firefox64 fixed)

Tracking Status
firefox64 --- fixed


(Reporter: zbraniecki, Assigned: egao)




(1 file, 3 obsolete files)

I can't run xpcshell-test

When I attempt to run the example from [0]:

`./mach xpcshell-test netwerk/test/`

I'm getting a failure with 0 tests run.

When I attempt to run full `./mach xpcshell-test`, I'm getting

I asked :stas to try the same commands and he's getting the same errors, so it's not specific to my machine, but since we're both on Linux it may be linux specific.

:gps, can you help me?
Flags: needinfo?(gps)
Much to my surprise, removing "--disable-tests" from mozconfig fixed this issue. Magic.
Closed: 5 years ago
Flags: needinfo?(gps)
Resolution: --- → INVALID
We should definitely error if you try to run a mach test command with --disable-tests.
Component: XPCShell Harness → General
Summary: Can't launch xpschell-test → Check for --disable-tests when running mach test commands
Resolution: INVALID → ---
Assignee: nobody → egao
- implemented a mozconfig checker inside, which checks the build.mozconfig['configure_args'] for --disable-tests option.
- changed to clearly print error then exit, with additional error message hinting at --disable-tests flag. This is to cover case where compilation was done with --disable-tests flag, but user attempts to run tests by mnaually specifying another mozconfig that does not have --disable-tests flag.
- debugging statements to run on try server

Depends on D7130
- further debug statements

Depends on D7131
- restored check for build.mozconfig.configure_args value, surrounded by checks to ensure it does not fail in automation environment

Depends on D7132
Attachment #9012708 - Attachment is obsolete: true
Attachment #9012707 - Attachment is obsolete: true
Attachment #9012709 - Attachment is obsolete: true
Thanks for taking this :egao. It looks like you are on the right track here.

I think you could put your check in either or the test harness - your choice. Hopefully you can apply your solution to all of the mach test commands/harnesses: mach test, web-platform-test, mochitest, reftest, xpcshell-test, etc.
An updated try run with a revised patch:

Revised patch details:

1. patch from comment 7 worked only for xpcshelltest, when invoked by: ./mach xpcshell-test <test_name>.
The revised patch removes this change, restoring testing/xpcshell/ to default state.

2. newer patch works at mozilla-central/python/mach/mach/ As the arguments are parsed and appropriate flags are set, additional checks are done using the following criteria in order:
- if MOZCONFIG environment variable is present;
- if MOZCONFIG specified in environment contains '--disable-tests' flag;
- if mach contains 'test' subcommand;
- if mach command contains 'test' in the cli argument; then
- a message stating that tests are disabled is shown.

I have checked the patch locally with the following commands:

./mach try
./mach bootstrap
./mach mochitest
./mach test mochitest
./mach xpcshell-test
./mach test xpcshell
./mach --help
./mach try
Attachment #9012710 - Attachment description: Bug 1291335 - Check for --disable-tests when running mach test commands r?gbrown → Bug 1291335 - Check mozconfig for --disable-tests when running mach test commands r?gbrown
Pushed by
Check mozconfig for --disable-tests when running mach test commands r=gbrown
Closed: 5 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.