summaryrefslogtreecommitdiff
path: root/pkgs/build-support/testers/default.nix (follow)
Commit message (Expand)AuthorAgeFilesLines
* testers.invalidateFetcherByDrvHash: take fixed-point arguments argsYueh-Shun Li2025-12-191-1/+2
* testers.invalidateFetcherByDrvHash: use overrideAttrs if fetcher ignore name ...Yueh-Shun Li2025-12-191-6/+16
* testers.invalidateFetcherByDrvHash: salt pname if presentedYueh-Shun Li2025-12-191-1/+8
* testers.testEqualContents: add checkMetadata option•••Allows ignoring file metadata differences (permissions, ownership) when comparing files. This is especially useful on darwin, where we often run into subtle issues like: -Device: 1,23 Access: (0444/-r--r--r--) Uid: ( 0/ root) Gid: ( 0/ wheel) +Device: 1,23 Access: (0444/-r--r--r--) Uid: ( 0/ root) Gid: ( 350/ nixbld) Matt Sturgeon2025-10-171-1/+3
* pkgs: remove optional builtins prefixes from prelude functions•••Remove optional builtins prefixes from prelude functions by running: builtins=( abort baseNameOf break derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true ) fd \ --type file \ . \ pkgs \ --exec-batch sed --in-place --regexp-extended " s/\<builtins\.($( printf '%s\n' "${builtins[@]}" | paste --delimiter '|' --serial - ))\>/\1/g " nix fmt NAHO2025-10-041-1/+1
* testers.testEqualContents: add postFailureMessage parameter•••Add an optional postFailureMessage parameter to testEqualContents that allows users to provide additional context when tests fail. This is particularly useful for providing instructions on how to update expected results when they change intentionally. The message is displayed after the standard failure output, helping maintainers understand what to do next when a test fails. Robert Hensing2025-08-241-1/+11
* treewide: run nixfmt 1.0.0Wolfgang Walther2025-07-241-26/+24
* testers.hasCmakeConfigModules: initqbisi2025-05-311-0/+2
* 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-100/+134
* testers.shfmt: init (#385939)Philip Taron2025-03-071-0/+2
|\
| * testers.shfmt: initConnor Baker2025-03-051-0/+2
* | testers.testEqualArrayOrMap: switch to callPackageConnor Baker2025-03-031-2/+1
* | testers.testEqualArrayOrMap: use default.nix and move recurseIntoAttrs into t...Connor Baker2025-03-031-1/+1
* | testers.testEqualArrayOrMap: use buildCommandPath and change checkSetupScript...Connor Baker2025-03-031-1/+1
* | testers.testEqualArrayOrMap: initConnor Baker2025-03-031-0/+5
|/
* testers.testBuildFailure': replace import with callPackageConnor Baker2025-02-271-2/+1
* testers.testBuildFailure': use default.nix and move recurseIntoAttrs into tes...Connor Baker2025-02-271-1/+1
* testers.testBuildFailure': move to separate directory and use buildCommandPathConnor Baker2025-02-271-65/+2
* testers.testBuildFailure': use more strict bash for checksConnor Baker2025-02-271-0/+2
* testers.testBuildFailure': initConnor Baker2025-02-271-0/+66
* testers.testBuildFailure: fix•••Introduced by cf127c9dc389231b03bae610fec546e2017969ea, which changed default-builder.sh, but forgot to tell testBuildFailure about it. Wolfgang Walther2025-01-211-1/+1
* testers.testBuildFailure: fix structuredAttrs support•••Fixes `testers.testBuildFailure` compatibility with `__structuredAttrs`. The two main issues are, when `structuredAttrs` is enabled: - `$__structuredAttrs` is not set - `$outputs` is not set `$__structuredAttrs` not being set is fixed by checking for `$NIX_ATTRS_SH_FILE`, as per pkgs/stdenv/generic/setup.sh `$outputs` not being set is fixed by sourcing `$NIX_ATTRS_SH_FILE`, as-per pkgs/stdenv/generic/default-builder.sh Matt Sturgeon2025-01-081-1/+6
* various: replace substituteAll with replaceVars•••This deals with some special cases, i.e. where "null" is used to avoid replacing some values or where the syntax is not too easy to grep for for automated replacement. Wolfgang Walther2024-12-011-2/+2
* Merge pull request #334995 from pbsds/fix-test-version-1723771306Philip Taron2024-08-171-1/+1
|\
| * testers.testVersion: ignore echoed store paths•••Fixes the error mode where the test always passes if the store path of the binary is echoed by the test command. Peder Bergebakken Sundt2024-08-161-1/+1
* | emptyFile: use SRI hashnicoo2024-08-081-1/+1
* | testers.runCommand: add, document, and testnicoo2024-08-081-0/+27
* | testers: format inputs per RFC166nicoo2024-08-081-1/+13
|/
* Merge pull request #323613 from CyberShadow/fix-nix-path-without-channels-v2•••nix-channel: do not set empty nix-path when disabling channelsRobert Hensing2024-07-281-0/+2
|\
| * testers.shellcheck: init•••Needed for testing upcoming commit. Robert Hensing2024-07-161-0/+2
* | testers.testEqualContents: use diffoscope instead of diffing find output•••Before this change, testers.testEqualContents implementation had several bugs (e.g. executables at different paths were not considered equal). So we switch to diffoscope that that is designed to handle exactly these kinds of comparisons and gives more insights into the differences in the output. Ivan Trubach2024-07-181-19/+8
* | doc: fixup doc/build-helpers referencesIvan Trubach2024-07-181-12/+12
|/
* testers.lycheeLinkCheck: init (#298665)•••* testers.lycheeLinkCheck: init Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>Robert Hensing2024-05-271-0/+4
* macOS support for NixOS tests (#282401)•••Closes #193336 Closes #261694 Related to #108984 The goal here was to get the following flake to build and run on `aarch64-darwin`: ```nix { inputs.nixpkgs.url = <this branch>; outputs = { nixpkgs, ... }: { checks.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.nixosTest { name = "test"; nodes.machine = { }; testScript = ""; }; }; } ``` … and after this change it does. There's no longer a need for the user to set `nodes.*.nixpkgs.pkgs` or `nodes.*.virtualisation.host.pkgs` as the correct values are inferred from the host system.Gabriella Gonzalez2024-03-021-3/+3
* testers.testVersion: Fix usage of hyphens within the version argumentJohann Wagner2023-09-121-1/+1
* testers.hasPkgConfigModules: allow checking multiple pkg-config mods•••This is very useful in conjunction with meta.pkgConfigModules, as the new tester can use the list provided by this meta attribute as a default value for moduleNames, making its usage in passthru.tests very convenient. For backwards compatibility, a shim under the old name is maintained with a warning. sternenseemann2023-08-081-2/+9
* runNixOSTest: adds support for lib.extend•••When lib overrides were used, before this commit, they would not be made available in the configuration evaluation of nixosTest's nodes. Sample code: ``` nix let pkgs = import ./. { overlays = [ (new: old: { lib = old.lib.extend (self: super: { sorry_dave = builtins.trace "There are no pod bay doors" "sorry dave"; }); }) ]; }; in pkgs.testers.runNixOSTest { name = "demo lib overlay"; nodes = { machine = { lib, ... }: { environment.etc."got-lib-overlay".text = lib.sorry_dave; }; }; testScript = { nodes }: '' start_all() machine.succeed('grep dave /etc/got-lib-overlay') ''; } ``` Arthur Gautier2023-06-291-1/+3
* testers.runNixOSTest: init•••An up to date alternative to pkgs.nixosTest Robert Hensing2023-05-111-0/+14
* meta.pkgConfigModules: Init convention•••See docs. Follow-up work: - Existing packages should be converted - `defaultPkgConfigPackages` should assert on `meta.pkgConfigModules` and let `tests.pkg-config` alone test the build results. CC @sternenseemann Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> John Ericson2023-02-031-0/+1
* testers.hasPkgConfigModule: Extract and add tests, docsRobert Hensing2023-01-301-0/+2
* testers: Add missing doc link commentsRobert Hensing2022-10-271-0/+4
* testers.testEqualContents: initRobert Hensing2022-10-271-0/+38
* testers.testBuildFailure: initRobert Hensing2022-10-271-1/+11
* nixos/testing: Fix release.nix tests evaluation•••Fixes the problem introduced by 12b3066aae46a8ccc3d21f54f668a3f4be344332 which caused nixos/release.nix to return the wrong attributes, while intending to only affect nixos/lib's runTest. This also removes callTest from the test options, because callTest is only ever invoked by all-tests.nix. Robert Hensing2022-09-291-1/+1
* testers.testVersion: if grep failed then print the output of the commandArtturin2022-05-161-3/+12
* testers.nixosTest: Move from top-level and improve docsRobert Hensing2022-05-051-1/+28
* testers.invalidateFetcherByDrvHash: Move from top-levelRobert Hensing2022-05-051-0/+18
* doc: move testers to their own chapterArtturin2022-04-221-40/+1
* testers: convert to a format that is kind of compatible with nixdoc•••Examples: support has to be added to https://github.com/nix-community/nixdoc 'nixdoc --category testers --description "nixpkgs testers" --file ./pkgs/build-support/testers/default.nix' Artturin2022-04-221-23/+39
* testers.testVersion: move from trivial-builders.nix•••we will have more testers in the future so they should have their own location putting 'testers' in args will also make it simpler to use multiple testers Artturin2022-04-221-1/+38