File tree Expand file tree Collapse file tree 3 files changed +45
-23
lines changed Expand file tree Collapse file tree 3 files changed +45
-23
lines changed Original file line number Diff line number Diff line change 4343 no-flake = callTest ./no-flake.nix { } ;
4444 lib-tests = callTest ./lib-tests.nix { } ;
4545 maintainers = callTest ./maintainers.nix { } ;
46+ nixpkgs-module = callTest ./nixpkgs-module.nix { } ;
4647 plugins-by-name = callTest ./plugins-by-name.nix { } ;
4748 generated = callTest ./generated.nix { } ;
4849 package-options = callTest ./package-options.nix { } ;
Original file line number Diff line number Diff line change 88 pkgs ,
99 pkgsUnfree ,
1010 self ,
11- system ,
1211} :
1312let
1413 fetchTests = callTest ./fetch-tests.nix { } ;
1918 file : name : module :
2019 mkTestDerivationFromNixvimModule {
2120 inherit name ;
21+ # Use a single common instance of nixpkgs, with allowUnfree
22+ # Having a single shared instance should speed up tests a little
2223 module = {
2324 _file = file ;
2425 imports = [ module ] ;
25- _module . args = {
26- # Give tests access to the flake
27- inherit self system ;
28- inherit ( self ) inputs ;
29- } ;
26+ nixpkgs . pkgs = pkgsUnfree ;
3027 } ;
3128 pkgs = pkgsUnfree ;
3229 } ;
Original file line number Diff line number Diff line change 11{
2- # TODO: expect not setting `nixpkgs.pkgs` to throw
2+ pkgs ,
3+ lib ,
4+ linkFarmFromDrvs ,
5+ self ,
6+ stdenv ,
7+ } :
8+ let
39
4- overlays =
10+ defaultPkgs = pkgs ;
11+
12+ testModule =
13+ name : module :
14+ let
15+ configuration = lib . nixvim . modules . evalNixvim {
16+ modules = lib . toList module ++ [
17+ {
18+ test = {
19+ inherit name ;
20+ buildNixvim = false ;
21+ runNvim = false ;
22+ } ;
23+ }
24+ ] ;
25+ } ;
26+ in
27+ configuration . config . build . test ;
28+
29+ in
30+ linkFarmFromDrvs "nixpkgs-module-test" [
31+
32+ ( testModule "nixpkgs-overlays" (
533 { pkgs , ... } :
634 {
7- test . runNvim = false ;
35+ nixpkgs . pkgs = defaultPkgs ;
836
937 nixpkgs . overlays = [
1038 ( final : prev : {
2048 '' ;
2149 }
2250 ] ;
23- } ;
51+ }
52+ ) )
2453
2554 # Test that overlays from both `nixpkgs.pkgs` _and_ `nixpkgs.overlays` are applied
26- stacked_overlays =
27- {
28- inputs ,
29- system ,
30- pkgs ,
31- ...
32- } :
55+ ( testModule "nixpkgs-stacked-overlay" (
56+ { pkgs , ... } :
3357 {
34- test . runNvim = false ;
35-
36- nixpkgs . pkgs = import inputs . nixpkgs {
37- inherit system ;
58+ nixpkgs . pkgs = import self . inputs . nixpkgs {
59+ inherit ( stdenv . hostPlatform ) system ;
3860 overlays = [
3961 ( final : prev : {
4062 foobar = "foobar" ;
7092 '' ;
7193 }
7294 ] ;
73- } ;
74- }
95+ }
96+ ) )
97+
98+ ]
You can’t perform that action at this time.
0 commit comments