about summary refs log tree commit diff
path: root/lib/tests
Commit message (Collapse)AuthorAge
* Merge pull request #243139 from hercules-ci/modules-test-default-argumentRobert Hensing2023-08-02
|\ | | | | lib/tests/modules: Test that _module.args works when a default argume…
| * lib/tests/modules: Test that _module.args works when a default argument is setRobert Hensing2023-07-12
| |
* | Merge pull request #245271 from sternenseemann/module-system-merge-no-typeRobert Hensing2023-07-27
|\ \ | | | | | | lib/modules: handle typeless options in mergeModules
| * | lib/modules: handle typeless options in mergeModulessternenseemann2023-07-26
| | | | | | | | | | | | | | | | | | mkOption does not require a `type` argument and does not set the resulting attribute if it is not given. Consequently, we need to be prepared to merge options that have no type information.
* | | Merge pull request #243520 from tweag/lib.lists.commonPrefixSilvan Mosberger2023-07-26
|\ \ \ | | | | | | | | `lib.lists.{findFirstIndex,commonPrefix}`: init
| * | | lib.lists.commonPrefix: initSilvan Mosberger2023-07-20
| | | |
| * | | lib.lists.findFirstIndex: initSilvan Mosberger2023-07-19
| | |/ | |/| | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | | Merge pull request #244044 from tweag/lib-readmeRobert Hensing2023-07-19
|\ \ \ | | | | | | | | Create a Readme in `lib`
| * | | lib/tests: Unify documentation of individual testable filesSilvan Mosberger2023-07-18
| | | |
* | | | lib.attrsets.mergeAttrsList: initSilvan Mosberger2023-07-18
| |/ / |/| | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | | lib.mergeModules: Add context to error messageRobert Hensing2023-07-11
| | |
* | | Merge pull request #240825 from r-burns/mips-embeddedRyan Burns2023-07-05
|\ \ \ | | | | | | | | lib.platforms.mips{,64}-embedded: init
| * | | lib.platforms.mips{,64}-embedded: initRyan Burns2023-06-30
| | |/ | |/|
* / | lib/tests: invalidate hashesNaïm Favier2023-07-05
|/ / | | | | | | | | | | Having the current bash hash present in the nixpkgs tree makes Nix detect bash as a runtime dependency of nixpkgs, which in turns messes up `fetchFromGitHub` due to https://github.com/NixOS/nix/issues/6660
* | lib/tests: remove experimental-featuresNaïm Favier2023-06-27
| | | | | | | | | | Now that the lib is tested with Nix 2.3, this isn't needed any more and causes warnings.
* | lib/tests/modules.sh: Test types.pathInStoreRobert Hensing2023-06-27
| | | | | | | | | | Add missing test cases. I think the .links case should be rejected even though it's technically a path in the store.
* | Merge pull request #238136 from ↵Robert Hensing2023-06-23
|\ \ | | | | | | | | | | | | hercules-ci/nixos-nixpkgs-dont-check-when-_module.args.pkgs-is-set `nixos/nixpkgs`: Don't check when `_module.args.pkgs` is set
| * | lib.modules: Add mergeAttrDefinitionsWithPrioRobert Hensing2023-06-16
| | | | | | | | | | | | | | | | | | This will let us make assertions involving _module.args.pkgs, which is not an option but a value attribute, and therefore doesn't have its own highestPrio to inspect. The new function gives us that info.
* | | lib/system: move toLosslessStringMaybe into lib/testsAdam Joseph2023-06-22
|/ / | | | | | | | | | | | | | | | | | | | | | | toLosslessStringMaybe is not used by anything other than lib/tests, so it can be private to that file. I don't think this function was terribly well thought-through. If people start using it, we will become permanently dependent on the ability to test platforms for equality. It also makes the elaboration process more fragile, because it encourages code outside of nixpkgs to become sensitive to the minute details of how elaboration happens.
* | lib/tests/release.nix: Run systems tests on OfBorgRobert Hensing2023-06-13
| |
* | lib.systems.equals: Ignore all function attributes reflectivelyRobert Hensing2023-06-13
| | | | | | | | Co-authored-by: Artturi <Artturin@artturin.com>
* | lib.systems.{equals,toLosslessStringMaybe}: initRobert Hensing2023-06-13
| |
* | Merge pull request #235267 from tweag/lazier-findFirstRobert Hensing2023-06-06
|\ \ | |/ |/| `lib.findFirst`: Add tests and make lazier
| * lib.list.findFirst: Make lazierSilvan Mosberger2023-06-06
| | | | | | | | There's no need to evaluate list elements after a matching element
| * lib/tests: Add findFirst testsSilvan Mosberger2023-06-06
| |
* | Merge pull request #234070 from tweag/pathType-testsRobert Hensing2023-06-01
|\ \ | | | | | | Init `nixVersions.minimum` and fix `lib` tests for all Nix versions
| * | lib/tests: Also run with nixVersions.minimum and nixVersions.unstableSilvan Mosberger2023-06-01
| | | | | | | | | | | | | | | The previous commits ensure that the tests also succeed with those versions
| * | lib/tests: Fix when run with Nix 2.3Silvan Mosberger2023-06-01
| | |
| * | lib/tests/filesystem.sh: Check success and failure separatelySilvan Mosberger2023-06-01
| | |
| * | lib.filesystem.pathType: Fix tests for Nix >= 2.14Silvan Mosberger2023-05-25
| |/
* / lib.systems.doubles: add big-endian MIPS linux doublesAlyssa Ross2023-06-01
|/ | | | | | We already have examples for these, but since we didn't actually recognise the doubles, it wasn't possible to build any packages for them without setting allowUnsupportedSystem.
* Merge pull request #224834 from tweag/pathType-and-coRobert Hensing2023-05-23
|\ | | | | Improvements to pathType, pathIsDirectory and pathIsRegularFile
| * lib.filesystem.pathType: Improve error for non-existent pathsSilvan Mosberger2023-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously it would fail with error: attribute 'nonexistent' missing at nixpkgs/lib/filesystem.nix:29:10: 28| if dirOf path == path then "directory" 29| else (readDir (dirOf path)).${baseNameOf path}; | ^ 30|
| * lib.filesystem.pathType: Fix for filesystem root argumentSilvan Mosberger2023-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this function couldn't handle / being passed, it would throw an error: error: attribute '' missing at nixpkgs/lib/filesystem.nix:24:20: 23| */ 24| pathType = path: (readDir (dirOf path)).${baseNameOf path}; | ^ 25| Consequently this also fixes the lib.filesystem.{pathIsDirectory,pathIsRegularFile} functions.
| * lib.filesystem.pathType and co.: Add testsSilvan Mosberger2023-05-22
| | | | | | | | Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
* | lib/tests: add mkPackageOption testsNaïm Favier2023-05-20
| |
* | lib.modules: configurationClass -> classRobert Hensing2023-05-06
| | | | | | | | This simplifies the documentation. `configuration` is implied by `_type`.
* | lib.modules: in evalModules return move _module.class -> configurationClassRobert Hensing2023-05-06
| |
* | lib.modules: Change class declaration in module to _classRobert Hensing2023-05-06
| |
* | lib/tests/modules.sh: Add submodule + class testsRobert Hensing2023-05-06
| |
* | lib/modules: Move class out of specialArgsRobert Hensing2023-05-06
| |
* | lib/modules: Only interpret class declaration in non-shorthand modeRobert Hensing2023-05-06
| | | | | | | | | | | | This is to avoid stealing keys from submodules. `class` might be common enough that reinterpreting existing `class` attributes in configurations as a declaration leads to fairly widespread problems.
* | lib/modules: Explain that a configuration can't be loaded as a moduleRobert Hensing2023-05-06
| |
* | lib/modules: Improve error when a configuration is importedRobert Hensing2023-05-06
| | | | | | | | | | | | This is appears to be a fairly common mistake for beginners who want to build larger things from the system configurations, such as NixOps networks, etc. Further explanation seems appropriate.
* | lib/modules: Check against importing things with a _typeRobert Hensing2023-05-06
| |
* | lib/modules: Add class concept to check importsRobert Hensing2023-05-06
| | | | | | | | | | This improves the error message when an incompatible module is imported.
* | lib/tests/modules.sh: Unload implicit modulesRobert Hensing2023-05-06
| | | | | | | | | | I had some trouble understanding this. Let's try to keep new tests a bit more stateless and explicit.
* | Merge pull request #223407 from AngryAnt/toplist-pathtoonn2023-05-05
|\ \ | | | | | | lib.toPlist: Add support for path values
| * | lib.toPlist: keep test output in external files for their tab indentsEmil "AngryAnt" Johansen2023-03-27
| | |
| * | lib.toPlist: basic test coverageEmil "AngryAnt" Johansen2023-03-27
| |/