Commit 7b75458 1 parent ae23c82 commit 7b75458 Copy full SHA for 7b75458
File tree 3 files changed +30
-31
lines changed
3 files changed +30
-31
lines changed Original file line number Diff line number Diff line change 25
25
26
26
# Tests use flake to do packageSearch builds
27
27
inherit ( codedown ) codedownSearcher ;
28
+ allSettingsSchemas = pkgsStable . callPackage ./nix/all-settings-schemas.nix { inherit ( sampleOutputs ) sample_environments ; } ;
28
29
29
30
# For .envrc
30
31
nixpkgsPath = pkgsStable . writeShellScriptBin "nixpkgsPath.sh" "echo -n ${ pkgsStable . path } " ;
39
40
}
40
41
// sampleOutputs . inner
41
42
;
42
-
43
- checks = {
44
- customScript = pkgsStable . writeShellScript "test-script" ''
45
- #!/bin/sh
46
- echo "Running custom test..."
47
- # Add your test logic here
48
- exit 0
49
- '' ;
50
- } ;
51
43
}
52
44
) ;
53
45
}
Original file line number Diff line number Diff line change
1
+ { lib
2
+ , writeShellScript
3
+ , writeTextFile
4
+
5
+ , sample_environments
6
+ } :
7
+
8
+ let
9
+ all_settings_schemas = let
10
+ gatherSchemas = prefix : pkg :
11
+ ( if ! ( lib . hasAttrByPath [ "meta" "settings_schema" ] pkg ) then [ ]
12
+ else [ { name = prefix + pkg . name ; value = pkg . meta . settings_schema ; } ] )
13
+ ++ builtins . concatLists ( map ( gatherSchemas ( prefix + pkg . name + "." ) ) ( pkg . packages or [ ] ) )
14
+ ;
15
+
16
+ gatherSchemasFromEnvironment = prefix : env :
17
+ builtins . concatLists ( lib . mapAttrsToList ( n : v : gatherSchemas prefix v ) env . ui_metadata . packages ) ;
18
+
19
+ in
20
+ lib . listToAttrs (
21
+ builtins . concatLists ( lib . mapAttrsToList ( n : v : gatherSchemasFromEnvironment ( n + "." ) v ) sample_environments )
22
+ ) ;
23
+
24
+ in
25
+
26
+ writeTextFile {
27
+ name = "all_settings_schemas.json" ;
28
+ text = builtins . toJSON all_settings_schemas ;
29
+ }
Original file line number Diff line number Diff line change 32
32
sample_environments
33
33
) ;
34
34
35
- # TODO: add test that all settings schemas are valid in certain ways:
36
- # - they all have a title
37
- all_settings_schemas = let
38
- gatherSchemas = prefix : pkg :
39
- ( if ! ( lib . hasAttrByPath [ "meta" "settings_schema" ] pkg ) then [ ]
40
- else [ { name = prefix + pkg . name ; value = pkg . meta . settings_schema ; } ] )
41
- ++ builtins . concatLists ( map ( gatherSchemas ( prefix + pkg . name + "." ) ) ( pkg . packages or [ ] ) )
42
- ;
43
-
44
- gatherSchemasFromEnvironment = prefix : env :
45
- builtins . concatLists ( lib . mapAttrsToList ( n : v : gatherSchemas prefix v ) env . ui_metadata . packages ) ;
46
-
47
- in
48
- writeTextFile {
49
- name = "all_settings_schemas.json" ;
50
- text = builtins . toJSON (
51
- lib . listToAttrs (
52
- builtins . concatLists ( lib . mapAttrsToList ( n : v : gatherSchemasFromEnvironment ( n + "." ) v ) sample_environments )
53
- )
54
- ) ;
55
- } ;
56
-
57
35
printVersions = let
58
36
versionsMap = with lib ;
59
37
mapAttrs ( lang : value : if ( hasAttr "versions" value ) then value . versions else { } )
You can’t perform that action at this time.
0 commit comments