-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate integration tests to flake-parts
Well, actually also to fix them.
- Loading branch information
1 parent
59f6bd3
commit f119fed
Showing
2 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ lib, flake-parts-lib, inputs, self, ... }: | ||
let | ||
inherit (lib) | ||
mkOption | ||
types | ||
; | ||
inherit (flake-parts-lib) | ||
mkPerSystemOption | ||
; | ||
in | ||
{ | ||
options = { | ||
perSystem = mkPerSystemOption { | ||
options.attic.integration-tests = { | ||
nixpkgsArgs = mkOption { | ||
type = types.attrsOf types.anything; | ||
default = {}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
config = { | ||
perSystem = { self', pkgs, config, system, ... }: let | ||
cfg = config.attic.integration-tests; | ||
in { | ||
checks = let | ||
vmPkgs = import inputs.nixpkgs ({ | ||
inherit system; | ||
overlays = [ self.overlays.default ]; | ||
} // cfg.nixpkgsArgs); | ||
vmPkgsStable = import inputs.nixpkgs-stable ({ | ||
inherit system; | ||
overlays = [ self.overlays.default ]; | ||
} // cfg.nixpkgsArgs); | ||
|
||
makeIntegrationTests = pkgs: import ../integration-tests { | ||
inherit pkgs; | ||
flake = self; | ||
}; | ||
|
||
unstableTests = makeIntegrationTests vmPkgs; | ||
stableTests = lib.mapAttrs' (name: lib.nameValuePair "stable-${name}") (makeIntegrationTests vmPkgsStable); | ||
in lib.optionalAttrs pkgs.stdenv.isLinux (unstableTests // stableTests); | ||
}; | ||
}; | ||
} |