Hm, I think I've managed to anger the engine again...
# development
b
Hm, I think I've managed to anger the engine again. It seems like if I add
UnionRule(TestFieldSet, JavaTestFieldSet)
, I somehow indirectly break Python's test rule graph.
Copy code
No installed rules return the type PythonTestFieldSet, and it was not provided by potential callers of @rule(pants.backend.python.goals.pytest_runner:282:run_python_test(PythonTestFieldSet, TestSubsystem, PyTest) -> TestResult, gets=[Get(TestSetup, TestSetupRequest), Get(FallibleProcessResult, Process), Get(PySnapshot, DigestSubset), Get(PySnapshot, AddPrefix), Get(PySnapshot, RemovePrefix)]).
h
Thanks. Will take a look tomorrow
Ah, try adding a rule that returns
TestDebugResult
as well. I think that could fix this and this error message is simply really misleading I've been adding the Shunit2 test runner and have not hit this, so it should be possible to add a second test runner
b
I don't see
TestDebugResult
anywhere, only
TestDebugRequest
. Am I missing something?
Do you mean
EnrichedTestResult
?
(It doesn't seem it like, given the documentation for
EnrichedTestResult
, and given that
pytest_runner
doesn't meantion it at all)
h
See https://github.com/pantsbuild/pants/blob/5a23b009c6e3bc9a9f963b50558f9040c53b0ca1/src/python/pants/backend/shell/shunit2_test_runner.py#L235-L240, I'm saying that I think you need to add a rule that returns
TestDebugResult
. I suspect that because that rule is not implemented, the rule graph is incomplete, resulting in this bogus error message
b
Ah, I think I get it now, I needed
TestDebugRequest
from my field set, even just stubbed in
👍 1
h
Yeah, totally okay to not yet implement. All the rule graph cares about is your @rule signatures and your
await Get
statements. The actual code can be invalid - it's only the shape of the rule that matters
b
To be clear though, it's
TestDebugRequest
, not
...Result
h
Ah, my bad. Yes