You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run: ./tc test --use-coverage --pytest-coverage-report=xml --print-exception-stacktrace src/python::
I get an error:
14:41:52:771 [INFO] waiting for file /Users/asher/projects/toolchain/.pids/pantsd/pid to appear...
14:41:58:943 [ERROR] Unrecognized command line flag '--print-exception-stacktrace' on scope 'test'.
Suggestions:
--print-exception-stacktrace
(Run `./pants help-advanced test` for all available options.)
Traceback (most recent call last):
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/bin/daemon_pants_runner.py", line 143, in _run
runner = LocalPantsRunner.create(
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 142, in create
options.for_scope(scope)
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/util/memo.py", line 123, in memoize
result = func(*args, **kwargs)
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/option/options.py", line 541, in for_scope
self._parser_hierarchy.get_parser_by_scope(scope).parse_args(parse_args_request)
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/option/parser.py", line 341, in parse_args
self._raise_error_for_invalid_flag_names(
File "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/1.29.0rc0_py38/lib/python3.8/site-packages/pants/option/parser.py", line 429, in _raise_error_for_invalid_flag_names
raise ParseError(f"{message}\n\n{help_instructions}")
pants.option.errors.ParseError: Unrecognized command line flag '--print-exception-stacktrace' on scope 'test'.
Suggestions:
--print-exception-stacktrace
(Run `./pants help-advanced test` for all available options.)
When I run: ./tc --print-exception-stacktrace test --use-coverage --pytest-coverage-report=xml src/python::
it works... the error is confusing and I think pants should consider global scope for options before erroring out.
I also believe this used to work, but stopped working in recent versions.
#10872 addresses the UX issue, providing more helpful error messages when this occurs.
Actually supporting global options in a scoped position turns out to be trickier, because of how per-scope options parsing works. I'm not sure whether it's worth doing, since we now offer a useful error message, as it can add confusion of its own.
When I run:
./tc test --use-coverage --pytest-coverage-report=xml --print-exception-stacktrace src/python::
I get an error:
When I run:
./tc --print-exception-stacktrace test --use-coverage --pytest-coverage-report=xml src/python::
it works... the error is confusing and I think pants should consider global scope for options before erroring out.
I also believe this used to work, but stopped working in recent versions.
@Eric-Arellano
The text was updated successfully, but these errors were encountered: