Open Bug 1866126 Opened 1 year ago Updated 1 year ago

`mach wpt --log-tbpl=-` results in an error

Categories

(Testing :: web-platform-tests, defect)

defect

Tracking

(Not tracked)

People

(Reporter: jwatt, Unassigned)

Details

The help text from mach help wpt says:

Output Logging:
  Each option represents a possible logging format and takes a filename to write that format to, or '-' to write to stdout.

Which would be nice, because I just want TBPL compatible log output, not the output that goes to stdout by default.

But if I run the following:

./mach wpt --log-tbpl=- --log-mach-screenshot --reftest-screenshot=always testing/web-platform/tests/css/css-page/page-name-img-002-print.html

I get:

Error running mach:

    mach wpt --log-tbpl=- --log-mach-screenshot --reftest-screenshot=always testing/web-platform/tests/css/css-page/page-name-img-002-print.html

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke ``./mach busted`` to check if this issue is already on file. If it
isn't, please use ``./mach busted file wpt`` to report it. If ``./mach busted`` is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ValueError: Options specified for unused formatter(s) (['mach']) have no effect

  File "testing/web-platform/mach_commands.py", line 559, in run_wpt
    return run_web_platform_tests(command_context, **params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "testing/web-platform/mach_commands.py", line 535, in run_web_platform_tests
    logger = wpt_runner.setup_logging(**params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "testing/web-platform/mach_commands_base.py", line 31, in setup_logging
    return run.setup_logging(
           ^^^^^^^^^^^^^^^^^^
  File "testing/web-platform/tests/tools/wpt/run.py", line 928, in setup_logging
    wptrunner.setup_logging(kwargs, default_config, formatter_defaults=formatter_defaults)
  File "testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py", line 48, in setup_logging
    logger = wptlogging.setup(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "testing/web-platform/tests/tools/wptrunner/wptrunner/wptlogging.py", line 16, in setup
    logger = commandline.setup_logging("web-platform-tests", args, defaults,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "testing/mozbase/mozlog/mozlog/commandline.py", line 341, in setup_logging
    setup_handlers(logger, formatters, formatter_options, allow_unused_options)
  File "testing/mozbase/mozlog/mozlog/commandline.py", line 221, in setup_handlers
    raise ValueError(msg)

Sentry event ID: dce243be09ce4a9d9d802a59f27dc1d0
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

The severity field is not set for this bug.
:jgraham, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(james)

The problem here is the combination of --log-mach-screenshot and --log-tbpl=-. It's trying to tell you that you can't specify an option for a formatter that won't be used, since that seems like a bug. Possibly we should handle this in some other way, but I don't think there's anything broken as such.

Severity: -- → S4
Flags: needinfo?(james)
You need to log in before you can comment on or make changes to this bug.