Unrelated to memory issue, would be much appreciat...
# development
h
Unrelated to memory issue, would be much appreciated if someone could please take a look at https://github.com/pantsbuild/pants/pull/7722#discussion_r284483847. Rule is saying itโ€™s not available when calling
TestBase.scheduler.product_request()
, but everything works when using
./pants --no-v1 --v2 test
.
w
that error is a rule graph construction failure, which happens at graph construction time
in this case it probably means that the rule is not installed in that context
h
Ohh cool okay, iโ€™ll add that line. Thanks!
w
will see if i can get that green tonight.
โค๏ธ 1
h
It worked ๐Ÿ™‚ but now this error:
Copy code
E       Exception: No installed @rules can satisfy Select(InitInjectedDigest) for input Params(Snapshot).
How do you install a rule? Implementing
def rules()
on the test class did not work.
w
what kind of test class?
h
TestBase
w
TestBase consumes
def rules
.
BUT the new error is no longer a rule graph construction error: rather a runtime error
is there a RootRule for Snapshot?
doesn't look like it.
so: RootRules.
if a Parameter might be provided from "outside" the graph at the root of a request (ie
scheduler.product_request
), you should declare a RootRule
๐Ÿ‘ 1
(and if it won't, you shouldn't)
h
where do I declare this? in src or the test file
w
if you're trying to expose the rule "for testing", then you might consider just declaring the
RootRule(Snapshot)
in your test classes'
def rules
a lot of things that are currently RootRules in the core should only actually be RootRules in tests (because we never request them via
product_request
while pants is actually running)
back in a bit.
h
Yay! That was it
๐ŸŽ‰ 1