mirror of
https://github.com/juspay/services-flake.git
synced 2024-08-16 15:50:38 +03:00
[Postgres]: Fix test
process not starting (#78)
* needn't copy depends_on option, demonstrated in example/flake.nix * postgres: test process must depend on both pg1 and pg2
This commit is contained in:
parent
5365c6a4dd
commit
bf3a582502
@ -43,6 +43,8 @@
|
||||
listen_addresses = "127.0.0.1";
|
||||
port = 5433;
|
||||
};
|
||||
# Start `pg2-init` process after `pg1-init`
|
||||
settings.processes."pg2-init".depends_on."pg1-init".condition = "process_completed_successfully";
|
||||
|
||||
settings.processes.pgweb =
|
||||
let
|
||||
|
@ -230,24 +230,6 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
depends_on = lib.mkOption {
|
||||
description = "Extra process dependency relationships for `${name}-init` process.";
|
||||
type = types.nullOr (types.attrsOf (types.submodule {
|
||||
options = {
|
||||
condition = lib.mkOption {
|
||||
type = types.enum [
|
||||
"process_completed"
|
||||
"process_completed_successfully"
|
||||
"process_healthy"
|
||||
"process_started"
|
||||
];
|
||||
example = "process_healthy";
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = null;
|
||||
};
|
||||
|
||||
initialScript = lib.mkOption {
|
||||
type = types.submodule ({ config, ... }: {
|
||||
options = {
|
||||
@ -298,7 +280,6 @@ in
|
||||
in
|
||||
{
|
||||
command = setupScript;
|
||||
depends_on = config.depends_on;
|
||||
namespace = name;
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
# avoid both the processes trying to create `data` directory at the same time
|
||||
settings.processes."pg2-init".depends_on."pg1-init".condition = "process_completed_successfully";
|
||||
settings.processes.test =
|
||||
let
|
||||
cfg = config.services.postgres."pg1";
|
||||
@ -39,6 +41,9 @@
|
||||
'';
|
||||
name = "postgres-test";
|
||||
};
|
||||
depends_on."pg1".condition = "process_healthy";
|
||||
depends_on = {
|
||||
"pg1".condition = "process_healthy";
|
||||
"pg2".condition = "process_healthy";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user