Hello, any insight how to solve this test issue: ...
# development
h
Hello, any insight how to solve this test issue:
Copy code
Exception: No installed @rules can compute TestResult for input Params((PyTest+PythonNativeCode+PythonSetup+PythonTestsAdaptor+SubprocessEnvironment)), but there were @rules that could compute it using:
E         Params((OptionsBootstrapper+PythonNativeCode+PythonTestsAdaptor+SubprocessEnvironment))
This is for https://github.com/pantsbuild/pants/pull/8630/files#diff-c67a9cfea4000f6c874fc1011113d7d3. I’m confused why it would want an
OptionsBootstrapper
rather than
Pytest
+
PythonSetup
, as the
run_python_test
rule explicitly requests
Pytest
and
PythonSetup
a
It's not looking for an
OptionsBootstrapper
, that's saying that
OptionsBootstrapper
is within the set of available
Params
oh
oops nvm
OptionsBootstrapper
is required for every
optionable_rule()
, i believe
let me look at the code
h
Okay, thanks!
a
yes, i think it might need an
OptionsBootstrapper
provided as well. i might also check out other tests of rules elsewhere in the repo to see what they do to test `optionable_rule()`s
i can't see where
OptionsBootstrapper
is explicitly necessary (it's not in
OptionableFactory.signature()
, but i believe it is
h
I can’t see where it’s necessary either! Nor does it seem any other tests need it
a
have you seen
tests/python/pants_test/engine/legacy/test_options_parsing.py
? in particular
Copy code
options_bootstrap = OptionsBootstrapper.create(
      args=tuple(args),
      env=dict(env),
    )
it may be provided in some test base class somewhere if it seems like no other tests are explicitly providing it!
h
Figured it out! NB that if any test’s
def rules():
includes an
optionable_rule
in its entries, then it will require
OptionsBootstrapper
. The solution was to stop including `optionable_rule`s and mark subsystem dependencies as `RootRule`s
a
is there a reason we wouldn’t want to just include the OptionsBootstrapper automatically? it seems like a workaround
h
we wouldn’t want to just include the OptionsBootstrapper automatically
Naively trying to do this today resulted in complaints that we had unrecognized options
a
ah ok
i wouldn’t wanna figure that out either
root rules sound gr9