about summary refs log tree commit diff
path: root/lib/tests
Commit message (Collapse)AuthorAge
* Avoid top-level `with` in lib/tests/misc.nixPhilip Taron2024-03-11
|
* Avoid top-level `with ...;` in ↵Philip Taron2024-03-11
| | | | lib/tests/modules/extendModules-168767-imports.nix
* Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority.nixPhilip Taron2024-03-11
|
* Avoid top-level `with ...;` in ↵Philip Taron2024-03-11
| | | | lib/tests/modules/alias-with-priority-can-override.nix
* Merge pull request #292209 from hercules-ci/lazyDerivation-multi-outputSilvan Mosberger2024-03-06
|\ | | | | lib.lazyDerivation: Support multi-output derivations
| * lib.lazyDerivation: Support multi-output derivationsRobert Hensing2024-02-29
| |
* | Merge pull request #177977 from thefloweringash/call-packages-with-function-argsArtturi2024-03-03
|\ \ | | | | | | lib/customization: propagate function arguments in callPackagesWith
| * | lib/customization: propagate function arguments in callPackagesWithAndrew Childs2024-02-28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makeOverridable is very careful to ensure the arguments to the overridden function are the same as the input function. As a result, the arguments of hello.override are exactly the same as the original arguments of the hello function that produced the derivation. However, callPackagesWith calls makeOverridable with a lambda that does not propagate the arguments. The override function for a package instantiated with callPackagesWith will not have the original arguments. For example: nix-repl> lib.functionArgs hello.override { callPackage = false; fetchurl = false; hello = false; lib = false; nixos = false; stdenv = false; testers = false; } nix-repl> lib.functionArgs openssl.override { } By copying the arguments onto the inner lambda before passing it to makeOverridable, we can make callPackage and callPackages behave the same. nix-repl> lib.functionArgs openssl.override { buildPackages = false; coreutils = false; cryptodev = false; enableSSL2 = true; enableSSL3 = true; fetchurl = false; lib = false; perl = false; removeReferencesTo = false; static = true; stdenv = false; withCryptodev = true; withPerl = true; }
* | lib/tests/release: Test lib.version in isolationRobert Hensing2024-02-26
| |
* | .version: Make lib/.version source of truthRobert Hensing2024-02-26
| | | | | | | | | | This way we don't have to make sure they're in sync, and we remove a small step from the release process.
* | lib flake: Fix versionRobert Hensing2024-02-26
|/ | | | | | | Manually tested with nix-repl> :lf path:lib nix-repl> lib.version
* lib/tests/test-with-nix.nix: initRobert Hensing2024-02-23
| | | | See https://github.com/NixOS/nix/pull/9900
* Merge pull request #284512 from hercules-ci/lib-types-unique-mergeSilvan Mosberger2024-02-10
|\ | | | | lib.types.unique: Check inner type deeply
| * lib.types.unique: Check inner type deeplyRobert Hensing2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't change uniq. Why not? - In NixOS it seems that uniq is only used with simple types that are fully checked by t.check. - It exists for much longer and is used more widely. - I believe we should deprecate it, because unique was already better. - unique can be a proving ground.
* | Merge pull request #285612 from hercules-ci/doRename-conditionRobert Hensing2024-02-05
|\ \ | | | | | | lib.modules.doRename: Add condition parameter
| * | lib.modules.doRename: Add condition parameterRobert Hensing2024-02-02
| | | | | | | | | | | | | | | This is to support single-to-multi service migrations, so that the `to` (e.g. `foos.""`) isn't defined unconditionally. See test cases.
* | | Merge pull request #285353 from sternenseemann/nix-2.3-syntaxSilvan Mosberger2024-02-05
|\ \ \ | | | | | | | | treewide: fix parse errors with Nix 2.3 and related problems
| * | | lib/tests/packages-from-directory: make sure all .nix files parsesternenseemann2024-01-31
| |/ / | | | | | | | | | | | | | | | It is useful that all (or almost all) .nix files in nixpkgs at least parse since it allows for checking syntax in the repository programmatically without evaluating anything.
* / / lib: Add optionalDrvAttr to conditionally set drv attributes.Shea Levy2024-02-02
|/ / | | | | | | | | | | This allows for adding new, conditionally set, derivation attributes to an existing derivation without changing any output paths in the case where the condition is not met.
* / feat: add test for nonEmptyListOf submoduleDanila Danko2024-01-30
|/
* lib.types: Improve descriptions of composed types that have commasRobert Hensing2023-12-23
| | | | | | Type: either ints.positive (enum ["auto"]) Before: positive integer, meaning >0 or value "auto" (singular enum) After: positive integer, meaning >0, or value "auto" (singular enum)
* Merge pull request #270537 from 9999years/packagesFromDirectorySilvan Mosberger2023-12-19
|\ | | | | lib.packagesFromDirectoryRecursive: init
| * lib.packagesFromDirectoryRecursive: initRebecca Turner2023-12-19
| | | | | | | | Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>
* | lib: `modules.sh` should check JSON output for predictabilityRebecca Turner2023-12-19
| | | | | | | | | | | | | | | | | | Currently, the `lib/tests/modules.sh` test checks the output of `nix-instantiate --eval` without `--json`, which outputs an unspecified human-readable format. This patch modifies `modules.sh` to use the `--json` output instead, to be robust against future changes to `nix-instantiate` output.
* | lib/tests/release.nix: temporary reference to pkgs/test/releaseAdam Joseph2023-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit temporarily adds pkgs/test/release to the lib/tests/release.nix test suite, because ofborg already knows about that entry point. We should move the list of test entry points out of ofborg and into a central place in nixpkgs: https://github.com/NixOS/nixpkgs/issues/272591 Once we do that we won't need to have this ugly kludge in an inappropriate place.
* | Merge pull request #273004 from hercules-ci/attrset-path-longest-prefixRobert Hensing2023-12-11
|\ \ | | | | | | lib.attrsets.longestValidPathPrefix: init
| * | lib.attrsets.hasAttrByPath: Document law and laziness, and test itRobert Hensing2023-12-08
| | |
| * | lib.attrsets.longestValidPathPrefix: initRobert Hensing2023-12-08
| | | | | | | | | | | | | | | Allows finding the most specific path that exists. This is useful for error messages relating to attribute paths.
* | | Merge pull request #272709 from hercules-ci/module-system-test-pr-131205Maximilian Bosch2023-12-10
|\ \ \ | | | | | | | | lib/modules: Test optionless module errors from #131205
| * | | lib/modules: Clarify test assertionsRobert Hensing2023-12-09
| | | |
| * | | lib/modules: Test optionless module errors from #131205Robert Hensing2023-12-09
| | |/ | |/|
* | | Merge pull request #272764 from tweag/anyBoolRobert Hensing2023-12-10
|\ \ \ | |_|/ |/| | lib.types.anyBool: init
| * | lib.types.boolByOr: initSilvan Mosberger2023-12-08
| |/ | | | | | | | | | | | | This type is necessary to have correct merging behavior for `allowUnfreePredicate` and `allowInsecurePredicate` Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* / lib.sortOn: initRobert Hensing2023-12-08
|/ | | | | | | | | | | A more efficient sort in some cases, and often convenient. This exposes `lib.lists.sortOn` immediately on `lib`, because it is a sibling of `sort`, which is already present there. Omitting it would lead to more confusion, and worse outcomes. There's no confusion about the types `sort` or `sortOn` operate on. Haskell agrees about the type for `sortOn`, and it is in its `base`.
* Merge pull request #269552 from adisbladis/lib-matchattrs-list-allocsRobert Hensing2023-11-27
|\ | | | | lib.attrsets.matchAttrs: Avoid some list allocations when walking structure
| * lib.attrsets.matchAttrs: Avoid some list allocations when walking structureadisbladis2023-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmarks (`nix-instantiate ./. -A python3`): - Before: ``` json { "cpuTime": 0.29049500823020935, "envs": { "bytes": 4484216, "elements": 221443, "number": 169542 }, "gc": { "heapSize": 402915328, "totalBytes": 53086800 }, "list": { "bytes": 749424, "concats": 4242, "elements": 93678 }, "nrAvoided": 253991, "nrFunctionCalls": 149848, "nrLookups": 49612, "nrOpUpdateValuesCopied": 1587837, "nrOpUpdates": 10104, "nrPrimOpCalls": 130356, "nrThunks": 358981, "sets": { "bytes": 30423600, "elements": 1859999, "number": 41476 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 236145, "number": 24453 }, "values": { "bytes": 10502520, "number": 437605 } } ``` - After: ``` json { "cpuTime": 0.2946169972419739, "envs": { "bytes": 3315224, "elements": 172735, "number": 120834 }, "gc": { "heapSize": 402915328, "totalBytes": 48718432 }, "list": { "bytes": 347568, "concats": 4242, "elements": 43446 }, "nrAvoided": 173252, "nrFunctionCalls": 101140, "nrLookups": 73595, "nrOpUpdateValuesCopied": 1587837, "nrOpUpdates": 10104, "nrPrimOpCalls": 83067, "nrThunks": 304216, "sets": { "bytes": 29704096, "elements": 1831673, "number": 24833 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 236145, "number": 24453 }, "values": { "bytes": 8961552, "number": 373398 } } ```
* | lib.meta: Avoid attrset allocation in platformMatchadisbladis2023-11-25
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmarks (`nix-instantiate ./. -A python3`) - Before ``` json { "cpuTime": 0.30625399947166443, "envs": { "bytes": 4484216, "elements": 221443, "number": 169542 }, "gc": { "heapSize": 402915328, "totalBytes": 53091024 }, "list": { "bytes": 749424, "concats": 4242, "elements": 93678 }, "nrAvoided": 253991, "nrFunctionCalls": 149848, "nrLookups": 49614, "nrOpUpdateValuesCopied": 1588326, "nrOpUpdates": 10106, "nrPrimOpCalls": 130356, "nrThunks": 359013, "sets": { "bytes": 30432320, "elements": 1860540, "number": 41480 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 236218, "number": 24459 }, "values": { "bytes": 10504632, "number": 437693 } } ``` - After ``` { "cpuTime": 0.29695799946784973, "envs": { "bytes": 3296712, "elements": 169055, "number": 121517 }, "gc": { "heapSize": 402915328, "totalBytes": 49044992 }, "list": { "bytes": 504928, "concats": 4242, "elements": 63116 }, "nrAvoided": 175403, "nrFunctionCalls": 110554, "nrLookups": 44907, "nrOpUpdateValuesCopied": 1588326, "nrOpUpdates": 10106, "nrPrimOpCalls": 82330, "nrThunks": 306625, "sets": { "bytes": 29943328, "elements": 1843076, "number": 28382 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 236218, "number": 24459 }, "values": { "bytes": 9037752, "number": 376573 } } ```
* Merge pull request #266443 from amjoseph-nixpkgs/pr/lib-tests-no-aws-sdkSilvan Mosberger2023-11-19
|\
| * lib.tests: build nix without flaky aws-sdk-cppAdam Joseph2023-11-18
| | | | | | | | | | | | | | | | | | | | The aws-sdk-cpp tests are flaky. Since pull requests to staging cause nix to be rebuilt, this means that staging PRs end up getting false CI failures due to whatever is flaky in the AWS SDK tests. Since none of our CI needs to (or should be able to) contact AWS S3, let's just omit it all. Bonus: the tests build way faster.
* | lib.fileset.gitTracked/gitTrackedWith: initSilvan Mosberger2023-11-16
| | | | | | | | | | A configuration parameter for gitTrackedWith will be introduced in the next commit
* | lib.lists.allUnique: initFelix Buehler2023-11-14
|/
* Merge pull request #261676 from h7x4/lib-add-replicatestringSilvan Mosberger2023-11-07
|\ | | | | lib.strings: add `replicate`
| * lib.strings: add `replicate`h7x42023-10-31
| | | | | | | | | | | | | | `strings.replicate` returns n copies of a string, concatenated into a new string Co-authored-by: Silvan Mosberger <github@infinisil.com>
* | lib.filesystem: Don't test Nix-specific error messagesSilvan Mosberger2023-11-01
| | | | | | | | | | In https://github.com/NixOS/nix/pull/9269 the error messages change which would've broken this test.
* | Merge pull request #260971 from Gerg-L/getExeSilvan Mosberger2023-10-31
|\ \ | | | | | | lib.getExe': check arguments
| * | lib/tests: add tests for getExe' and getExeGerg-L2023-10-16
| |/
* | Merge pull request #258866 from schuelermine/mkPackageOptionV4Silvan Mosberger2023-10-16
|\ \ | |/ |/| lib/options: mkPackageOption: document better, add pkgsText and usePname options, refactor
| * lib/tests: add test for pkgsText parameter and package set selection of ↵Anselm Schüler2023-10-10
| | | | | | | | mkPackageOption
| * lib/tests: add more tests for mkPackageOptionAnselm Schüler2023-10-06
| |
* | lib.makeOverridable: fix functionArgs on returned functionRobert Hensing2023-10-11
| |