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 {};
photonvision = handleTest ./photonvision.nix {};
photoprism = handleTest ./photoprism.nix {};
php = handleTest ./php {};
php81 = handleTest ./php { php = pkgs.php81; };
php82 = handleTest ./php { php = pkgs.php82; };
php83 = handleTest ./php { php = pkgs.php83; };
php84 = handleTest ./php { php = pkgs.php84; };
php = import ./php/default.nix {
inherit runTest;
php = pkgs.php;
};
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 {};
pict-rs = handleTest ./pict-rs.nix {};
pingvin-share = handleTest ./pingvin-share.nix {} ;

View file

@ -1,8 +1,6 @@
{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../../.. { inherit system config; },
php ? pkgs.php,
runTest,
php,
}:
let
@ -11,16 +9,16 @@ let
};
in
{
fpm = import ./fpm.nix {
inherit system pkgs;
php = php';
fpm = runTest {
imports = [ ./fpm.nix ];
_module.args.php = php';
};
httpd = import ./httpd.nix {
inherit system pkgs;
php = php';
httpd = runTest {
imports = [ ./httpd.nix ];
_module.args.php = php';
};
pcre = import ./pcre.nix {
inherit system pkgs;
php = php';
pcre = runTest {
imports = [ ./pcre.nix ];
_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";
meta.maintainers = lib.teams.php.members;
nodes.machine = { config, lib, pkgs, ... }: {
nodes.machine =
{ config, pkgs, ... }:
{
environment.systemPackages = [ php ];
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("phpfpm-foobar.service")
@ -56,4 +61,4 @@ import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
assert ext in response, f"Missing {ext} extension"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
'';
})
}

View file

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

View file

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