File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 135
135
136
136
checkRes=$( nix flake check --all-systems $flakeDir 2>&1 && fail " nix flake check --all-systems should have failed" || true)
137
137
echo " $checkRes " | grepQuiet " formatter.system-1"
138
+
139
+ # Test whether `nix flake check` builds checks.
140
+ cat > $flakeDir /flake.nix << EOF
141
+ {
142
+ outputs = { self }: {
143
+ checks.$system .foo = with import ./config.nix; mkDerivation {
144
+ name = "simple";
145
+ buildCommand = "mkdir \$ out";
146
+ };
147
+ };
148
+ }
149
+ EOF
150
+
151
+ cp " ${config_nix} " " $flakeDir /"
152
+
153
+ expectStderr 0 nix flake check " $flakeDir " | grepQuiet ' running 1 flake check'
154
+
155
+ cat > $flakeDir /flake.nix << EOF
156
+ {
157
+ outputs = { self }: {
158
+ checks.$system .foo = with import ./config.nix; mkDerivation {
159
+ name = "simple";
160
+ buildCommand = "false";
161
+ };
162
+ };
163
+ }
164
+ EOF
165
+
166
+ # FIXME: error code 100 doesn't get propagated from the daemon.
167
+ if ! isTestOnNixOS; then
168
+ expectStderr 100 nix flake check " $flakeDir " | grepQuiet ' builder failed with exit code 1'
169
+ fi
You can’t perform that action at this time.
0 commit comments