diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-11-30 21:42:52 +0100 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2020-11-30 23:51:42 +0100 |
commit | 8dea4df90323c43f9cc86a629f1581b91866e11d (patch) | |
tree | 7d426d12e78ca4120c2fc50c094f719112eeedc4 /lib/tests/modules.sh | |
parent | c9cc8969b4d4adeb389837d1cc85cc73a8272f55 (diff) | |
download | nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar.gz nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar.bz2 nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar.lz nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar.xz nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.tar.zst nixpkgs-8dea4df90323c43f9cc86a629f1581b91866e11d.zip |
lib/modules: Remove _module.checks.*.triggerPath as it's not necessary
Previously this option was thought to be necessary to avoid infinite recursion, but it actually isn't, since the check evaluation isn't fed back into the module fixed-point.
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-x | lib/tests/modules.sh | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 43bcabdf816..9e85c90d15c 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -278,13 +278,6 @@ checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix ## Module assertions # Check that assertions are triggered by default for just evaluating config checkConfigError 'Failed checks:\n- \[test\] Assertion failed' config ./assertions/simple.nix -# Check that assertions are only triggered if they have a triggerPath that's evaluated -checkConfigError 'Failed checks:\n- \[test\] Assertion failed' config.foo ./assertions/trigger-lazy.nix -checkConfigOutput true config.bar ./assertions/trigger-lazy.nix - -# The assertions enable condition should only be evaluated if the trigger is evaluated -checkConfigError 'enable evaluated' config.foo ./assertions/enable-lazy.nix -checkConfigOutput true config.bar ./assertions/enable-lazy.nix # Assertion is not triggered when enable is false checkConfigOutput '{ }' config ./assertions/enable-false.nix @@ -292,10 +285,6 @@ checkConfigOutput '{ }' config ./assertions/enable-false.nix # Warnings should be displayed on standard error checkConfigCodeOutErr 0 '{ }' 'warning: \[test\] Warning message' config ./assertions/warning.nix -# A triggerPath can be set to a submodule path -checkConfigOutput '{ baz = <CODE>; }' config.foo.bar ./assertions/trigger-submodule.nix -checkConfigError 'Failed checks:\n- \[test\] Assertion failed' config.foo.bar.baz ./assertions/trigger-submodule.nix - # Check that multiple assertions and warnings can be triggered at once checkConfigError 'Failed checks:\n- \[test1\] Assertion 1 failed\n- \[test2\] Assertion 2 failed' config ./assertions/multi.nix checkConfigError 'trace: warning: \[test3\] Warning 3 failed\ntrace: warning: \[test4\] Warning 4 failed' config ./assertions/multi.nix @@ -305,10 +294,6 @@ checkConfigError 'Failed checks:\n- \[foo/test\] Assertion failed' config.foo ./ checkConfigError 'Failed checks:\n- \[foo.bar/test\] Assertion failed' config.foo.bar ./assertions/submodule-attrsOf.nix checkConfigError 'Failed checks:\n- \[foo.bar.baz/test\] Assertion failed' config.foo.bar.baz ./assertions/submodule-attrsOf-attrsOf.nix -# Assertions aren't triggered when the trigger path is only evaluated from within the same module evaluation -# This behavior is necessary to allow assertions to depend on config values. This could potentially be changed in the future if all of NixOS' assertions are rewritten to not depend on any config values -checkConfigOutput true config.bar ./assertions/non-cascading.nix - # Assertions with an attribute starting with _ shouldn't have their name displayed checkConfigError 'Failed checks:\n- Assertion failed' config ./assertions/underscore-attributes.nix |