nixos/nextcloud: run tests against each Nextcloud instance
commit10703a8c926e182311cdf538937517db33f4261c
authorMaximilian Bosch <maximilian@mbosch.me>
dateFri 1 Oct 2021, 17:03 (5 years ago)
parent66edc1e
nixos/tests/nextcloud/basic.nix+5−2
@@ -1,4 +1,6 @@
1−import ../make-test-python.nix ({ pkgs, ...}: let
1+args@{ pkgs, nextcloudVersion ? 22, ... }:
2+
3+(import ../make-test-python.nix ({ pkgs, ...}: let
24 adminpass = "notproduction";
35 adminuser = "root";
46in {
@@ -39,6 +41,7 @@ in {
3941 inherit adminpass;
4042 dbtableprefix = "nixos_";
4143 };
44+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
4245 autoUpdateApps = {
4346 enable = true;
4447 startAt = "20:00";
@@ -100,4 +103,4 @@ in {
100103 )
101104 assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
102105 '';
103−})
106+})) args
nixos/tests/nextcloud/default.nix+17−5
@@ -2,8 +2,20 @@
22 config ? {},
33 pkgs ? import ../../.. { inherit system config; }
44}:
5−{
6− basic = import ./basic.nix { inherit system pkgs; };
7− with-postgresql-and-redis = import ./with-postgresql-and-redis.nix { inherit system pkgs; };
8− with-mysql-and-memcached = import ./with-mysql-and-memcached.nix { inherit system pkgs; };
9−}
5+
6+with pkgs.lib;
7+
8+foldl
9+ (matrix: ver: matrix // {
10+ "basic${toString ver}" = import ./basic.nix { inherit system pkgs; nextcloudVersion = ver; };
11+ "with-postgresql-and-redis${toString ver}" = import ./with-postgresql-and-redis.nix {
12+ inherit system pkgs;
13+ nextcloudVersion = ver;
14+ };
15+ "with-mysql-and-memcached${toString ver}" = import ./with-mysql-and-memcached.nix {
16+ inherit system pkgs;
17+ nextcloudVersion = ver;
18+ };
19+ })
20+ {}
21+ [ 20 21 22 ]
nixos/tests/nextcloud/with-mysql-and-memcached.nix+5−2
@@ -1,4 +1,6 @@
1−import ../make-test-python.nix ({ pkgs, ...}: let
1+args@{ pkgs, nextcloudVersion ? 22, ... }:
2+
3+(import ../make-test-python.nix ({ pkgs, ...}: let
24 adminpass = "hunter2";
35 adminuser = "root";
46in {
@@ -18,6 +20,7 @@ in {
1820 enable = true;
1921 hostName = "nextcloud";
2022 https = true;
23+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
2124 caching = {
2225 apcu = true;
2326 redis = false;
@@ -96,4 +99,4 @@ in {
9699 "${withRcloneEnv} ${diffSharedFile}"
97100 )
98101 '';
99−})
102+})) args
nixos/tests/nextcloud/with-postgresql-and-redis.nix+5−2
@@ -1,4 +1,6 @@
1−import ../make-test-python.nix ({ pkgs, ...}: let
1+args@{ pkgs, nextcloudVersion ? 22, ... }:
2+
3+(import ../make-test-python.nix ({ pkgs, ...}: let
24 adminpass = "hunter2";
35 adminuser = "custom-admin-username";
46in {
@@ -17,6 +19,7 @@ in {
1719 services.nextcloud = {
1820 enable = true;
1921 hostName = "nextcloud";
22+ package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
2023 caching = {
2124 apcu = false;
2225 redis = true;
@@ -96,4 +99,4 @@ in {
9699 "${withRcloneEnv} ${diffSharedFile}"
97100 )
98101 '';
99−})
102+})) args