mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixosTests/odoo: add new multi-process test
This commit is contained in:
@@ -1168,15 +1168,27 @@ in
|
||||
octoprint = runTest ./octoprint.nix;
|
||||
oddjobd = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./oddjobd.nix { };
|
||||
odoo17 = runTest {
|
||||
imports = [ ./odoo.nix ];
|
||||
imports = [ ./odoo/single-process.nix ];
|
||||
_module.args.package = pkgs.odoo17;
|
||||
};
|
||||
odoo17-multiprocess = runTest {
|
||||
imports = [ ./odoo/multi-process.nix ];
|
||||
_module.args.package = pkgs.odoo17;
|
||||
};
|
||||
odoo18 = runTest {
|
||||
imports = [ ./odoo.nix ];
|
||||
imports = [ ./odoo/single-process.nix ];
|
||||
_module.args.package = pkgs.odoo18;
|
||||
};
|
||||
odoo18-multiprocess = runTest {
|
||||
imports = [ ./odoo/multi-process.nix ];
|
||||
_module.args.package = pkgs.odoo18;
|
||||
};
|
||||
odoo19 = runTest {
|
||||
imports = [ ./odoo.nix ];
|
||||
imports = [ ./odoo/single-process.nix ];
|
||||
_module.args.package = pkgs.odoo19;
|
||||
};
|
||||
odoo19-multiprocess = runTest {
|
||||
imports = [ ./odoo/multi-process.nix ];
|
||||
_module.args.package = pkgs.odoo19;
|
||||
};
|
||||
oh-my-zsh = runTest ./oh-my-zsh.nix;
|
||||
|
||||
39
nixos/tests/odoo/multi-process.nix
Normal file
39
nixos/tests/odoo/multi-process.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
package,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "odoo-multi-process";
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
mkg20001
|
||||
xanderio
|
||||
];
|
||||
|
||||
nodes.server = {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
services.odoo = {
|
||||
enable = true;
|
||||
package = package;
|
||||
autoInit = true;
|
||||
autoInitExtraFlags = [ "--without-demo=all" ];
|
||||
domain = "localhost";
|
||||
settings.options.workers = 2;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = # python
|
||||
''
|
||||
server.wait_for_unit("odoo.service")
|
||||
server.wait_until_succeeds(
|
||||
"test $(journalctl -u odoo | grep -o 'Worker WorkerHTTP ([[:digit:]]*) alive' | wc -l) = 2"
|
||||
)
|
||||
server.wait_until_succeeds("curl -s http://localhost:8069/web/database/selector | grep '<title>Odoo</title>'")
|
||||
server.succeed("curl -s http://localhost/web/database/selector | grep '<title>Odoo</title>'")
|
||||
server.succeed("curl http://localhost/web/database/manager | grep 'database manager has been disabled'")
|
||||
'';
|
||||
}
|
||||
@@ -4,8 +4,11 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "odoo";
|
||||
meta.maintainers = with lib.maintainers; [ mkg20001 ];
|
||||
name = "odoo-single-process";
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
mkg20001
|
||||
xanderio
|
||||
];
|
||||
|
||||
nodes.server = {
|
||||
services.nginx = {
|
||||
@@ -118,7 +118,7 @@ python.pkgs.buildPythonApplication rec {
|
||||
passthru = {
|
||||
updateScript = ./update.sh;
|
||||
tests = {
|
||||
inherit (nixosTests) odoo17;
|
||||
inherit (nixosTests) odoo17 odoo17-multiprocess;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ python.pkgs.buildPythonApplication rec {
|
||||
passthru = {
|
||||
updateScript = ./update.sh;
|
||||
tests = {
|
||||
inherit (nixosTests) odoo18;
|
||||
inherit (nixosTests) odoo18 odoo18-multiprocess;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ python.pkgs.buildPythonApplication rec {
|
||||
passthru = {
|
||||
updateScript = ./update.sh;
|
||||
tests = {
|
||||
inherit (nixosTests) odoo19;
|
||||
inherit (nixosTests) odoo19 odoo19-multiprocess;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user