summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-10-01 17:03:32 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-10-01 19:13:18 +0000
commit50b29bf6aae0fcbe6e6423369de438616e9c8c75 (patch)
treef0bcfef755471bf6cefbf84ed4ceb6dec2581dc1
parentnixos/nextcloud: use php8 where possible (diff)
downloadnixpkgs-50b29bf6aae0fcbe6e6423369de438616e9c8c75.tar.gz
nixos/nextcloud: run tests against each Nextcloud instance
(cherry picked from commit 10703a8c926e182311cdf538937517db33f4261c)
-rw-r--r--nixos/tests/nextcloud/basic.nix7
-rw-r--r--nixos/tests/nextcloud/default.nix22
-rw-r--r--nixos/tests/nextcloud/with-mysql-and-memcached.nix7
-rw-r--r--nixos/tests/nextcloud/with-postgresql-and-redis.nix7
4 files changed, 32 insertions, 11 deletions
diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix
index c4ce34748ace..40ee9d5184cc 100644
--- a/nixos/tests/nextcloud/basic.nix
+++ b/nixos/tests/nextcloud/basic.nix
@@ -1,4 +1,6 @@
-import ../make-test-python.nix ({ pkgs, ...}: let
+args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "notproduction";
adminuser = "root";
in {
@@ -39,6 +41,7 @@ in {
inherit adminpass;
dbtableprefix = "nixos_";
};
+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
autoUpdateApps = {
enable = true;
startAt = "20:00";
@@ -100,4 +103,4 @@ in {
)
assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
'';
-})
+})) args
diff --git a/nixos/tests/nextcloud/default.nix b/nixos/tests/nextcloud/default.nix
index e4c7a70606cf..65043e509b3b 100644
--- a/nixos/tests/nextcloud/default.nix
+++ b/nixos/tests/nextcloud/default.nix
@@ -2,8 +2,20 @@
config ? {},
pkgs ? import ../../.. { inherit system config; }
}:
-{
- basic = import ./basic.nix { inherit system pkgs; };
- with-postgresql-and-redis = import ./with-postgresql-and-redis.nix { inherit system pkgs; };
- with-mysql-and-memcached = import ./with-mysql-and-memcached.nix { inherit system pkgs; };
-}
+
+with pkgs.lib;
+
+foldl
+ (matrix: ver: matrix // {
+ "basic${toString ver}" = import ./basic.nix { inherit system pkgs; nextcloudVersion = ver; };
+ "with-postgresql-and-redis${toString ver}" = import ./with-postgresql-and-redis.nix {
+ inherit system pkgs;
+ nextcloudVersion = ver;
+ };
+ "with-mysql-and-memcached${toString ver}" = import ./with-mysql-and-memcached.nix {
+ inherit system pkgs;
+ nextcloudVersion = ver;
+ };
+ })
+ {}
+ [ 20 21 22 ]
diff --git a/nixos/tests/nextcloud/with-mysql-and-memcached.nix b/nixos/tests/nextcloud/with-mysql-and-memcached.nix
index de5f53d559a3..c0df773eaaa8 100644
--- a/nixos/tests/nextcloud/with-mysql-and-memcached.nix
+++ b/nixos/tests/nextcloud/with-mysql-and-memcached.nix
@@ -1,4 +1,6 @@
-import ../make-test-python.nix ({ pkgs, ...}: let
+args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "root";
in {
@@ -18,6 +20,7 @@ in {
enable = true;
hostName = "nextcloud";
https = true;
+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
caching = {
apcu = true;
redis = false;
@@ -103,4 +106,4 @@ in {
"${withRcloneEnv} ${diffSharedFile}"
)
'';
-})
+})) args
diff --git a/nixos/tests/nextcloud/with-postgresql-and-redis.nix b/nixos/tests/nextcloud/with-postgresql-and-redis.nix
index 81af620598ee..36a69fda505b 100644
--- a/nixos/tests/nextcloud/with-postgresql-and-redis.nix
+++ b/nixos/tests/nextcloud/with-postgresql-and-redis.nix
@@ -1,4 +1,6 @@
-import ../make-test-python.nix ({ pkgs, ...}: let
+args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "custom-admin-username";
in {
@@ -17,6 +19,7 @@ in {
services.nextcloud = {
enable = true;
hostName = "nextcloud";
+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
caching = {
apcu = false;
redis = true;
@@ -96,4 +99,4 @@ in {
"${withRcloneEnv} ${diffSharedFile}"
)
'';
-})
+})) args