https://pantsbuild.org/ logo
#development
Title
# development
b

bored-art-40741

04/04/2021, 10:17 PM
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

hundreds-father-404

04/05/2021, 4:40 AM
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

bored-art-40741

04/07/2021, 12:18 AM
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

hundreds-father-404

04/07/2021, 12:40 AM
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

bored-art-40741

04/07/2021, 12:40 AM
Ah, I think I get it now, I needed
TestDebugRequest
from my field set, even just stubbed in
👍 1
h

hundreds-father-404

04/07/2021, 12:41 AM
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

bored-art-40741

04/07/2021, 12:48 AM
To be clear though, it's
TestDebugRequest
, not
...Result
h

hundreds-father-404

04/07/2021, 12:51 AM
Ah, my bad. Yes