summary refs log tree commit diff
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-08-12 12:34:14 +0200
committertalyz <kim.lindberger@gmail.com>2021-08-17 18:20:55 +0200
commit6fd5a40ccaf0b4da1362803a387bf46d381dd66a (patch)
treec3083a26d77adc9f505a73ea5b3f79ee7b44aa91
parentbb14315d51a1c35304dfd82ff5c1faeaaf2c450c (diff)
downloadnixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar.gz
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar.bz2
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar.lz
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar.xz
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.tar.zst
nixpkgs-6fd5a40ccaf0b4da1362803a387bf46d381dd66a.zip
discourse.tests: Test the appropriate discourse package
Perform the tests on the package that the `tests` attribute is a child
of, i.e. if `discourseAllPlugins.tests` is built, the tests will run
with the `discourseAllPlugins` package, not the `discourse` package as
previously.
-rw-r--r--nixos/tests/discourse.nix4
-rw-r--r--pkgs/servers/web-apps/discourse/default.nix6
2 files changed, 5 insertions, 5 deletions
diff --git a/nixos/tests/discourse.nix b/nixos/tests/discourse.nix
index 2ed6fb957c2..7dd39085a00 100644
--- a/nixos/tests/discourse.nix
+++ b/nixos/tests/discourse.nix
@@ -4,7 +4,7 @@
 #  3. replying to that message via email.
 
 import ./make-test-python.nix (
-  { pkgs, lib, ... }:
+  { pkgs, lib, package ? pkgs.discourse, ... }:
   let
     certs = import ./common/acme/server/snakeoil-certs.nix;
     clientDomain = "client.fake.domain";
@@ -55,7 +55,7 @@ import ./make-test-python.nix (
 
         services.discourse = {
           enable = true;
-          inherit admin;
+          inherit admin package;
           hostname = discourseDomain;
           sslCertificate = "${certs.${discourseDomain}.cert}";
           sslCertificateKey = "${certs.${discourseDomain}.key}";
diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix
index 8bec7827e78..639b1507841 100644
--- a/pkgs/servers/web-apps/discourse/default.nix
+++ b/pkgs/servers/web-apps/discourse/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, runCommand, lib, nixosTests, writeShellScript
+{ stdenv, pkgs, makeWrapper, runCommand, lib, writeShellScript
 , fetchFromGitHub, bundlerEnv, callPackage
 
 , ruby, replace, gzip, gnutar, git, cacert, util-linux, gawk
@@ -6,7 +6,7 @@
 , redis, postgresql, which, brotli, procps, rsync, nodePackages, v8
 
 , plugins ? []
-}:
+}@args:
 
 let
   version = "2.7.7";
@@ -293,7 +293,7 @@ let
       enabledPlugins = plugins;
       plugins = callPackage ./plugins/all-plugins.nix { inherit mkDiscoursePlugin; };
       ruby = rubyEnv.wrappedRuby;
-      tests = nixosTests.discourse;
+      tests = import ../../../../nixos/tests/discourse.nix { package = pkgs.discourse.override args; };
     };
   };
 in discourse