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.

talyz 6fd5a40c bb14315d

Changed files
+5 -5
nixos
pkgs
servers
web-apps
discourse
+2 -2
nixos/tests/discourse.nix
···
# 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";
···
services.discourse = {
enable = true;
-
inherit admin;
+
inherit admin package;
hostname = discourseDomain;
sslCertificate = "${certs.${discourseDomain}.cert}";
sslCertificateKey = "${certs.${discourseDomain}.key}";
+3 -3
pkgs/servers/web-apps/discourse/default.nix
···
-
{ stdenv, makeWrapper, runCommand, lib, nixosTests, writeShellScript
+
{ stdenv, pkgs, makeWrapper, runCommand, lib, writeShellScript
, fetchFromGitHub, bundlerEnv, callPackage
, ruby, replace, gzip, gnutar, git, cacert, util-linux, gawk
···
, redis, postgresql, which, brotli, procps, rsync, nodePackages, v8
, plugins ? []
-
}:
+
}@args:
let
version = "2.7.7";
···
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