1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-09 17:46:29 +09:00

nixosTests.php: migrate to runTest

This commit is contained in:
Piotr Kwiecinski 2025-03-14 19:11:10 +01:00 committed by Masum Reza
parent a212f0886c
commit e44f5a37cf
5 changed files with 180 additions and 168 deletions

View file

@ -914,11 +914,26 @@ in {
phosh = handleTest ./phosh.nix {}; phosh = handleTest ./phosh.nix {};
photonvision = handleTest ./photonvision.nix {}; photonvision = handleTest ./photonvision.nix {};
photoprism = handleTest ./photoprism.nix {}; photoprism = handleTest ./photoprism.nix {};
php = handleTest ./php {}; php = import ./php/default.nix {
php81 = handleTest ./php { php = pkgs.php81; }; inherit runTest;
php82 = handleTest ./php { php = pkgs.php82; }; php = pkgs.php;
php83 = handleTest ./php { php = pkgs.php83; }; };
php84 = handleTest ./php { php = pkgs.php84; }; php81 = import ./php/default.nix {
inherit runTest;
php = pkgs.php81;
};
php82 = import ./php/default.nix {
inherit runTest;
php = pkgs.php82;
};
php83 = import ./php/default.nix {
inherit runTest;
php = pkgs.php83;
};
php84 = import ./php/default.nix {
inherit runTest;
php = pkgs.php84;
};
phylactery = handleTest ./web-apps/phylactery.nix {}; phylactery = handleTest ./web-apps/phylactery.nix {};
pict-rs = handleTest ./pict-rs.nix {}; pict-rs = handleTest ./pict-rs.nix {};
pingvin-share = handleTest ./pingvin-share.nix {} ; pingvin-share = handleTest ./pingvin-share.nix {} ;

View file

@ -1,8 +1,6 @@
{ {
system ? builtins.currentSystem, runTest,
config ? { }, php,
pkgs ? import ../../.. { inherit system config; },
php ? pkgs.php,
}: }:
let let
@ -11,16 +9,16 @@ let
}; };
in in
{ {
fpm = import ./fpm.nix { fpm = runTest {
inherit system pkgs; imports = [ ./fpm.nix ];
php = php'; _module.args.php = php';
}; };
httpd = import ./httpd.nix { httpd = runTest {
inherit system pkgs; imports = [ ./httpd.nix ];
php = php'; _module.args.php = php';
}; };
pcre = import ./pcre.nix { pcre = runTest {
inherit system pkgs; imports = [ ./pcre.nix ];
php = php'; _module.args.php = php';
}; };
} }

View file

@ -1,8 +1,11 @@
import ../make-test-python.nix ({ pkgs, lib, php, ... }: { { lib, php, ... }:
{
name = "php-${php.version}-fpm-nginx-test"; name = "php-${php.version}-fpm-nginx-test";
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
nodes.machine = { config, lib, pkgs, ... }: { nodes.machine =
{ config, pkgs, ... }:
{
environment.systemPackages = [ php ]; environment.systemPackages = [ php ];
services.nginx = { services.nginx = {
@ -43,7 +46,9 @@ import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
}; };
}; };
}; };
testScript = { ... }: '' testScript =
{ ... }:
''
machine.wait_for_unit("nginx.service") machine.wait_for_unit("nginx.service")
machine.wait_for_unit("phpfpm-foobar.service") machine.wait_for_unit("phpfpm-foobar.service")
@ -56,4 +61,4 @@ import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
assert ext in response, f"Missing {ext} extension" assert ext in response, f"Missing {ext} extension"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"') machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
''; '';
}) }

View file

@ -1,6 +1,4 @@
import ../make-test-python.nix (
{ {
pkgs,
lib, lib,
php, php,
... ...
@ -12,7 +10,6 @@ import ../make-test-python.nix (
nodes.machine = nodes.machine =
{ {
config, config,
lib,
pkgs, pkgs,
... ...
}: }:
@ -48,4 +45,3 @@ import ../make-test-python.nix (
assert ext in response, f"Missing {ext} extension" assert ext in response, f"Missing {ext} extension"
''; '';
} }
)

View file

@ -1,7 +1,6 @@
let let
testString = "can-use-subgroups"; testString = "can-use-subgroups";
in in
import ../make-test-python.nix (
{ {
pkgs, pkgs,
lib, lib,
@ -13,7 +12,7 @@ import ../make-test-python.nix (
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
nodes.machine = nodes.machine =
{ lib, pkgs, ... }: { pkgs, ... }:
{ {
time.timeZone = "UTC"; time.timeZone = "UTC";
services.httpd = { services.httpd = {
@ -60,4 +59,3 @@ import ../make-test-python.nix (
machine.succeed("${php}/bin/php -f ${pcreJitSeallocForkIssue}") machine.succeed("${php}/bin/php -f ${pcreJitSeallocForkIssue}")
''; '';
} }
)