diff options
author | Antoine Eiche <lewo@abesis.fr> | 2021-07-10 16:05:25 +0200 |
---|---|---|
committer | Antoine Eiche <lewo@abesis.fr> | 2021-07-12 22:57:01 +0200 |
commit | a0f9688a31dd9f4b6f9d252ba06f8d1acef914af (patch) | |
tree | 94b7cd246366ce02b0b5fa677074d6547136f36c /tests | |
parent | a9f87ca461a1f0e23e85a1ba8c696672ed9e11e2 (diff) |
Switch CI to Nix flakes
We also move tests to Flakes.
This would allow users to submit PRs with a fork of nixpkgs when they
want to test nixpkgs PRs against SNM.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clamav.nix | 9 | ||||
-rw-r--r-- | tests/default.nix | 48 | ||||
-rw-r--r-- | tests/external.nix | 2 | ||||
-rw-r--r-- | tests/internal.nix | 2 | ||||
-rw-r--r-- | tests/multiple.nix | 2 |
5 files changed, 4 insertions, 59 deletions
diff --git a/tests/clamav.nix b/tests/clamav.nix index f818991..4f59d64 100644 --- a/tests/clamav.nix +++ b/tests/clamav.nix @@ -14,19 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> -{ pkgs ? import <nixpkgs> {}}: +{ pkgs ? import <nixpkgs> {}, blobs}: pkgs.nixosTest { name = "clamav"; nodes = { server = { config, pkgs, lib, ... }: - let - sources = import ../nix/sources.nix; - blobs = pkgs.fetchzip { - url = sources.blobs.url; - sha256 = sources.blobs.sha256; - }; - in { imports = [ ../default.nix diff --git a/tests/default.nix b/tests/default.nix deleted file mode 100644 index 68f2053..0000000 --- a/tests/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -# Generate an attribute sets containing all tests for all releaeses -# It looks like: -# - external.nixpkgs_20.03 -# - external.nixpkgs_unstable -# - internal.nixpkgs_20.03 -# - internal.nixpkgs_unstable - -with builtins; - -let - sources = import ../nix/sources.nix; - - releases = listToAttrs (map genRelease releaseNames); - - genRelease = name: { - name = name; - value = import sources."${name}" {}; - }; - - genTest = testName: release: - let - pkgs = releases."${release}"; - test = pkgs.callPackage (./. + "/${testName}.nix") { }; - in { - "name"= builtins.replaceStrings ["." "-"] ["_" "_"] release; - "value"= test; - }; - - releaseNames = [ - "nixpkgs-unstable" - "nixpkgs-20.09" - "nixpkgs-21.05" - ]; - - testNames = [ - "internal" - "external" - "clamav" - "multiple" - ]; - - # Generate an attribute set containing one test per releases - genTests = testName: { - name = testName; - value = listToAttrs (map (genTest testName) (builtins.attrNames releases)); - }; - -in listToAttrs (map genTests testNames) diff --git a/tests/external.nix b/tests/external.nix index 55d9eb5..7c87664 100644 --- a/tests/external.nix +++ b/tests/external.nix @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> -{ pkgs ? import <nixpkgs> {}}: +{ pkgs ? import <nixpkgs> {}, ...}: pkgs.nixosTest { name = "external"; diff --git a/tests/internal.nix b/tests/internal.nix index c64339a..e8c4227 100644 --- a/tests/internal.nix +++ b/tests/internal.nix @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> -{ pkgs ? import <nixpkgs> {}}: +{ pkgs ? import <nixpkgs> {}, ...}: let sendMail = pkgs.writeTextFile { diff --git a/tests/multiple.nix b/tests/multiple.nix index 3377906..99e1aaf 100644 --- a/tests/multiple.nix +++ b/tests/multiple.nix @@ -1,6 +1,6 @@ # This tests is used to test features requiring several mail domains. -{ pkgs ? import <nixpkgs> {}}: +{ pkgs ? import <nixpkgs> {}, ...}: let hashPassword = password: pkgs.runCommand |