hundreds-breakfast-49010
06/17/2020, 5:27 PMwitty-crayon-22786
06/17/2020, 5:30 PMTestResult
to fix https://github.com/pantsbuild/pants/blob/77e089be985c5f87710344376738754e213a0302/src/python/pants/core/goals/test.py#L35-L37witty-crayon-22786
06/17/2020, 5:30 PMwitty-crayon-22786
06/17/2020, 5:31 PMclass TestResult(EngineAware): ...
hundreds-father-404
06/17/2020, 5:36 PMwitty-crayon-22786
06/17/2020, 5:39 PMhundreds-breakfast-49010
06/17/2020, 5:40 PMhundreds-father-404
06/17/2020, 6:07 PMwitty-crayon-22786
06/17/2020, 6:12 PMhundreds-breakfast-49010
06/17/2020, 6:14 PMhundreds-breakfast-49010
06/17/2020, 6:14 PMhundreds-breakfast-49010
06/17/2020, 6:14 PMwitty-crayon-22786
06/17/2020, 6:15 PMwitty-crayon-22786
06/17/2020, 6:16 PMFailed: Run tests for ...
witty-crayon-22786
06/17/2020, 6:16 PMwitty-crayon-22786
06/17/2020, 6:16 PMhundreds-father-404
06/17/2020, 6:18 PMwitty-crayon-22786
06/17/2020, 6:18 PMhundreds-father-404
06/17/2020, 6:18 PMwitty-crayon-22786
06/17/2020, 6:20 PMwitty-crayon-22786
06/17/2020, 6:21 PMProcess
intrinsic that should be indicating that it failed.witty-crayon-22786
06/17/2020, 6:22 PMwitty-crayon-22786
06/17/2020, 6:23 PMProcessResult
…!?!witty-crayon-22786
06/17/2020, 6:25 PMhundreds-breakfast-49010
06/17/2020, 6:26 PMTasks
. although nothing says we couldn't do something similar for Processeswitty-crayon-22786
06/17/2020, 6:27 PMwitty-crayon-22786
06/17/2020, 6:27 PMhundreds-breakfast-49010
06/17/2020, 6:28 PMrun_wrapped_node
for MultiPLatofrmExecuteProcess
witty-crayon-22786
06/17/2020, 6:28 PMwitty-crayon-22786
06/17/2020, 6:28 PMwitty-crayon-22786
06/17/2020, 6:29 PMCompleted
message)witty-crayon-22786
06/17/2020, 6:29 PMhundreds-father-404
06/17/2020, 6:30 PMwitty-crayon-22786
06/17/2020, 6:30 PMwitty-crayon-22786
06/17/2020, 6:30 PMhundreds-breakfast-49010
06/17/2020, 6:32 PM@rule
could encode whatever business logic was necessary to figure out if a failure had happenedhundreds-breakfast-49010
06/17/2020, 6:33 PMhundreds-breakfast-49010
06/17/2020, 6:33 PMwitty-crayon-22786
06/17/2020, 6:33 PMwitty-crayon-22786
06/17/2020, 6:34 PMwitty-crayon-22786
06/17/2020, 6:34 PMbut the process has its own stdout/stderr, not the ruleright, exactly =/
hundreds-breakfast-49010
06/17/2020, 6:34 PMProcessResult
, so the rule can choose to print this out if it wantswitty-crayon-22786
06/17/2020, 6:35 PMhundreds-breakfast-49010
06/17/2020, 6:36 PMtext_output(self) ->Opitional[String]
or something like thathundreds-breakfast-49010
06/17/2020, 6:36 PMwitty-crayon-22786
06/17/2020, 6:36 PMwitty-crayon-22786
06/17/2020, 6:38 PMProcessResult
EngineAware
, and then having the special case just be that we use the same interface for the intrinsic.hundreds-father-404
06/17/2020, 7:40 PMProcess
wouldn’t generalize well enough for cases where we don’t use a Process
, right? It seems more generic to have this mechanism live on the @rule
itselfhundreds-breakfast-49010
06/17/2020, 7:44 PMhundreds-breakfast-49010
06/17/2020, 7:44 PMhundreds-breakfast-49010
06/17/2020, 7:44 PMhundreds-breakfast-49010
06/17/2020, 7:45 PMTask
, it's a MultiPlatformExecuteProcess
. so the current code path doesn't affect ithundreds-breakfast-49010
06/17/2020, 7:45 PMProcess
intrinsic case. and that would only affect the process's workunit, not the workunit of the rule that ran the processwitty-crayon-22786
06/17/2020, 7:48 PMhundreds-breakfast-49010
06/17/2020, 7:49 PMhundreds-breakfast-49010
06/17/2020, 7:49 PMwitty-crayon-22786
06/17/2020, 7:51 PMhundreds-breakfast-49010
06/17/2020, 7:54 PMcoordinater_of_tests
rule be the one that sets success/failure on its workunithundreds-breakfast-49010
06/17/2020, 7:54 PMrun_tests
itselfhundreds-breakfast-49010
06/17/2020, 7:55 PMEngineAware
, and it would set a warning level or not based on TestResult
, just like the logger call currently doeshundreds-breakfast-49010
06/17/2020, 7:56 PMhundreds-breakfast-49010
06/17/2020, 7:56 PMpytest
binary that it executes, so long as it didn't actually crashhundreds-breakfast-49010
06/17/2020, 7:57 PMgoals/test.py
to inspect the output of that pytest run and decide what does and does not constitute a test failure at that levelwitty-crayon-22786
06/17/2020, 7:58 PMso long as it didn’t actually crashit did, by virtue of returning 1
witty-crayon-22786
06/17/2020, 7:59 PMwitty-crayon-22786
06/17/2020, 8:07 PMwarn
in some cases.)witty-crayon-22786
06/17/2020, 8:07 PMhundreds-breakfast-49010
06/17/2020, 9:59 PMhundreds-breakfast-49010
06/17/2020, 9:59 PMWorkunitMetadata
hundreds-breakfast-49010
06/17/2020, 10:00 PMEngineAware
that lets a rule update the descriptionhundreds-breakfast-49010
06/17/2020, 10:00 PMhundreds-breakfast-49010
06/17/2020, 10:01 PMEngineAware
, for printing potentially-lengthy amounts of informationwitty-crayon-22786
06/17/2020, 10:01 PMhundreds-breakfast-49010
06/17/2020, 10:02 PMlevel()
method (or we can once that PR is green)witty-crayon-22786
06/17/2020, 10:02 PMhundreds-breakfast-49010
06/17/2020, 10:02 PM@rule
witty-crayon-22786
06/17/2020, 10:02 PMwitty-crayon-22786
06/17/2020, 10:03 PMhundreds-breakfast-49010
06/17/2020, 10:03 PMTestResult
instance,and it can call a method on its own output type to set this "blob" to that output (or maybe just a subset of that output)hundreds-breakfast-49010
06/17/2020, 10:03 PMhundreds-breakfast-49010
06/17/2020, 10:03 PMDigest
with that same stdout/stderr attached as an artifact to its own workunitwitty-crayon-22786
06/17/2020, 10:03 PMhundreds-breakfast-49010
06/17/2020, 10:04 PMwitty-crayon-22786
06/17/2020, 10:04 PMwitty-crayon-22786
06/17/2020, 10:04 PMhundreds-breakfast-49010
06/17/2020, 10:04 PMwitty-crayon-22786
06/17/2020, 10:04 PM@rule
doesn’t know whether it was a cache hitwitty-crayon-22786
06/17/2020, 10:04 PMhundreds-breakfast-49010
06/17/2020, 10:05 PMwitty-crayon-22786
06/17/2020, 10:06 PMhundreds-breakfast-49010
06/17/2020, 10:06 PMpants test
on their code, some test fails, then they run it again without changing any of the source files, the test would fail in exactly the same way if it ran again, but we cache the resultwitty-crayon-22786
06/17/2020, 10:07 PMhundreds-breakfast-49010
06/17/2020, 10:07 PMTestResult
, so it displays themwitty-crayon-22786
06/17/2020, 10:07 PMinfo
says “here’s some output that i think just actually ran, but which is actually a cache hit!“… then we wouldn’t want to render that.witty-crayon-22786
06/17/2020, 10:08 PMhundreds-breakfast-49010
06/17/2020, 10:08 PMhundreds-breakfast-49010
06/17/2020, 10:08 PMwitty-crayon-22786
06/17/2020, 10:09 PMhundreds-breakfast-49010
06/17/2020, 10:09 PMwitty-crayon-22786
06/17/2020, 10:09 PMso it shouldn’t mkae different decisions about what to print based on thiscorrect: rules should not. but the engine should.
hundreds-breakfast-49010
06/17/2020, 10:10 PMhundreds-breakfast-49010
06/17/2020, 10:10 PMwitty-crayon-22786
06/17/2020, 10:10 PMhundreds-breakfast-49010
06/17/2020, 10:10 PMwitty-crayon-22786
06/17/2020, 10:11 PMwitty-crayon-22786
06/17/2020, 10:12 PMProcess.description
works so well.hundreds-breakfast-49010
06/17/2020, 10:14 PMhundreds-breakfast-49010
06/17/2020, 10:14 PMProcessRequest
that says "if this particular process fails, print out its stdout/stderr`witty-crayon-22786
06/17/2020, 10:15 PMwitty-crayon-22786
06/17/2020, 10:15 PMwarn
will definitely be a thing.witty-crayon-22786
06/17/2020, 10:15 PMwarn
can probably only be triggered by a rule inspecting the outputhundreds-breakfast-49010
06/17/2020, 10:17 PMhundreds-breakfast-49010
06/17/2020, 10:17 PMwitty-crayon-22786
06/17/2020, 10:17 PMwitty-crayon-22786
06/17/2020, 10:18 PMhundreds-breakfast-49010
06/17/2020, 10:18 PMwitty-crayon-22786
06/17/2020, 10:19 PM