average-vr-56795
10/18/2018, 11:02 AMHydratedTarget
. Mumble mumble https://github.com/pantsbuild/pants/issues/4535 mumble mumble, but right now, I can either check the type of HydratedTarget.adaptor
(really weird abstraction leak), or I can check the string value of HydratedTarget.adaptor.type_alias
, except that’s non-canonical (maybe PythonTest
, maybe python_test
, maybe another alias someone has installed!)witty-crayon-22786
10/18/2018, 3:33 PMwitty-crayon-22786
10/18/2018, 3:34 PMOptionalX
for a bunch of "possibly matching" thingsaverage-vr-56795
10/18/2018, 3:35 PMPyTestResults
if you can give it to me, but skip any targets you can’t give me a thing for?witty-crayon-22786
10/18/2018, 3:36 PMOptionalTestResult
, perhapswitty-crayon-22786
10/18/2018, 3:36 PMaverage-vr-56795
10/18/2018, 3:37 PMaloof-angle-91616
10/18/2018, 3:37 PMwitty-crayon-22786
10/18/2018, 3:38 PMwitty-crayon-22786
10/18/2018, 3:39 PMaloof-angle-91616
10/18/2018, 3:40 PMwitty-crayon-22786
10/18/2018, 3:41 PMwitty-crayon-22786
10/18/2018, 3:42 PMaloof-angle-91616
10/18/2018, 3:42 PMaverage-vr-56795
10/18/2018, 3:47 PMwitty-crayon-22786
10/18/2018, 3:49 PMaloof-angle-91616
10/18/2018, 3:54 PMaverage-vr-56795
10/18/2018, 3:58 PMOptionalTestResult
at the top level, which comes from assuming that all targets either produced an OptionalPythonTestResult
or an `OptionalJunitTestResult`… I guess I’d want some higher-order Map
and Merge
kind of rules to make that work; but I don’t really want to build a generic higher order function system into the graph…
And if some targets were known not to produce any test result (say binaries listed as root targets, when I’m running test)…
Basically, before even thinking about this, I’d want to address https://github.com/pantsbuild/pants/issues/4535 because I think all of the places I’d currently want optional are horribly muddied because how I’d actually want to solve them is per-target-type Target types.average-vr-56795
10/18/2018, 3:58 PMOptional
, but I don’t want to patch over #4535 with Optional
witty-crayon-22786
10/18/2018, 4:14 PMper-target-type Target types.yea. my feeling is that 4535 allows for that
witty-crayon-22786
10/18/2018, 4:15 PMwitty-crayon-22786
10/18/2018, 4:16 PMwitty-crayon-22786
10/18/2018, 4:17 PMGet(OptionalTestResult, Address(..))
would be ambiguous without something to switchaloof-angle-91616
10/18/2018, 5:51 PMclass CompletedTestResult(datatype(...))
, or maybe a wrapper class JunitCompletedTestResult(datatype([('test_result', CompletedTestResult)]))
around that collection which has a rule subgraph to convert it into a CompletedTestResult
so the polymorphism is done by the logic the graph already contains. the only reason this isn't immediately doable (it seems) is because trivial rule subgraphs e.g. accessing a field still invoke some overhead, so we can't just willy-nilly create these simple synchronous rule subgraphs e.g. to extract the test_result
field above (or so john was saying at one point in a PR i made?), but that's a fixable problem.witty-crayon-22786
10/18/2018, 5:52 PMaloof-angle-91616
10/18/2018, 5:52 PMaloof-angle-91616
10/18/2018, 5:52 PMaloof-angle-91616
10/18/2018, 6:03 PMaloof-angle-91616
10/18/2018, 6:04 PMwitty-crayon-22786
10/18/2018, 6:05 PMaloof-angle-91616
10/18/2018, 6:05 PMaloof-angle-91616
10/18/2018, 6:05 PMwitty-crayon-22786
10/18/2018, 6:06 PMif
statementswitty-crayon-22786
10/18/2018, 6:06 PMwitty-crayon-22786
10/18/2018, 6:06 PMaloof-angle-91616
10/18/2018, 6:06 PMwitty-crayon-22786
10/18/2018, 6:07 PMX for Y
, installing another rule to do that will cause the graph to fail to build with an ambiguity erroraloof-angle-91616
10/18/2018, 6:07 PMwitty-crayon-22786
10/18/2018, 6:08 PMaloof-angle-91616
10/18/2018, 6:08 PMwitty-crayon-22786
10/18/2018, 6:08 PMwitty-crayon-22786
10/18/2018, 6:08 PMwitty-crayon-22786
10/18/2018, 6:08 PMaloof-angle-91616
10/18/2018, 6:08 PMaloof-angle-91616
10/18/2018, 6:09 PMwitty-crayon-22786
10/18/2018, 6:09 PMwitty-crayon-22786
10/18/2018, 6:09 PMwitty-crayon-22786
10/18/2018, 6:09 PMX for Y
, you may not install anotheraloof-angle-91616
10/18/2018, 6:10 PMwitty-crayon-22786
10/18/2018, 6:10 PMwitty-crayon-22786
10/18/2018, 6:10 PMaloof-angle-91616
10/18/2018, 6:10 PMaloof-angle-91616
10/18/2018, 6:10 PMwitty-crayon-22786
10/18/2018, 6:10 PMwitty-crayon-22786
10/18/2018, 6:11 PMwhat is this pytest runner rule selectingdoesn't matter.... what matters is that the test
@console_rule
needs to not need to know about "all possible runners"aloof-angle-91616
10/18/2018, 6:11 PM@rule(TestResult, [Select(PytestConfig)])
and @rule(TestResult, [Select(JunitConfig)])
witty-crayon-22786
10/18/2018, 6:11 PMwitty-crayon-22786
10/18/2018, 6:11 PMwitty-crayon-22786
10/18/2018, 6:12 PMaloof-angle-91616
10/18/2018, 6:13 PMaloof-angle-91616
10/18/2018, 6:13 PMwitty-crayon-22786
10/18/2018, 6:26 PMthe issue with this is that you still need the switch statement somewhere to create those configsand@rule(TestResult, [Select(PytestConfig)])
@rule(TestResult, [Select(JunitConfig)])
aloof-angle-91616
10/18/2018, 6:27 PMaloof-angle-91616
10/18/2018, 6:28 PMwitty-crayon-22786
10/18/2018, 6:29 PMJunitConfig
aloof-angle-91616
10/18/2018, 6:29 PMwitty-crayon-22786
10/18/2018, 6:29 PMJunitConfig
for some address?aloof-angle-91616
10/18/2018, 6:30 PMwitty-crayon-22786
10/18/2018, 6:30 PMaloof-angle-91616
10/18/2018, 6:30 PMaloof-angle-91616
10/18/2018, 6:30 PMaloof-angle-91616
10/18/2018, 6:31 PMwitty-crayon-22786
10/18/2018, 6:32 PMwitty-crayon-22786
10/18/2018, 6:32 PMwitty-crayon-22786
10/18/2018, 6:32 PMaloof-angle-91616
10/18/2018, 6:33 PMaloof-angle-91616
10/18/2018, 6:33 PMaloof-angle-91616
10/18/2018, 6:33 PMaloof-angle-91616
10/18/2018, 6:35 PMaloof-angle-91616
10/18/2018, 6:35 PMaloof-angle-91616
10/18/2018, 6:35 PM