2019-02-12 02:25:25 +03:00
|
|
|
:: Test the pH of your aquarium. See if it's safe to put in real fish.
|
2019-02-06 05:21:41 +03:00
|
|
|
::
|
|
|
|
:: usage:
|
|
|
|
:: :aqua [%run-test %test-add]
|
|
|
|
::
|
|
|
|
:: TODO:
|
|
|
|
:: - Restore a fleet
|
|
|
|
:: - Compose tests
|
|
|
|
::
|
|
|
|
/- aquarium
|
|
|
|
/+ ph
|
|
|
|
=, aquarium
|
|
|
|
=, ph
|
|
|
|
=> $~ |%
|
|
|
|
++ move (pair bone card)
|
|
|
|
++ card
|
2019-02-09 00:34:24 +03:00
|
|
|
$% [%poke wire dock %aqua-events (list aqua-event)]
|
|
|
|
[%peer wire dock path]
|
|
|
|
[%pull wire dock ~]
|
2019-02-06 05:21:41 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ state
|
|
|
|
$: %0
|
2019-02-09 00:34:24 +03:00
|
|
|
raw-test-cores=(map term test-core)
|
|
|
|
test-cores=(map term [hers=(list ship) cor=test-core])
|
2019-02-06 05:21:41 +03:00
|
|
|
other-state
|
|
|
|
==
|
|
|
|
++ other-state
|
|
|
|
$~
|
|
|
|
--
|
|
|
|
=, gall
|
|
|
|
|_ $: hid=bowl
|
|
|
|
state
|
|
|
|
==
|
|
|
|
++ this .
|
|
|
|
++ install-tests
|
|
|
|
^+ this
|
2019-02-09 00:34:24 +03:00
|
|
|
=. raw-test-cores
|
2019-02-06 05:21:41 +03:00
|
|
|
%- malt
|
|
|
|
^- (list (pair term test-core))
|
|
|
|
:~
|
2019-02-09 00:34:24 +03:00
|
|
|
:- %add
|
|
|
|
=+ num=5
|
2019-02-06 05:21:41 +03:00
|
|
|
|%
|
2019-02-12 02:25:25 +03:00
|
|
|
++ ships ~[~bud]
|
2019-02-06 05:21:41 +03:00
|
|
|
++ start
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (pair (list ph-event) _..start)
|
2019-02-09 00:34:24 +03:00
|
|
|
=. num +(num)
|
2019-02-12 02:25:25 +03:00
|
|
|
:_ ..start
|
|
|
|
%- zing
|
|
|
|
:~ (init ~bud)
|
|
|
|
(dojo ~bud "[%test-result (add 2 3)]")
|
|
|
|
==
|
2019-02-06 05:21:41 +03:00
|
|
|
::
|
|
|
|
++ route
|
2019-02-08 05:03:46 +03:00
|
|
|
|= [who=ship ovo=unix-effect]
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (quip ph-event _..start)
|
2019-02-09 00:34:24 +03:00
|
|
|
~& [%num num]
|
2019-02-12 02:25:25 +03:00
|
|
|
:_ ..start
|
2019-02-08 05:03:46 +03:00
|
|
|
(expect-dojo-output ~bud who ovo "[%test-result 5]")
|
2019-02-06 05:21:41 +03:00
|
|
|
:: XX if it's been five minutes, we failed
|
|
|
|
--
|
|
|
|
::
|
2019-02-09 00:34:24 +03:00
|
|
|
:- %hi
|
2019-02-06 05:21:41 +03:00
|
|
|
|%
|
2019-02-12 02:53:23 +03:00
|
|
|
++ ships ~[~bud ~dev]
|
2019-02-06 05:21:41 +03:00
|
|
|
++ start
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (pair (list ph-event) _..start)
|
|
|
|
:_ ..start
|
|
|
|
%- zing
|
|
|
|
:~ (init ~bud)
|
|
|
|
(init ~dev)
|
|
|
|
(dojo ~bud "|hi ~dev")
|
|
|
|
==
|
2019-02-06 05:21:41 +03:00
|
|
|
::
|
|
|
|
++ route
|
2019-02-08 05:03:46 +03:00
|
|
|
|= [who=ship ovo=unix-effect]
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (quip ph-event _..start)
|
|
|
|
:_ ..start
|
2019-02-08 05:03:46 +03:00
|
|
|
(expect-dojo-output ~bud who ovo "hi ~dev successful")
|
2019-02-06 05:21:41 +03:00
|
|
|
--
|
2019-02-12 02:25:25 +03:00
|
|
|
::
|
2019-02-12 02:53:23 +03:00
|
|
|
[%headstart-bud (galaxy:head-starts ~bud)]
|
2019-02-12 02:25:25 +03:00
|
|
|
::
|
2019-02-12 02:53:23 +03:00
|
|
|
:- %composed-child-boot
|
|
|
|
%+ compose-tests (planet:head-starts ~linnup-torsyx)
|
2019-02-12 02:25:25 +03:00
|
|
|
^- test-core
|
|
|
|
|%
|
2019-02-12 02:53:23 +03:00
|
|
|
++ ships ~
|
2019-02-12 02:25:25 +03:00
|
|
|
++ start
|
2019-02-12 02:53:23 +03:00
|
|
|
[(dojo ~linnup-torsyx "|hi ~bud") ..start]
|
2019-02-12 02:25:25 +03:00
|
|
|
::
|
|
|
|
++ route
|
|
|
|
|= [who=ship ovo=unix-effect]
|
|
|
|
^- (quip ph-event _..start)
|
|
|
|
:_ ..start
|
2019-02-12 02:53:23 +03:00
|
|
|
%- on-dojo-output
|
|
|
|
:^ ~linnup-torsyx who ovo
|
|
|
|
:- "hi ~bud successful"
|
|
|
|
|= ~
|
|
|
|
[%test-done &]~
|
2019-02-12 02:25:25 +03:00
|
|
|
--
|
2019-02-09 02:21:40 +03:00
|
|
|
::
|
|
|
|
:- %child-sync
|
|
|
|
|%
|
2019-02-12 02:25:25 +03:00
|
|
|
++ ships ~[~bud ~marbud ~linnup-torsyx]
|
2019-02-09 02:21:40 +03:00
|
|
|
++ start
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (pair (list ph-event) _..start)
|
|
|
|
:_ ..start
|
|
|
|
%- zing
|
|
|
|
:~ (init ~bud)
|
|
|
|
==
|
|
|
|
::
|
2019-02-09 02:21:40 +03:00
|
|
|
++ route
|
|
|
|
|= [who=ship ovo=unix-effect]
|
2019-02-12 02:25:25 +03:00
|
|
|
^- (quip ph-event _..start)
|
|
|
|
:_ ..start
|
2019-02-12 00:42:54 +03:00
|
|
|
%- zing
|
|
|
|
:~
|
|
|
|
%- on-dojo-output
|
|
|
|
:^ ~bud who ovo
|
|
|
|
:- "+ /~bud/base/2/web/testing/udon"
|
|
|
|
|= ~
|
|
|
|
(init ~marbud)
|
2019-02-09 06:18:38 +03:00
|
|
|
::
|
2019-02-12 00:42:54 +03:00
|
|
|
%- on-dojo-output
|
|
|
|
:^ ~marbud who ovo
|
|
|
|
:- "; ~bud is your neighbor"
|
|
|
|
|= ~
|
|
|
|
(init ~linnup-torsyx)
|
2019-02-09 06:18:38 +03:00
|
|
|
::
|
2019-02-12 00:42:54 +03:00
|
|
|
%- on-dojo-output
|
|
|
|
:^ ~linnup-torsyx who ovo
|
|
|
|
:- "; ~bud is your neighbor"
|
|
|
|
|= ~
|
|
|
|
(dojo ~linnup-torsyx "|hi ~bud")
|
|
|
|
::
|
|
|
|
%- on-dojo-output
|
|
|
|
:^ ~linnup-torsyx who ovo
|
|
|
|
:- "hi ~bud successful"
|
|
|
|
:: :- "; ~bud is your neighbor"
|
|
|
|
|= ~
|
|
|
|
[%test-done &]~
|
|
|
|
==
|
2019-02-09 02:21:40 +03:00
|
|
|
--
|
2019-02-12 02:25:25 +03:00
|
|
|
:: (dojo ~bud "\"magic-go\":[.^(")
|
|
|
|
:: (dojo ~bud "|mount %")
|
|
|
|
:: %+ insert-file ~bud
|
|
|
|
:: /(scot %p our.hid)/home/(scot %da now.hid)/sys/vane/clay/hoon
|
|
|
|
:: (init ~marbud)
|
|
|
|
:: (dojo ~marbud "|mount %")
|
|
|
|
:: %+ insert-file ~marbud
|
|
|
|
:: /(scot %p our.hid)/home/(scot %da now.hid)/sys/vane/clay/hoon
|
|
|
|
::
|
2019-02-09 02:21:40 +03:00
|
|
|
:: (init ~zod)
|
|
|
|
:: (init ~marzod)
|
|
|
|
:: wait for initial sync
|
|
|
|
:: change file on zod
|
|
|
|
:: check on ~marzod
|
2019-02-09 00:34:24 +03:00
|
|
|
::
|
|
|
|
:- %individual-breach
|
|
|
|
*test-core
|
|
|
|
::
|
|
|
|
:: (init ~zod)
|
|
|
|
:: (init ~marzod)
|
|
|
|
:: wait for sync to finish
|
|
|
|
:: cycle ~zod keys
|
|
|
|
:: verify it sunk
|
|
|
|
:: kill ~zod
|
|
|
|
:: (init ~zod) w/new keys
|
|
|
|
:: change file on ~zod
|
|
|
|
:: wait for sync to finish
|
2019-02-09 02:21:40 +03:00
|
|
|
:: verify file has changed on ~marzod
|
2019-02-09 00:34:24 +03:00
|
|
|
::
|
2019-02-06 05:21:41 +03:00
|
|
|
==
|
|
|
|
this
|
|
|
|
::
|
|
|
|
++ prep
|
|
|
|
|= old=(unit [@ tests=* rest=*])
|
2019-02-09 00:34:24 +03:00
|
|
|
^- (quip move _this)
|
2019-02-06 05:21:41 +03:00
|
|
|
=. this install-tests
|
|
|
|
?~ old
|
|
|
|
`this
|
|
|
|
=/ new ((soft other-state) rest.u.old)
|
|
|
|
?~ new
|
|
|
|
`this
|
2019-02-09 00:34:24 +03:00
|
|
|
`this(+<+>+> u.new)
|
2019-02-06 05:21:41 +03:00
|
|
|
::
|
|
|
|
++ run-events
|
2019-02-09 00:34:24 +03:00
|
|
|
|= [lab=term what=(list ph-event)]
|
|
|
|
^- (quip move _this)
|
2019-02-06 05:21:41 +03:00
|
|
|
?: =(~ what)
|
|
|
|
`this
|
|
|
|
=/ res
|
|
|
|
|- ^- (each (list aqua-event) $~)
|
|
|
|
?~ what
|
|
|
|
[%& ~]
|
|
|
|
?: ?=(%test-done -.i.what)
|
|
|
|
~& ?~(p.i.what "test successful" "test failed")
|
|
|
|
[%| ~]
|
|
|
|
=/ nex $(what t.what)
|
|
|
|
?: ?=(%| -.nex)
|
|
|
|
nex
|
|
|
|
[%& `aqua-event`i.what p.nex]
|
|
|
|
?: ?=(%| -.res)
|
2019-02-09 00:34:24 +03:00
|
|
|
(cancel-test lab)
|
2019-02-06 05:21:41 +03:00
|
|
|
[[ost.hid %poke /running [our.hid %aqua] %aqua-events p.res]~ this]
|
|
|
|
::
|
2019-02-09 00:34:24 +03:00
|
|
|
:: Cancel subscriptions to ships
|
|
|
|
::
|
|
|
|
++ cancel-test
|
|
|
|
|= lab=term
|
|
|
|
^- (quip move _this)
|
|
|
|
=/ test (~(get by test-cores) lab)
|
|
|
|
?~ test
|
|
|
|
`this
|
|
|
|
=. test-cores (~(del by test-cores) lab)
|
|
|
|
:_ this
|
|
|
|
%- zing
|
|
|
|
%+ turn hers.u.test
|
|
|
|
|= her=ship
|
|
|
|
^- (list move)
|
|
|
|
:~ [ost.hid %pull /[lab]/(scot %p her) [our.hid %aqua] ~]
|
|
|
|
:* ost.hid
|
|
|
|
%poke
|
|
|
|
/cancelling
|
|
|
|
[our.hid %aqua]
|
|
|
|
%aqua-events
|
|
|
|
[%pause-events her]~
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2019-02-06 05:21:41 +03:00
|
|
|
:: Should check whether we're already subscribed
|
|
|
|
::
|
|
|
|
++ subscribe-to-effects
|
|
|
|
|= [lab=@tas hers=(list ship)]
|
|
|
|
:_ this
|
|
|
|
%+ turn hers
|
|
|
|
|= her=ship
|
|
|
|
^- move
|
|
|
|
:* ost.hid
|
|
|
|
%peer
|
|
|
|
/[lab]/(scot %p her)
|
|
|
|
[our.hid %aqua]
|
|
|
|
/effects/(scot %p her)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ poke-noun
|
|
|
|
|= arg=*
|
2019-02-08 05:03:46 +03:00
|
|
|
~& %herm
|
2019-02-06 05:21:41 +03:00
|
|
|
^- (quip move _this)
|
|
|
|
?+ arg ~|(%bad-noun-arg !!)
|
|
|
|
[%run-test lab=@tas]
|
2019-02-12 02:25:25 +03:00
|
|
|
=/ res=[events=(list ph-event) new-state=test-core]
|
2019-02-09 00:34:24 +03:00
|
|
|
start:(~(got by raw-test-cores) lab.arg)
|
2019-02-12 02:25:25 +03:00
|
|
|
=. test-cores (~(put by test-cores) lab.arg [ships .]:new-state.res)
|
|
|
|
=^ moves-1 this (subscribe-to-effects lab.arg ships.new-state.res)
|
2019-02-09 00:34:24 +03:00
|
|
|
=^ moves-2 this (run-events lab.arg events.res)
|
2019-02-06 05:21:41 +03:00
|
|
|
[(weld moves-1 moves-2) this]
|
|
|
|
==
|
|
|
|
::
|
2019-02-08 05:03:46 +03:00
|
|
|
++ diff-aqua-effects
|
|
|
|
|= [way=wire ova=aqua-effects]
|
2019-02-06 05:21:41 +03:00
|
|
|
^- (quip move _this)
|
2019-02-08 05:03:46 +03:00
|
|
|
:: ~& [%diff-aqua-effect way who.ova]
|
2019-02-09 00:34:24 +03:00
|
|
|
?> ?=([@tas @ ~] way)
|
2019-02-06 05:21:41 +03:00
|
|
|
=/ lab i.way
|
2019-02-12 00:42:54 +03:00
|
|
|
=/ test-cor (~(get by test-cores) lab)
|
|
|
|
?~ test-cor
|
|
|
|
~& [%ph-dropping lab]
|
|
|
|
`this
|
2019-02-12 02:25:25 +03:00
|
|
|
=^ events u.test-cor
|
|
|
|
|- ^- (quip ph-event _u.test-cor)
|
|
|
|
?~ ovo.ova
|
|
|
|
[~ u.test-cor]
|
|
|
|
=^ events-1 cor.u.test-cor
|
|
|
|
(route:cor.u.test-cor who.ova i.ovo.ova)
|
|
|
|
=^ events-2 u.test-cor
|
|
|
|
$(ovo.ova t.ovo.ova)
|
|
|
|
[(weld events-1 events-2) u.test-cor]
|
|
|
|
=. test-cores (~(put by test-cores) lab u.test-cor)
|
|
|
|
(run-events lab events)
|
2019-02-06 05:21:41 +03:00
|
|
|
--
|