2023-03-15 08:06:23 +01:00
|
|
|
{ pkgs ? import (builtins.fetchGit {
|
|
|
|
# Descriptive name to make the store path easier to identify
|
|
|
|
name = "nixos-21.11-2023-03-15";
|
|
|
|
url = "https://github.com/nixos/nixpkgs/";
|
|
|
|
# Commit hash for nixos-unstable as of 2018-09-12
|
|
|
|
# `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
|
|
|
|
ref = "refs/tags/21.11";
|
|
|
|
rev = "506445d88e183bce80e47fc612c710eb592045ed";
|
|
|
|
}) {}
|
2023-02-23 08:04:44 +01:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
utils = pkgs.callPackage ./utils.nix {};
|
|
|
|
in
|
|
|
|
with builtins;
|
|
|
|
with pkgs.lib.attrsets;
|
|
|
|
with pkgs.lib.lists;
|
|
|
|
with pkgs.lib.strings;
|
|
|
|
rec {
|
2023-02-23 08:14:28 +01:00
|
|
|
customPkgs = import ./all-packages.nix;
|
|
|
|
|
2023-02-23 08:04:44 +01:00
|
|
|
tests = pkgs.callPackage ./tests { inherit utils; };
|
|
|
|
|
|
|
|
runtests =
|
|
|
|
let
|
|
|
|
onlytests = filterAttrs (name: value: name != "override" && name != "overrideDerivation") tests;
|
|
|
|
failingtests = filterAttrs (name: value: length value > 0) onlytests;
|
|
|
|
formatFailure = failure: toString failure; # TODO: make this more pretty
|
|
|
|
formattedFailureGroups = mapAttrsToList (name: failures: "${name}:\n${concatMapStringsSep "\n" formatFailure failures}") failingtests;
|
|
|
|
in
|
|
|
|
if length formattedFailureGroups == 0 then
|
|
|
|
"no failing test"
|
|
|
|
else
|
|
|
|
concatStringsSep "\n" formattedFailureGroups;
|
|
|
|
}
|