diff --git a/default.nix b/default.nix index d5acbbdd7..044f59e7b 100644 --- a/default.nix +++ b/default.nix @@ -80,6 +80,10 @@ mach-nix.buildPythonPackage { sha256 = "1md9i2fx1ya7mgcj9j01z58hs3q9pj4ch5is5b5kq4v86cf6x33x"; }) ]; - }; + # Remove a click-default-group patch for a test suite problem which no + # longer applies because the project apparently no longer has a test suite + # in its source distribution. + click-default-group.patches = []; + }; } diff --git a/tests.nix b/tests.nix new file mode 100644 index 000000000..364407e87 --- /dev/null +++ b/tests.nix @@ -0,0 +1,26 @@ +let + sources = import nix/sources.nix; +in +# See default.nix for documentation about parameters. +{ pkgsVersion ? "nixpkgs-21.11" +, pkgs ? import sources.${pkgsVersion} { } +, pypiData ? sources.pypi-deps-db +, pythonVersion ? "python37" +, mach-nix ? import sources.mach-nix { + inherit pkgs pypiData; + python = pythonVersion; + } +}@args: +let + # Get the package with all of its test requirements. + tahoe-lafs = import ./. (args // { extras = [ "test" ]; }); + + # Put it into a Python environment. + python-env = pkgs.${pythonVersion}.withPackages (ps: [ + tahoe-lafs + ]); +in +# Make a derivation that runs the unit test suite. +pkgs.runCommand "tahoe-lafs-tests" { } '' + ${python-env}/bin/python -m twisted.trial -j $NIX_BUILD_CORES allmydata +''