mirror of
https://github.com/Platonic-Systems/process-compose-flake.git
synced 2024-09-11 14:07:00 +03:00
Rename to wait_until; add example
This commit is contained in:
parent
6d6303a912
commit
7fc9abf8e1
@ -55,7 +55,7 @@
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
process_compose.wait(lambda procs:
|
||||
process_compose.wait_until(lambda procs:
|
||||
procs["sqlite-web"]["is_ready"] == "Ready"
|
||||
)
|
||||
machine.succeed("curl -v http://localhost:${builtins.toString port}/")
|
||||
|
@ -11,7 +11,7 @@ let
|
||||
return json.loads(
|
||||
machine.succeed("${lib.getExe pkgs.xh} get " + url))
|
||||
|
||||
def wait(self, ready, timeout_mins=1):
|
||||
def wait_until(self, ready, timeout_mins=1):
|
||||
import time
|
||||
import json
|
||||
machine.wait_for_unit("default.target")
|
||||
@ -48,11 +48,17 @@ in
|
||||
|
||||
Useful if you want to test your configuration in CI.
|
||||
|
||||
The testScript will have access to `process_comose.wait` function that
|
||||
it can be used to get the running process information, after waiting for
|
||||
The testScript will have access to `process_compose.wait` function that
|
||||
can be used to get the running process information, after waiting for
|
||||
the specified readiness status.
|
||||
'';
|
||||
default = null;
|
||||
example = ''
|
||||
process_compose.wait_until(lambda procs:
|
||||
procs["netdata"]["is_ready"] == "Ready"
|
||||
)
|
||||
machine.succeed("curl -v http://localhost:19999/")
|
||||
'';
|
||||
};
|
||||
outputs.check = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
|
Loading…
Reference in New Issue
Block a user