aqua: fix most tests

Small touch-ups to simulation behavior and ph tests. Most of them pass
now, even if they're still really slow at times.

The breach ones don't pass, but also complain of dangling bone, so might
work once the fix for that is in.
This commit is contained in:
fang 2022-03-23 22:19:35 +01:00
parent 804c8a8bb7
commit 3259f1f588
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
14 changed files with 60 additions and 41 deletions

View File

@ -395,6 +395,8 @@
|= p=pill
^- (quip card:agent:gall _state)
?< ?=(%ivory -.p)
::TODO should replace azimuth snapshot with stub?
:: keeping it in brings ships out of sync with aqua's azimuth state...
=. this apex-aqua =< abet-aqua
=. pil p
~& lent=(met 3 (jam boot-ova.pil))
@ -531,6 +533,10 @@
?- -.ae
::
%init-ship
::TODO maybe we could cache "real" ships too if we just injected
:: latest keys afterwards.
:: would still need separate "fake" and "real" caches though,
:: can't change the fake flag...
?: &(fake.ae (~(has by fresh-piers) who.ae))
~& [%aqua %cached-init who.ae]
=. this abet-pe:yaho:(pe who.ae)
@ -570,6 +576,7 @@
[/e/http-server/0v1n.2m9vh %born ~]
[/e/http-server/0v1n.2m9vh %live 8.080 `8.445]
[/a/newt/0v1n.2m9vh %born ~]
[/d/term/1 %hail ~]
==
==
=. this
@ -803,7 +810,7 @@
get-czars
~[~['arvo' 'netw' 'ork']]
0
`(need (de-purl:html 'http://localhost:8545'))
`(need (de-purl:html 'http://fake.aqua.domain/'))
==
::
:: Should only do galaxies

View File

@ -14,7 +14,7 @@
|= [our=ship her=ship uf=unix-effect azi=az-state]
^- (unit card:agent:gall)
=, enjs:format
=/ ask (extract-request uf 'http://localhost:8545/')
=/ ask (extract-request uf 'http://fake.aqua.domain/')
?~ ask
~
?~ body.request.u.ask

View File

@ -4,7 +4,7 @@
^- thread:spider
|= args=vase
=/ m (strand ,vase)
=+ !<(group=(list @tas) args)
=+ !<([~ group=(list @tas)] args)
;< =bowl:spider bind:m get-bowl
=/ threads=(list @tas)
?- group
@ -20,8 +20,8 @@
==
::
[%all ~]
=+ .^(=arch %cy /(scot %p our.bowl)/home/(scot %da now.bowl)/ted/ph)
%+ turn (turn ~(tap by dir.arch) head)
=+ .^(=arch %cy /(scot %p our.bowl)/base/(scot %da now.bowl)/ted/ph)
%+ turn (sort (turn ~(tap by dir.arch) head) aor)
|= =term
(cat 3 'ph-' term)
::
@ -29,11 +29,24 @@
(turn group |=(=term (cat 3 'ph-' term)))
==
::
=| results=(list [@tas thread-result])
=| results=(list [n=@tas r=thread-result])
|- ^- form:m
=* loop $
?~ threads
(pure:m !>(results))
;< =thread-result bind:m (await-thread i.threads *vase)
;< ~ bind:m (flog-text "ph-all: {<i.threads>} complete")
loop(threads t.threads, results [[i.threads thread-result] results])
?^ threads
?: =(%ph-all i.threads)
loop(threads t.threads)
;< ~ bind:m (flog-text "ph-all: {<i.threads>} started")
;< =thread-result bind:m (await-thread i.threads *vase)
;< ~ bind:m (flog-text "ph-all: {<i.threads>} complete")
loop(threads t.threads, results [[i.threads thread-result] results])
::
|-
=* loop $
?~ results (pure:m !>(~)) ::TODO maybe collate vases
?: ?=(%& -.r.i.results) loop(results t.results)
=* name n.i.results
=* mess p.r.i.results
;< ~ bind:m (flog-text "ph-all: {(trip name)} failed: {(trip -.mess)}")
;< ~ bind:m (flog-tang +.mess)
;< ~ bind:m (flog-text "")
loop(results t.results)

View File

@ -12,13 +12,13 @@
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (init-ship ~marbud |)
;< file=@t bind:m (touch-file ~bud %kids %foo)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m (breach-and-hear ~bud ~marbud)
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (breach-and-hear ~marbud ~bud)
;< ~ bind:m (init-ship ~marbud |)
;< file=@t bind:m (touch-file ~bud %kids %bar)
;< file=@t bind:m (touch-file ~bud %kids %baz)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m end
(pure:m *vase)

View File

@ -14,13 +14,13 @@
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (init-ship ~marbud |)
;< file=@t bind:m (touch-file ~bud %kids %foo)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m (breach ~bud)
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m
(dojo ~bud "|merge %home ~marbud %kids, =gem %only-this")
(dojo ~bud "|merge %base ~marbud %kids, =gem %only-this")
;< file=@t bind:m (touch-file ~bud %kids %bar)
;< file=@t bind:m (touch-file ~bud %kids %baz)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m end
(pure:m *vase)

View File

@ -1,5 +1,6 @@
:: This tests that syncs are correctly restarted after a breach
::
::TODO breach tests broken by dangling bone?
/- spider
/+ *ph-io
=, strand=strand:spider
@ -12,17 +13,17 @@
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (init-ship ~marbud |)
;< file=@t bind:m (touch-file ~bud %kids %foo)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
:: Merge so that when we unify history with the %only-this merge later, we
:: don't get a spurious conflict in %home
:: don't get a spurious conflict in %base
::
;< ~ bind:m (dojo ~marbud "|merge %kids our %home")
;< ~ bind:m (dojo ~marbud "|merge %kids our %base")
;< ~ bind:m (breach-and-hear ~bud ~marbud)
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m
(dojo ~bud "|merge %kids ~marbud %kids, =gem %only-this")
;< file=@t bind:m (touch-file ~bud %kids %bar)
;< file=@t bind:m (touch-file ~bud %kids %baz)
;< ~ bind:m (check-file-touched ~marbud %home file)
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m end
(pure:m *vase)

View File

@ -6,7 +6,7 @@
=/ m (strand ,vase)
;< ~ bind:m start-simple
;< ~ bind:m (init-ship ~bud &)
;< file=@t bind:m (touch-file ~bud %home %foo)
;< ~ bind:m (check-file-touched ~bud %home file)
;< file=@t bind:m (touch-file ~bud %base %foo)
;< ~ bind:m (check-file-touched ~bud %base file)
;< ~ bind:m end
(pure:m *vase)

View File

@ -7,8 +7,8 @@
;< ~ bind:m start-simple
;< ~ bind:m (init-ship ~bud &)
;< ~ bind:m (init-ship ~marbud &)
;< file=@t bind:m (touch-file ~bud %home %foo)
;< ~ bind:m (dojo ~bud "|merge %kids our %home")
;< ~ bind:m (check-file-touched ~marbud %home file)
;< file=@t bind:m (touch-file ~bud %base %foo)
;< ~ bind:m (dojo ~bud "|merge %kids our %base")
;< ~ bind:m (check-file-touched ~marbud %base file)
;< ~ bind:m end
(pure:m *vase)

View File

@ -6,9 +6,9 @@
|^
=/ m (strand ,vase)
;< ~ bind:m start-simple
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (init-ship ~marbud |)
;< [path @t] bind:m (modify ~bud %home)
;< ~ bind:m (init-ship ~bud &)
;< ~ bind:m (init-ship ~marbud &)
;< * bind:m (modify ~bud %base)
;< [=path file=@t] bind:m (modify ~bud %kids)
;< ~ bind:m (check-touched ~marbud %kids path file)
;< ~ bind:m end
@ -26,18 +26,16 @@
%^ cat 3 '=/ new-val 57 '
(get-val /sys/zuse/hoon)
=/ mar-contents
%^ cat 3 (get-val /mar/js/hoon)
' ~& > new-val=new-val .'
=/ js-contents
%^ cat 3 (get-val /app/landscape/js/channel/js)
'extra'
%^ cat 3 (get-val /mar/hoon/hoon)
::TODO doesn't get picked up somehow
:: ' ~& > new-val=new-val .'
' ~& > %testing .'
=/ files
:~ [/sys/zuse/hoon zuse-contents]
[/mar/js/hoon mar-contents]
[/app/landscape/js/channel/js js-contents]
:~ ::[/sys/zuse/hoon zuse-contents]
[/mar/hoon/hoon mar-contents]
==
;< ~ bind:m (send-events (insert-files:util her desk files))
(pure:m /app/landscape/js/channel/js js-contents)
(pure:m /mar/hoon/hoon mar-contents)
::
++ aqua-path
|= =path

View File

@ -8,7 +8,7 @@
^- form:m
=* loop $
;< [her=^ship =unix-effect] bind:m take-unix-effect
?: (is-dojo-output:util ship her unix-effect "activated app home/{(trip agent)}")
?: (is-dojo-output:util ship her unix-effect "activated app base/{(trip agent)}")
(pure:m ~)
loop
::

View File

@ -7,7 +7,6 @@
;< ~ bind:m start-simple
;< ~ bind:m (init-ship ~bud &)
;< ~ bind:m (init-ship ~dev &)
;< ~ bind:m (init-ship ~dev &)
;< ~ bind:m (send-hi ~bud ~dev)
;< ~ bind:m end
(pure:m *vase)

View File

@ -12,6 +12,7 @@
;< ~ bind:m (init-ship ~bud |)
;< ~ bind:m (init-ship ~marbud |)
;< ~ bind:m (init-ship ~linnup-torsyx |)
::TODO not supported!
;< ~ bind:m (init-ship ~linnup-torsyx-linnup-torsyx |)
;< ~ bind:m (send-hi ~bud ~linnup-torsyx-linnup-torsyx)
;< ~ bind:m (send-hi ~linnup-torsyx-linnup-torsyx ~marbud)

View File

@ -127,7 +127,7 @@
;< ~ bind:m (send-azimuth-action %breach who)
|- ^- form:m
=* loop $
;< ~ bind:m (sleep ~s1)
;< ~ bind:m (sleep ~s10)
;< =bowl:spider bind:m get-bowl
=/ aqua-pax
:- %i

View File

@ -59,7 +59,7 @@
::
:: Checks whether the given event is a dojo output blit containing the
:: given tape
::
::TODO should be rename -dill-output
++ is-dojo-output
|= [who=ship her=ship uf=unix-effect what=tape]
?& =(who her)