From 6c90331fc745f6349e87d5c4a6167a2fd26f6d1e Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 29 Sep 2023 16:27:07 +0100 Subject: [PATCH] tests: update for less slog noise --- pkg/arvo/ted/test.hoon | 23 ++++++++++---- tests/sys/fine.hoon | 39 ++++++++++++----------- tests/sys/grq.hoon | 69 ++++++++++++++++++++-------------------- tests/sys/vane/eyre.hoon | 2 +- tests/sys/vane/gall.hoon | 13 ++++---- 5 files changed, 80 insertions(+), 66 deletions(-) diff --git a/pkg/arvo/ted/test.hoon b/pkg/arvo/ted/test.hoon index d483fb1ff..7ea500ec7 100644 --- a/pkg/arvo/ted/test.hoon +++ b/pkg/arvo/ted/test.hoon @@ -10,9 +10,22 @@ +$ test [=path func=test-func] +$ test-arm [name=term func=test-func] +$ test-func (trap tang) ++$ args quiet=_& -- => -|% +|_ =args +++ build-file + |= =beam + =/ m (strand ,(unit vase)) + ^- form:m + ;< res=(unit vase) bind:m + (build-file:strandio beam) + %. (pure:m res) + ?: =(res ~) + ~>(%slog.0^leaf+"FAILED {(spud s.beam)} (build)" same) + ?: quiet.args + same + ~>(%slog.0^leaf+"built {(spud s.beam)}" same) :: +run-test: execute an individual test :: ++ run-test @@ -23,7 +36,7 @@ ?- -.run %| |+(welp p.run leaf+"CRASHED {name}" ~) %& ?: =(~ p.run) - &+[leaf+"OK {name}"]~ + &+?:(quiet.args ~ [leaf+"OK {name}"]~) |+(flop `tang`[leaf+"FAILED {name}" p.run]) == :: +resolve-test-paths: add test names to file paths to form full identifiers @@ -55,7 +68,7 @@ =/ fire-arm=nock ~| [%failed-to-compile-test-arm name] q:(~(mint ut typ) p:!>(*tang) [%limb name]) - [name |.(;;(tang ~>(%bout.[1 name] .*(cor fire-arm))))] + [name |.(;;(tang ?:(quiet.args .*(cor fire-arm) ~>(%bout.[1 name] .*(cor fire-arm)))))] :: +has-test-prefix: does the arm define a test we should run? :: ++ has-test-prefix @@ -117,11 +130,9 @@ |- ^- form:m =* gather-tests $ ?^ fiz - ;< cor=(unit vase) bind:m (build-file:strandio beam.i.fiz) + ;< cor=(unit vase) bind:m (build-file beam.i.fiz) ?~ cor - ~> %slog.0^leaf+"FAILED {(spud s.beam.i.fiz)} (build)" gather-tests(fiz t.fiz, build-ok |) - ~> %slog.0^leaf+"built {(spud s.beam.i.fiz)}" =/ arms=(list test-arm) (get-test-arms u.cor) :: if test path specified an arm prefix, filter arms to match =? arms ?=(^ test.i.fiz) diff --git a/tests/sys/fine.hoon b/tests/sys/fine.hoon index e9a044299..15406bd58 100644 --- a/tests/sys/fine.hoon +++ b/tests/sys/fine.hoon @@ -3,6 +3,7 @@ /+ *test, v=test-ames-gall /* kelvin %hoon /sys/kelvin => |% + ++ dbug `?`| ++ kelvin-roof ^- roof :: @@ -55,7 +56,7 @@ =/ fine-behn-wire=wire (weld /fine/behn/wake/~bud scry-path) =/ future-path=path /c/x/5/kids/sys/kelvin =/ future-behn=wire (weld /fine/behn/wake/~bud future-path) - =/ =task:ames [%keen ~bud scry-path] + =/ =task:ames [%keen ~ ~bud scry-path] :: =/ request=shot:ames :* [sndr=~nec rcvr=~bud] @@ -65,7 +66,7 @@ origin=~ content=(etch-request-content ~nec (weld /~bud/1/1 scry-path) 1) == - ~& > 'poke requester %ames with a %keen task' + ~? > dbug 'poke requester %ames with a %keen task' =^ t1 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] @@ -76,7 +77,7 @@ == == :: - ~& > 'poke requester %ames with a second %keen task' + ~? > dbug 'poke requester %ames with a second %keen task' :- t1 |. :- %| =^ t2 ames.nec %: ames-check-call:v ames.nec @@ -92,14 +93,14 @@ ?~ keen=(~(get by keens.peer) scry-path) ~ listeners:u.keen - ~& > 'checks two listeners for the requested scry path' + ~? > dbug 'checks two listeners for the requested scry path' =/ t3=tang %+ expect-eq !>((sy ~[~[/keen-duct-1] ~[/keen-duct-2]])) !>(listeners) :: :- t3 |. :- %| - ~& > 'gives a remote scry response to listeners' + ~? > dbug 'gives a remote scry response to listeners' =/ [sig=@ux meows=(list @ux)] %: ames-scry-hunk:v ames.bud [~1111.1.2 0xbeef.dead kelvin-roof] @@ -143,18 +144,18 @@ origin=~ content=(etch-request-content ~nec (weld /~bud/1/1 future-path) 1) == - ~& > 'poke requester %ames with a %keen task for a future case' + ~? > dbug 'poke requester %ames with a %keen task for a future case' =^ t5 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] - [~[/keen-duct-3] %keen ~bud future-path] + [~[/keen-duct-3] %keen ~ ~bud future-path] :~ [~[//unix] [%give %send [%& ~bud] (etch-shot:ames request)]] [~[//unix] %pass future-behn %b %wait ~1111.1.1..00.00.01] == == :: :- t5 |. :- %| - ~& > 'cancel %keen task, from requester' + ~? > dbug 'cancel %keen task, from requester' =^ t6 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] @@ -163,26 +164,26 @@ == :: :- t6 |. :- %| - ~& > 'poke requester %ames with a new %keen task for a future case' + ~? > dbug 'poke requester %ames with a new %keen task for a future case' =^ t7 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] - [~[/keen-duct-4] %keen ~bud future-path] + [~[/keen-duct-4] %keen ~ ~bud future-path] :~ [~[//unix] [%give %send [%& ~bud] (etch-shot:ames request)]] [~[//unix] %pass future-behn %b %wait ~1111.1.1..00.00.01] == == :: :- t7 |. :- %| - ~& > 'poke requester %ames with a second %keen task for a future case' + ~? > dbug 'poke requester %ames with a second %keen task for a future case' =^ t8 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] - [~[/keen-duct-5] %keen ~bud future-path] + [~[/keen-duct-5] %keen ~ ~bud future-path] ~ == :- t8 |. :- %| - ~& > 'cancel scry for all listeners (%wham)' + ~? > dbug 'cancel scry for all listeners (%wham)' =^ t9 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] @@ -199,7 +200,7 @@ ?~ keen=(~(get by keens.peer) scry-path) ~ listeners:u.keen - ~& > 'checks no more listeners' + ~? > dbug 'checks no more listeners' (expect-eq !>(~) !>(listeners)) :: ++ test-fine-misordered @@ -213,7 +214,7 @@ :: (ames-call:v ames.bud ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) =/ scry-path=path /g/x/0/dap//some/data/atom =/ fine-behn-wire=wire (weld /fine/behn/wake/~bud scry-path) - =/ =task:ames [%keen ~bud scry-path] + =/ =task:ames [%keen ~ ~bud scry-path] :: =/ requests=(list shot:ames) %+ turn (gulf 1 3) @@ -229,7 +230,7 @@ =+ ^= [req1 req2 req3] ?> ?=([^ ^ ^ *] requests) [i i.t i.t.t]:requests - ~& > 'poke requester %ames with a %keen task' + ~? > dbug 'poke requester %ames with a %keen task' =^ t1 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] @@ -265,7 +266,7 @@ [[~bud [1 sig]] ~ ~] :: :- t1 |. :- %| - ~& > 'hear first response fragment' + ~? > dbug 'hear first response fragment' =^ t2 ames.nec %: ames-check-call:v ames.nec [~1111.1.2 0xbeef.dead *roof] @@ -282,7 +283,7 @@ == :: :- t2 |. :- %| - ~& > 'hear third response fragment' + ~? > dbug 'hear third response fragment' =^ t3 ames.nec %: ames-check-call:v ames.nec [~1111.1.2 0xbeef.dead *roof] @@ -294,7 +295,7 @@ ~ == :- t3 |. :- %& - ~& > 'hear second response fragment' + ~? > dbug 'hear second response fragment' =^ t4 ames.nec %: ames-check-call:v ames.nec [~1111.1.3 0xbeef.dead *roof] diff --git a/tests/sys/grq.hoon b/tests/sys/grq.hoon index fc03ddc1e..6829d38fb 100644 --- a/tests/sys/grq.hoon +++ b/tests/sys/grq.hoon @@ -2,6 +2,7 @@ :: /+ *test, v=test-ames-gall |% +++ dbug `?`| ++ test-watch %- run-chain |. :- %| @@ -12,7 +13,7 @@ ::=^ * ames.bud :: (ames-call:v ames.bud ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) :: poke %sub to tell it to subscribe - ~& > 'poke %sub to tell it to subscribe' + ~? > dbug 'poke %sub to tell it to subscribe' =/ =task:gall [%deal [~nec ~nec /] %sub %poke watch+!>(~bud)] =^ t1 gall.nec %: gall-check-call:v gall.nec @@ -26,7 +27,7 @@ == :- t1 |. :- %| :: handle gall passing the %watch to itself, which passes to ames - ~& > 'handle gall passing the %watch to itself, which passes to ames' + ~? > dbug 'handle gall passing the %watch to itself, which passes to ames' =^ t2 gall.nec %: gall-check-call:v gall.nec [~1111.1.1 0xdead.beef *roof] @@ -40,7 +41,7 @@ == :- t2 |. :- %| :: subscriber ames handles %plea from gall, gives a packet to vere - ~& > 'subscriber ames handles %plea from gall, gives a packet to vere' + ~? > dbug 'subscriber ames handles %plea from gall, gives a packet to vere' =^ t3 ames.nec %: ames-check-call:v ames.nec [~1111.1.1 0xdead.beef *roof] @@ -60,7 +61,7 @@ == :- t3 |. :- %| :: publisher ames hears %watch, passes to gall - ~& > 'publisher ames hears %watch, passes to gall' + ~? > dbug 'publisher ames hears %watch, passes to gall' =^ t4 ames.bud %: ames-check-call:v ames.bud [~1111.1.2 0xbeef.dead *roof] @@ -77,7 +78,7 @@ == :- t4 |. :- %| :: publisher gall hears %watch from ames, passes to itself - ~& > 'publisher gall hears %watch from ames, passes to itself' + ~? > dbug 'publisher gall hears %watch from ames, passes to itself' =^ t5 gall.bud %: gall-check-call:v gall.bud [~1111.1.2 0xbeef.dead *roof] @@ -91,7 +92,7 @@ == :- t5 |. :- %| :: publisher gall runs %pub with %watch, gives ack to itself - ~& > 'publisher gall runs %pub with %watch, gives ack to itself' + ~? > dbug 'publisher gall runs %pub with %watch, gives ack to itself' =^ t6 gall.bud %: gall-check-call:v gall.bud [~1111.1.2 0xbeef.dead *roof] @@ -103,7 +104,7 @@ == :- t6 |. :- %| :: gall gives ack to ames - ~& > 'gall gives ack to ames' + ~? > dbug 'gall gives ack to ames' =^ t7 gall.bud %: gall-check-take:v gall.bud [~1111.1.2 0xbeef.dead *roof] @@ -114,7 +115,7 @@ == :- t7 |. :- %| :: publisher ames hears ack from gall, sends over the network - ~& > 'publisher ames hears ack from gall, sends over the network' + ~? > dbug 'publisher ames hears ack from gall, sends over the network' =^ t8 ames.bud %: ames-check-take:v ames.bud [~1111.1.2 0xbeef.dead *roof] @@ -128,7 +129,7 @@ == :- t8 |. :- %| :: subscriber ames hears watch-ack packet, gives to gall - ~& > 'subscriber ames hears watch-ack packet, gives to gall' + ~? > dbug 'subscriber ames hears watch-ack packet, gives to gall' =^ t9 ames.nec %: ames-check-call:v ames.nec [~1111.1.3 0xdead.beef *roof] @@ -148,7 +149,7 @@ == :- t9 |. :- %| :: gall gives %done to itself - ~& > 'gall gives %done to itself' + ~? > dbug 'gall gives %done to itself' =^ t10 gall.nec %: gall-check-take:v gall.nec [~1111.1.3 0xdead.beef *roof] @@ -161,7 +162,7 @@ == :- t10 |. :- %| :: gall gives watch-ack to itself - ~& > 'gall gives watch-ack to itself' + ~? > dbug 'gall gives watch-ack to itself' =^ t11 gall.nec %: gall-check-take:v gall.nec [~1111.1.3 0xdead.beef *roof] @@ -172,7 +173,7 @@ == :- t11 |. :- %| :: start the clog and kick process; give clog to publisher gall - ~& > 'start the clog and kick process; give clog to publisher gall' + ~? > dbug 'start the clog and kick process; give clog to publisher gall' =^ t12 gall.bud %: gall-check-take:v gall.bud [~1111.1.4 0xbeef.dead *roof] @@ -184,7 +185,7 @@ == :- t12 |. :- %| :: gall gives %kick %boon to ames - ~& > 'gall gives %kick %boon to ames' + ~? > dbug 'gall gives %kick %boon to ames' =^ t13 gall.bud %: gall-check-take:v gall.bud [~1111.1.4 0xbeef.dead *roof] @@ -195,7 +196,7 @@ == :- t13 |. :- %| :: ames gives kick over the network - ~& > 'ames gives kick over the network' + ~? > dbug 'ames gives kick over the network' =^ t14 ames.bud %: ames-check-take:v ames.bud [~1111.1.4 0xbeef.dead *roof] @@ -211,7 +212,7 @@ == :- t14 |. :- %| :: subscriber ames receives kick, gives to gall and gives ack to unix - ~& > 'subscriber ames receives kick, gives to gall and gives ack to unix' + ~? > dbug 'subscriber ames receives kick, gives to gall and gives ack to unix' =^ t15 ames.nec %: ames-check-call:v ames.nec [~1111.1.5 0xdead.beef *roof] @@ -233,7 +234,7 @@ == :- t15 |. :- %| :: subscriber gall receives kick %boon from ames, gives to self - ~& > 'subscriber gall receives kick %boon from ames, gives to self' + ~? > dbug 'subscriber gall receives kick %boon from ames, gives to self' =^ t16 gall.nec %: gall-check-take:v gall.nec [~1111.1.5 0xdead.beef *roof] @@ -247,7 +248,7 @@ == == :: subscriber gall receives %kick from itself - ~& > 'subscriber gall receives %kick from itself' + ~? > dbug 'subscriber gall receives %kick from itself' =^ t17 gall.nec %: gall-check-take:v gall.nec [~1111.1.5 0xdead.beef *roof] @@ -261,7 +262,7 @@ == :- t17 |. :- %| :: gall receives %deal %watch from itself, passes to ames - ~& > 'gall receives %deal %watch from itself, passes to ames' + ~? > dbug 'gall receives %deal %watch from itself, passes to ames' =^ t18 gall.nec %: gall-check-call:v gall.nec [~1111.1.5 0xdead.beef *roof] @@ -273,7 +274,7 @@ == :- t18 |. :- %| :: subscriber ames sends new %watch - ~& > 'subscriber ames sends new %watch' + ~? > dbug 'subscriber ames sends new %watch' =^ t19 ames.nec %: ames-check-call:v ames.nec [~1111.1.5 0xdead.beef *roof] @@ -292,7 +293,7 @@ == :- t19 |. :- %| :: subscriber ames sends %cork - ~& > 'subscriber ames sends %cork' + ~? > dbug 'subscriber ames sends %cork' =^ t20 ames.nec %: ames-check-call:v ames.nec [~1111.1.5 0xdead.beef *roof] @@ -310,7 +311,7 @@ == == :: publisher ames hears %kick ack - ~& > 'publisher ames hears %kick ack' + ~? > dbug 'publisher ames hears %kick ack' :- t20 |. :- %| =^ t21 ames.bud %: ames-check-call:v ames.bud @@ -324,7 +325,7 @@ == == :: publisher ames hears new %watch - ~& > 'publisher ames hears new %watch' + ~? > dbug 'publisher ames hears new %watch' :- t21 |. :- %| =^ t22 ames.bud %: ames-check-call:v ames.bud @@ -339,7 +340,7 @@ == == :: publisher gall hears new %watch, passes to self - ~& > 'publisher gall hears new %watch, passes to self' + ~? > dbug 'publisher gall hears new %watch, passes to self' :- t22 |. :- %| =^ t23 gall.bud %: gall-check-call:v gall.bud @@ -351,7 +352,7 @@ == == :: publisher gall runs :pub's +on-watch, gives ack to self - ~& > 'publisher gall runs :pub\'s +on-watch, gives ack to self' + ~? > dbug 'publisher gall runs :pub\'s +on-watch, gives ack to self' :- t23 |. :- %| =^ t24 gall.bud %: gall-check-call:v gall.bud @@ -363,7 +364,7 @@ == == :: publisher gall hears %watch-ack, gives to ames - ~& > 'publisher gall hears %watch-ack, gives to ames' + ~? > dbug 'publisher gall hears %watch-ack, gives to ames' :- t24 |. :- %| =^ t25 gall.bud %: gall-check-take:v gall.bud @@ -374,7 +375,7 @@ == == :: publisher ames hears done from gall, sends over the network - ~& > 'publisher ames hears done from gall, sends over the network' + ~? > dbug 'publisher ames hears done from gall, sends over the network' :- t25 |. :- %| =^ t26 ames.bud %: ames-check-take:v ames.bud @@ -388,7 +389,7 @@ == == == :: publisher ames hears %cork, passes to itself - ~& > 'publisher ames hears %cork, passes to itself' + ~? > dbug 'publisher ames hears %cork, passes to itself' :- t26 |. :- %| =^ t27 ames.bud %: ames-check-call:v ames.bud @@ -403,7 +404,7 @@ == :- t27 |. :- %| :: publisher ames hear cork plea from self, give %done to self - ~& > 'publisher ames hear cork plea from self, give %done to self' + ~? > dbug 'publisher ames hear cork plea from self, give %done to self' =^ t28 ames.bud %: ames-check-call:v ames.bud [~1111.1.8 0xbeef.dead *roof] @@ -413,7 +414,7 @@ == == :: publisher ames hears cork done from self, sends ack and $cork to self - ~& > 'publisher ames hears cork done from self, sends ack and $cork to self' + ~? > dbug 'publisher ames hears cork done from self, sends ack and $cork to self' :- t28 |. :- %| =^ t29 ames.bud %: ames-check-take:v ames.bud @@ -428,7 +429,7 @@ == == == :: subscriber ames hears %watch-ack, gives to gall - ~& > 'subscriber ames hears %watch-ack, gives to gall' + ~? > dbug 'subscriber ames hears %watch-ack, gives to gall' :- t29 |. :- %| =^ t30 ames.nec %: ames-check-call:v ames.nec @@ -447,7 +448,7 @@ == == :: subscriber gall hears new %watch-ack from ames, gives to self - ~& > 'subscriber gall hears new %watch-ack from ames, gives to self' + ~? > dbug 'subscriber gall hears new %watch-ack from ames, gives to self' :- t30 |. :- %| =^ t31 gall.nec %: gall-check-take:v gall.nec @@ -464,7 +465,7 @@ == == :: subscriber gall hears new %watch-ack from self, tells :sub - ~& > 'subscriber gall hears new %watch-ack from self, tells :sub' + ~? > dbug 'subscriber gall hears new %watch-ack from self, tells :sub' :- t31 |. :- %| =^ t32 gall.nec %: gall-check-take:v gall.nec @@ -475,7 +476,7 @@ ~ == :: subscriber ames hears %cork ack, sends $kill to self - ~& > 'subscriber ames hears %cork ack, sends $kill to self' + ~? > dbug 'subscriber ames hears %cork ack, sends $kill to self' :- t32 |. :- %| =^ t33 ames.nec %: ames-check-call:v ames.nec @@ -493,7 +494,7 @@ == == :: subscriber ames hears $kill from self, deletes the flow - ~& > 'subscriber ames hears $kill from self, deletes the flow' + ~? > dbug 'subscriber ames hears $kill from self, deletes the flow' :- t33 |. :- %| =^ t34 ames.nec %: ames-check-call:v ames.nec diff --git a/tests/sys/vane/eyre.hoon b/tests/sys/vane/eyre.hoon index db6e35a98..7aae1175e 100644 --- a/tests/sys/vane/eyre.hoon +++ b/tests/sys/vane/eyre.hoon @@ -1314,7 +1314,7 @@ |= =time %+ ex ~[/http-blah] =. time (sub time (mod time ~h1)) - [%pass wire %a %keen ~sampel /e/x/(scot %da time)//eauth/url] + [%pass wire %a %keen ~ ~sampel /e/x/(scot %da time)//eauth/url] :: ++ ex-yawn |= =time diff --git a/tests/sys/vane/gall.hoon b/tests/sys/vane/gall.hoon index 73469503d..a9ffc97d8 100644 --- a/tests/sys/vane/gall.hoon +++ b/tests/sys/vane/gall.hoon @@ -1,7 +1,7 @@ /+ *test /= gall-raw /sys/vane/gall :: -=/ gall-gate (gall-raw ~nec) +=/ nec (gall-raw ~nec) :: |% :: +test-init: test %init @@ -16,22 +16,22 @@ =/ =task:gall [%init ~] [duct task] :: - =/ expected-moves=(list move:gall-gate) ~ + =/ expected-moves=(list move:nec) ~ :: =/ res - (gall-call gall-gate time *roof call-args expected-moves) + (gall-call nec time *roof call-args expected-moves) :: -.res :: +gall-call: have %gall run a +task and assert it produces expected-moves :: ++ gall-call - |= $: gall-gate=_gall-gate + |= $: nec=_nec now=@da scry=roof call-args=[=duct wrapped-task=(hobo task:gall)] - expected-moves=(list move:gall-gate) + expected-moves=(list move:nec) == - =/ gall-core (gall-gate now=now eny=`@`0xdead.beef scry=scry) + =/ gall-core (nec now=now eny=`@`0xdead.beef scry=scry) :: =/ res =/ =type -:!>(*task:gall) @@ -43,4 +43,5 @@ !> -.res :: [output +.res] +:: --