File tree Expand file tree Collapse file tree 3 files changed +46
-22
lines changed Expand file tree Collapse file tree 3 files changed +46
-22
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+ pkgs ,
3+ lib ,
4+ linkFarmFromDrvs ,
5+ self ,
6+ stdenv ,
7+ } :
8+ let
9+
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+
232 # TODO: expect not setting `nixpkgs.pkgs` to throw
333
4- overlays =
34+ ( testModule "nixpkgs- overlays" (
535 { pkgs , ... } :
636 {
7- test . runNvim = false ;
37+ nixpkgs . pkgs = defaultPkgs ;
838
939 nixpkgs . overlays = [
1040 ( final : prev : {
2050 '' ;
2151 }
2252 ] ;
23- } ;
53+ }
54+ ) )
2455
2556 # Test that overlays from both `nixpkgs.pkgs` _and_ `nixpkgs.overlays` are applied
26- stacked_overlays =
27- {
28- inputs ,
29- system ,
30- pkgs ,
31- ...
32- } :
57+ ( testModule "nixpkgs-stacked-overlay" (
58+ { pkgs , ... } :
3359 {
34- test . runNvim = false ;
35-
36- nixpkgs . pkgs = import inputs . nixpkgs {
37- inherit system ;
60+ nixpkgs . pkgs = import self . inputs . nixpkgs {
61+ inherit ( stdenv . hostPlatform ) system ;
3862 overlays = [
3963 ( final : prev : {
4064 foobar = "foobar" ;
7094 '' ;
7195 }
7296 ] ;
73- } ;
74- }
97+ }
98+ ) )
99+
100+ ]
You can’t perform that action at this time.
0 commit comments