nixosTests/odoo: add new multi-process test

This commit is contained in:
Alexander Sieg
2026-04-27 10:22:51 +02:00
parent 6d72b67f3e
commit 98a3cc1471
6 changed files with 62 additions and 8 deletions

View File

@@ -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;

View 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'")
'';
}

View File

@@ -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 = {

View File

@@ -118,7 +118,7 @@ python.pkgs.buildPythonApplication rec {
passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo17;
inherit (nixosTests) odoo17 odoo17-multiprocess;
};
};

View File

@@ -104,7 +104,7 @@ python.pkgs.buildPythonApplication rec {
passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo18;
inherit (nixosTests) odoo18 odoo18-multiprocess;
};
};

View File

@@ -99,7 +99,7 @@ python.pkgs.buildPythonApplication rec {
passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo19;
inherit (nixosTests) odoo19 odoo19-multiprocess;
};
};