1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

nixos/tests/php: add apcu to php to actually test whether extensions are properly loaded

This commit is contained in:
Maximilian Bosch 2021-03-04 16:06:37 +01:00
parent 70ac808b39
commit 5e5f482f32
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
2 changed files with 11 additions and 5 deletions

View file

@ -2,8 +2,14 @@
, config ? {}
, pkgs ? import ../../.. { inherit system config; }
, php ? pkgs.php
}: {
fpm = import ./fpm.nix { inherit system pkgs php; };
httpd = import ./httpd.nix { inherit system pkgs php; };
pcre = import ./pcre.nix { inherit system pkgs php; };
}:
let
php' = php.buildEnv {
extensions = { enabled, all }: with all; enabled ++ [ apcu ];
};
in {
fpm = import ./fpm.nix { inherit system pkgs; php = php'; };
httpd = import ./httpd.nix { inherit system pkgs; php = php'; };
pcre = import ./pcre.nix { inherit system pkgs; php = php'; };
}

View file

@ -50,7 +50,7 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
assert "PHP Version ${php.version}" in response, "PHP version not detected"
# Check so we have database and some other extensions loaded
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite", "apcu"]:
assert ext in response, f"Missing {ext} extension"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
'';