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

hundreds-father-404

05/15/2019, 11:02 PM
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

witty-crayon-22786

05/15/2019, 11:26 PM
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

hundreds-father-404

05/15/2019, 11:28 PM
Ohh cool okay, iโ€™ll add that line. Thanks!
w

witty-crayon-22786

05/15/2019, 11:28 PM
will see if i can get that green tonight.
โค๏ธ 1
h

hundreds-father-404

05/15/2019, 11:44 PM
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

witty-crayon-22786

05/15/2019, 11:53 PM
what kind of test class?
h

hundreds-father-404

05/15/2019, 11:53 PM
TestBase
w

witty-crayon-22786

05/15/2019, 11:54 PM
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

hundreds-father-404

05/15/2019, 11:57 PM
where do I declare this? in src or the test file
w

witty-crayon-22786

05/15/2019, 11:57 PM
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

hundreds-father-404

05/16/2019, 12:02 AM
Yay! That was it
๐ŸŽ‰ 1