summaryrefslogtreecommitdiff
path: root/pkgs/pkgs-lib/tests (follow)
Commit message (Expand)AuthorAgeFilesLines
* treewide: apply nixfmt 1.2.0Dyego Aurélio2026-01-221-1/+1
* tests.pkgs-lib: expose the tests included in itjopejoe12025-12-081-6/+8
* pkgs.formats.plist: don't test path•••Reference: https://hydra.nixos.org/build/310233987/nixlog/1/tail Sizhe Zhao2025-10-171-3/+0
* pkgs.formats.plist: initSizhe Zhao2025-10-061-0/+78
* pkgs-lib/pythonVars: add testh7x42025-09-181-0/+57
* formats: add `nixConf`•••adds `nixConf` (to generate `nix.conf` files) as a file format to `lib.formats`, and uses it for serializing `nix.settings`. this makes it easier to 'manually' serialize `nix.settings`, which is relevant in e.g. safely handling sensitive values such as that of `nix.settings.access-tokens`. Signed-off-by: cinereal <cinereal@riseup.net> cinereal2025-09-061-0/+25
* formats tests: drop jdk8 and add default jdk•••It was weird to keep testing an ancient version but not test the default one. Now jdk8 has issues: https://hydra.nixos.org/build/301885710#tabs-buildsteps Vladimír Čunát2025-07-111-1/+1
* pkgs/pkgs-lib/tests/formats.nix: adapt to new style•••https://hydra.nixos.org/build/300150957/nixlog/2/tail Probably caused by f80b06e Vladimír Čunát2025-06-171-0/+1
* pkgs.formats.yaml_1_2: init•••Same as YAML 1.1 but relies on the unpinned remarshal version which emits YAML 1.2. Martin Weinelt2025-06-111-1/+35
* treewide: Format all Nix files•••Format all Nix files using the officially approved formatter, making the CI check introduced in the previous commit succeed: nix-build ci -A fmt.check This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153) of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166). This commit will lead to merge conflicts for a number of PRs, up to an estimated ~1100 (~33%) among the PRs with activity in the past 2 months, but that should be lower than what it would be without the previous [partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537). Merge conflicts caused by this commit can now automatically be resolved while rebasing using the [auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase). If you run into any problems regarding any of this, please reach out to the [formatting team](https://nixos.org/community/teams/formatting/) by pinging @NixOS/nix-formatting. Silvan Mosberger2025-04-011-137/+278
* formats.lua: init•••Add a lua format, based on `lib.generators.toLua`. Matt Sturgeon2025-03-191-0/+76
* pkgs-lib: Make tests independent of Nix file contents•••Before, all of these tests would be rebuilt whenever formats.nix is modified, but there's no need for this :) Silvan Mosberger2025-02-172-6/+6
* pkgs-lib.formats.xml: initFelix Buehler2025-01-131-0/+27
* pkgs.formats: add cdnuku2025-01-061-0/+34
* treewide: format all inactive Nix files•••After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7 result/bin/apply-formatting $NIXPKGS_PATH Silvan Mosberger2024-12-101-22/+33
* pkgs/lib/formats: test more explicitly for YAML 1.1 compatMartin Weinelt2024-11-091-1/+5
* formats.ini: disable merging as list by default•••Previously, setting listsAsDuplicateKeys or listToValue would make it so merging these treat all values as lists, by coercing non-lists via lib.singleton. Some programs (such as gamemode; see #345121), allow some values to be repeated but not others, which can lead to unexpected behavior when non-list values are merged like this rather than throwing an error. This now makes that behavior opt-in via the mergeAsList option. Setting mergeAsList (to either true or false) without setting either listsAsDuplicateKeys or listToValue is an error, since lists are meaningless in this case. MithicSpirit2024-10-101-0/+137
* pkgs: add PHP to formats.nixnhnn2024-05-161-0/+44
* pkgs.formats: toINIWithGlobalSection wrapper•••The new format is based on the existing wrapper and generates an INI file with an unnamed global section at the top as is used by *stunnel* for instance. Technically the INI format is a subset of this however testing, type checking, and API guarantees profit from two separate generators. Co-authored-by: tim-tx <tim-tx@users.noreply.github.com> Signed-off-by: benaryorg <binary@benary.org> benaryorg2024-02-121-0/+95
* pkgs.formats: negative type checking tests•••Tests using `shouldFail` (new) enable testing for whether the type system catches any unintended uses (missing parameters or unavailable data types in the format). It should not be necessary to test for all possible outliers for each format, however format-specific tests (for instance those using a rigid submodule structure) can ensure that common mistakes err out instead of being silently discarded, while also allowing test-driven development of sorts. Signed-off-by: benaryorg <binary@benary.org> benaryorg2024-02-121-37/+117
* formats.hocon: add testsh7x42024-02-091-0/+3
* formats.libconfig: add tests•••Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com> Signed-off-by: h7x4 <h7x4@nani.wtf> h7x42023-10-271-0/+1
* pkgs-lib/tests/formats: fix expected outputK9002023-08-271-1/+0
* formats.keyValue: add testsFrancesco Gazzetta2022-06-201-0/+45
* Merge pull request #167172 from hercules-ci/javaProperties-type-coercions•••`formats.javaProperties`: add type coercionsRobert Hensing2022-04-251-4/+21
|\
| * pkgs.formats.javaProperties: Add type coercions•••A usability improvement. Robert Hensing2022-04-041-2/+16
| * tests.pkgs-lib.formats: Allow strings with context in test runnerRobert Hensing2022-04-041-2/+5
* | pkgs-lib.formats: fix tomlkit outputzowoq2022-04-181-0/+1
* | tests formats: fix due to tomlkit output changelassulus2022-04-101-3/+0
|/
* tests.pkgs-lib.formats: Detect when impossible input is fedRobert Hensing2022-04-041-1/+5
* formats.javaProperties: Add commentRobert Hensing2022-04-011-0/+2
* formats.javaProperties: initRobert Hensing2022-04-012-5/+60
* formats: Fix yaml test•••Faulty test result was introduced in https://github.com/NixOS/nixpkgs/pull/133807 Silvan Mosberger2021-08-261-2/+2
* lib.formats.yaml: use well known YAML format•••The way `(lib.formats.yaml {}).generate` generates YAML is compliant because on YAML 1.2 spec JSON is a subset of YAML but it bugs people's minds and can lead to problems with software that is not compatible with YAML 1.2. This commit also changes the test of the generation function. Data validation/typing remains the same. See #133802. Signed-off-by: lucasew <lucas59356@gmail.com> lucasew2021-08-251-15/+11
* treewide: runCommandNoCC -> runCommand•••This has been synonymous for ~5y. Robert Hensing2021-08-151-1/+1
* pkgs-lib: allow paths in TOML, YAML and JSON•••Paths get automatically added to the store. The INI generator currently chokes on paths, so it is not supported for now. Ben Wolsieffer2021-06-281-0/+4
* formats.ini: Introduce `listToValue` argument (#121613)•••Allows coercing lists to values. E.g. formats.ini { listToValue = lib.concatMapStringsSep ", " (lib.generators.mkValueStringDefault {}); }Silvan Mosberger2021-05-041-0/+16
* pkgs-lib/tests/formats: improve message on failure•••Foremost, the message was discarding double quotes on one side of the diff, which was super-confusing to me, as I thought that the format convertor broke that when in fact only whitespace was changed. I thought I'd cat the files, but then... switching to `diff -u` seemed self-sufficient. It felt sufficiently non-controversial to push directly, but certainly feel free to improve further. Vladimír Čunát2020-10-191-4/+4
* pkgs-lib/tests/formats: fix whitespace after PR #100372•••Naturally, TOML doesn't define the exact shape of everything. nix build -f pkgs/top-level/release.nix pkgs-lib-tests Vladimír Čunát2020-10-191-2/+0
* pkgs-lib: Add tests for formatsSilvan Mosberger2020-07-292-0/+159
* pkgs: Add pkgs-lib structureSilvan Mosberger2020-07-291-0/+5