summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Expand)Author
2023-06-04tests: records: Add test for ellipsis in body....* tests/records.scm ("match-record, ellipsis in body"): New test. Josselin Poiret
2023-06-04records: Add MATCH-RECORD-LAMBDA....* guix/records.scm (match-record-lambda): New syntax. * tests/records.scm ("match-record-lambda"): New test. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> (unmatched-parenthesis ew syntax
2023-06-04records: match-record: Support thunked and delayed fields....* guix/records.scm (match-record): Unwrap matched thunked and delayed fields. * tests/records.scm ("match-record, thunked field", "match-record, delayed field"): New tests. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> (unmatched-parenthesis d
2023-06-02tests: Check for service existence in MODIFY-SERVICES...* tests/services.scm ("modify-services: delete non-existing service") ("modify-services: change value for non-existing service"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brian Cully
2023-06-02tests: Add tests for MODIFY-SERVICES procedure...* tests/services.scm ("modify-services: do nothing") ("modify-services: delete service") ("modify-services: change value"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brian Cully
2023-05-31tests: Use quasiquoted 'match' patterns for package sexps....Turns out it's easier to read. * tests/cpan.scm ("cpan->guix-package"): Use a quasiquoted pattern. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/gem.scm ("gem->guix-package") ("gem->guix-package with a specific version") ("gem-recursive-import") ("gem-recursive-import with a specific version"): Likewise. * tests/hexpm.scm ("hexpm-recursive-import"): Likewise. * tests/opam.scm ("opam->guix-package"): Likewise. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. * tests/texlive.scm ("texlive->guix-package"): Likewise. Ludovic Courtès
2023-05-31upstream: Honor package properties for ignored and extra inputs....* guix/upstream.scm (update-package-inputs)[filtered-inputs] [regular-inputs, native-inputs, propagated-inputs]: New procedures. Use them in 'update-field' calls. * tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add "libreoffice" to the dependencies of "the-test-package". Add 'updater-ignored-inputs' property to "the-test-package". * doc/guix.texi (Invoking guix refresh): Document it. Ludovic Courtès
2023-05-31import: gem: Updater provides input list....* guix/import/gem.scm (import-release): Add 'inputs' field. * tests/gem.scm ("package-latest-release"): New test. Ludovic Courtès
2023-05-31import: gem: Factorize "bundler" special case for name mapping....* guix/import/gem.scm (ruby-package-name): Add "bundler" special case. (gem->guix-package): Adjust accordingly. * tests/gem.scm ("gem-recursive-import") ("gem-recursive-import with a specific version"): Remove "ruby-bundler" from the expected packages. Ludovic Courtès
2023-05-31import: elpa: Updater provides input list....* guix/import/elpa.scm (elpa-dependency->upstream-input): New procedure. (latest-release): Add 'inputs' field. * tests/elpa.scm ("package-latest-release"): New test. Ludovic Courtès
2023-05-31import: cpan: Updater provides input list....* guix/import/cpan.scm (latest-release): Add 'inputs' field. * tests/cpan.scm ("package-latest-release"): New test. Ludovic Courtès
2023-05-31import: cpan: Represent dependencies as <upstream-input> records....* guix/import/cpan.scm (cpan-name->downstream-name) (cran-dependency->upstream-input, cran-module-inputs): New procedures. (cpan-module->sexp)[guix-name, convert-inputs]: Remove. [maybe-inputs]: Adjust to deal with <upstream-input>. Use 'cpan-name->downstream-name' instead of 'guix-name'. Add call to 'cpan-module-inputs' and adjust calls to 'maybe-inputs'. No longer emit input labels. * tests/cpan.scm ("cpan->guix-package"): Adjust test accordingly. Ludovic Courtès
2023-05-31tests: upstream: Restore test that was skipped....This test was being skipped since ea6fb108f6a3a53d48ea187b1f82b5f7ffce00a7. * tests/upstream.scm ("coalesce-sources same version"): Compare a serialized form of <upstream-source>. Ludovic Courtès
2023-05-31upstream: Remove <upstream-input-change> and related code....* guix/upstream.scm (<upstream-input-change>): Remove. (changed-inputs): Remove. * tests/upstream.scm (test-package, test-new-package) ("changed-inputs returns no changes") ("changed-inputs returns changes to plain input list") ("changed-inputs returns changes to all plain input lists"): Remove. Ludovic Courtès
2023-05-31upstream: 'update-package-source' edits input fields....Previously, 'guix refresh r-ggplot2 -u' and similar commands would print of list of input changes that would have to be made manually. With this change, 'guix refresh -u' takes care of updating input fields automatically. * guix/upstream.scm (update-package-inputs): New procedure. (update-package-source): Call it when 'upstream-source-inputs' returns true. * guix/scripts/refresh.scm (update-package): Remove iteration over the result of 'changed-inputs'. * guix/import/test.scm (available-updates): Add support for input lists. * tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add input list for "the-test-package". Make sure 'guix refresh -u' updates 'inputs' accordingly. * doc/guix.texi (Invoking guix refresh): Mention it. Ludovic Courtès
2023-05-31upstream: Replace 'input-changes' field by 'inputs'....Returning the expected list of inputs rather than changes relative to the current package definition is less ambiguous and offers more possibilities for further processing. * guix/upstream.scm (<upstream-source>)[input-changes]: Remove. [inputs]: New field. (<upstream-input>): New record type. * guix/upstream.scm (upstream-input-type-predicate) (input-type-filter, upstream-source-regular-inputs) (upstream-source-native-inputs, upstream-source-propagated-inputs): New procedures. (changed-inputs): Expect an <upstream-source> as its second argument. Adjust accordingly. * guix/import/pypi.scm (distribution-sha256): New procedure. (maybe-inputs): Expect a list of <upstream-input>. (compute-inputs): Rewrite to return a list of <upstream-input>. (pypi-package-inputs, pypi-package->upstream-source): New procedures. (make-pypi-sexp): Use it. * guix/import/stackage.scm (latest-lts-release): Define 'cabal'. Replace 'input-changes' field by 'inputs'. * guix/scripts/refresh.scm (update-package): Use 'changed-inputs' instead of 'upstream-source-input-changes'. * tests/cran.scm ("description->package"): Adjust order of inputs. * tests/pypi.scm (default-sha256, default-sha256/base32): New variables. (foo-json): Add 'digests' entry. ("pypi->guix-package, no wheel"): Check HASH against DEFAULT-SHA256/BASE32. ("pypi->guix-package, wheels"): Likewise. ("pypi->guix-package, no usable requirement file."): Likewise. ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. ("package-latest-release"): New test. * tests/upstream.scm (test-package-sexp): Remove. ("changed-inputs returns no changes"): Rewrite to use <upstream-source>. (test-new-package-sexp): Remove. ("changed-inputs returns changes to plain input list"): Rewrite. ("changed-inputs returns changes to all plain input lists"): Likewise. ("changed-inputs returns changes to labelled input list") ("changed-inputs returns changes to all labelled input lists"): Remove. * guix/import/cran.scm (maybe-inputs): Expect PACKAGE-INPUTS to be a list of <upstream-input>. (source-dir->dependencies): Return a list of <upstream-input>. (vignette-builders): Likewise. (uri-helper, cran-package-source-url) (cran-package-propagated-inputs, cran-package-inputs): New procedures. (description->package): Use them instead of local definitions. (latest-cran-release): Replace 'input-changes' field by 'inputs'. (latest-bioconductor-release): Likewise. (format-inputs): Remove. * guix/import/hackage.scm (cabal-package-inputs): New procedure. (hackage-module->sexp): Use it. [maybe-inputs]: Expect a list of <upstream-input>. Ludovic Courtès
2023-05-31tests: pypi: Rewrite tests using a local HTTP server....* guix/import/pypi.scm (%pypi-base-url): New variable. (pypi-fetch): Use it. * tests/pypi.scm (foo-json): Compute URLs relative to '%local-url'. (test-json-1, test-json-2, test-source-hash): Remove. (file-dump): New procedure. (with-pypi): New macro. ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Rewrite using 'with-pypi'. Ludovic Courtès
2023-05-31tests: pypi: Factorize tarball and wheel file creation....* tests/pypi.scm (sample-directory): New variable. (pypi-tarball, wheel-file): New procedures. ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Use them. Ludovic Courtès
2023-05-30substitute: If a server's nar URL is 404, try the next one(s)....If a substitute server advertises in its narinfo, for example, both a /zstd and a /lzip URL but the /zstd URL is unreachable, try the /lzip URL. Fixes <https://issues.guix.gnu.org/63634>. * guix/narinfo.scm (narinfo-preferred-uris): New procedure. (narinfo-best-uri): Rebase on top of it. * guix/scripts/substitute.scm (download-nar)[try-fetch]: New procedure. Use 'narinfo-preferred-uris' and 'try-fetch' to attempt all the URLs of NARINFO. * tests/substitute.scm (request-substitution): Remove 'parameterize'. Delete DESTINATION. ("substitute, preferred nar URL is 404, other is 200"): New test. Ludovic Courtès
2023-05-18style: Add 'arguments' styling rule....* guix/scripts/style.scm (unquote->ungexp, gexpify-argument-value) (quote-argument-value, gexpify-argument-tail) (gexpify-package-arguments): New procedures. (%gexp-keywords): New variable. (%options): Add "arguments" case for 'styling-procedure. (show-stylings): Update. * tests/style.scm ("gexpify arguments, already gexpified") ("gexpify arguments, non-gexp arguments, margin comment") ("gexpify arguments, phases and flags") ("gexpify arguments, append arguments") ("gexpify arguments, substitute-keyword-arguments") ("gexpify arguments, append substitute-keyword-arguments"): New tests. * doc/guix.texi (package Reference): For 'arguments', add compatibility note and link to 'guix style'. (Invoking guix style): Document the 'arguments' styling rule. Ludovic Courtès
2023-05-06lint: archival: Warn against non-origin package sources....Suggested by Maxim Cournoyer <maxim.cournoyer@gmail.com> and Simon Tournier <zimon.toutoune@gmail.com>. * guix/lint.scm (check-archival): Add 'local-file?' clause. Clarify message in case (package-source package) is not an origin. * tests/lint.scm ("archival: not an origin"): New test. Ludovic Courtès
2023-05-05read-print: Correctly read "(. x)"....* guix/read-print.scm (read-with-comments): Check whether REST is a pair before calling 'set-cdr!'. * tests/read-print.scm ("read-with-comments: half dot notation"): New test. Ludovic Courtès
2023-05-04transformations: Add '--with-configure-flag'....* guix/transformations.scm (transform-package-configure-flag): New procedure. (%transformation-options, %transformation-options) (show-transformation-options-help/detailed): Add it. * tests/transformations.scm ("options->transformation, with-configure-flag"): New test. * doc/guix.texi (Package Transformation Options): Document it. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Sarthak Shah
2023-05-04style: Make 'safe' policy less conservative....Previously, a mere (arguments '(#:tests? #f)) would lead guix style -S inputs --input-simplification=safe to bail out. It now recognizes such trivial argument lists and proceeds. * guix/scripts/style.scm (trivial-package-arguments?): New procedure. (simplify-package-inputs): Use it in the 'safe case instead of 'null?'. * tests/style.scm ("input labels, 'safe' policy, trivial arguments"): New test. Ludovic Courtès
2023-04-30import: pypi: Adjust tests for new build system....This is a followup to cb8d080349a0691f4d563fcdd7bc8d8c40d0d88b. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Replace 'python-build-system' by 'pyproject-build-system'. Ludovic Courtès
2023-04-28tests: guix-graph.sh: Fix expected path from emacs to libffi....* tests/guix-graph.sh: Change the expected path from emacs to libffi. `guix graph --path` outputs only one possible path, and the one it outputs for this case has changed. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret
2023-04-28tests: guix-build.sh: Don't use hidden gcc for transformation tests....* tests/guix-build.sh: Do not try to rewrite gcc, it is hidden and so will not be rewritten, as per eee95b5a879b7096dffd533f24107cf8926b621e. Instead, try to build grep with coreutils rewritten to hello. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret
2023-04-24read-print: 'pretty-print-with-comments' keeps newlines on long strings....* guix/read-print.scm (printed-string)[preserve-newlines?]: New procedure. Use it to preserve newlines on long strings. * tests/read-print.scm: Add test. Ludovic Courtès
2023-04-21tests: Relax two tests that expected a non-zero error code....* tests/guix-package-aliases.sh: "guix upgrade foo bar" has always returned zero; adjust accordingly. * tests/guix-refresh.sh: "guix refresh -t test idutils" and similar return zero; adjust accordingly. Ludovic Courtès
2023-04-21tests: Fix checks for expected failures....Addresses <https://issues.guix.gnu.org/62406>. With 'set -e', a return status inverted with '!' does not cause the shell to exit immediately. Instead use '&& false' to indicate an expected failure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Bavier
2023-04-18tests: guix-system: Drop the i686-linux desktop image test....Desktop these days means having Rust support (GNOME), which i686 currently lacks on Guix. * tests/guix-system.sh: Do not attempt to build the desktop.tmpl image for i686-linux. Maxim Cournoyer
2023-04-18tests: Fix texlive->guix-package test....The home page for the package had changed. * tests/texlive.scm ("texlive->guix-package"): Match the home-page and synopsis inexactly to avoid future similar breakages. Maxim Cournoyer
2023-04-18tests: Re-add debug output to a package tests....* tests/packages.scm ("fold-available-packages with/without cache"): Re-introduce debugging output. Maxim Cournoyer
2023-04-07packages: Remove 'origin-sha256' procedure....* guix/packages.scm (origin-sha256): Remove procedure. * tests/import-utils.scm (test-import-utils) [alist->package with explicit source]: Use content-hash-value. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal
2023-04-07services: ntp-service-type: Remove deprecated server as strings support....* gnu/services/networking.scm (<ntp-configuration>)[servers]: Rename accessor to ntp-configuration-servers. (ntp-configuration-servers): Remove helper procedure. (ntp-shepherd-service): Remove helper procedure usage. * tests/networking.scm: Remove obsolete test. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal
2023-04-07gnu: Purge pre-1.3.0 deprecated packages....* gnu/packages/bioinformatics.scm (deeptools): Remove variable. * gnu/packages/efi.scm (efi_analyzer): Ditto. * gnu/packages/guile.scm (guile-2.2/bug-fix, guile-json): Ditto. * gnu/packages/image.scm (libjpeg): Ditto. * gnu/packages/kde.scm (kdevplatform): Ditto * gnu/packages/linphone.scm (linphoneqt): Ditto. * gnu/packages/maths.scm (blis-sandybridge, blis-haswell, blis-knl): Ditto. * gnu/packages/mpi.scm (hwloc-2.0): Ditto. * gnu/packages/music.scm (python-abjad, zlfo): Ditto. * gnu/packages/perl.scm (perl-base, perl-parent): Ditto. * gnu/packages/tryton.scm (python-trytond): Ditto. * gnu/packages/video.scm (gnome-mpv): Ditto. * tests/graph.scm: Use guile-json-1. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal
2023-04-06environment: Add '--nesting'....* guix/scripts/environment.scm (show-environment-options-help) (%options): Add '--nesting'. (options/resolve-packages): Handle it. (launch-environment/container): Add #:nesting? and honor it. [nesting-mappings]: New procedure. (guix-environment*): Add support for '--nesting'. * guix/scripts/shell.scm (profile-cached-gc-root): Special-case 'nesting?'. * tests/guix-environment-container.sh: Test it. * doc/guix.texi (Invoking guix shell): Document it. Ludovic Courtès
2023-04-02services: replace bare serializers with (serializer ...)...* gnu/home/services/shells.scm (home-zsh-configuration)[environment-variables]: Use (serializer ...). (home-bash-configuration)[aliases, environment-variables]: Likewise. (home-fish-configuration)[abbreviations, aliases] [environment-variables]: Likewise. * gnu/services/audio.scm (mpd-configuration)[music-dir, playlist-dir] [endpoints, address, inputs, archive-plugins, input-cache-size] [decoders, filters, playlist-plugins]: Likewise. * gnu/services/linux.scm (fstrim-configuration)[extra-arguments]: Likewise. * gnu/services/security.scm (fail2ban-jail-configuration)[backend] [log-encoding, extra-content]: Likewise. * tests/services/configuration.scm: Update tests. ("serialize-configuration [deprecated]"): New test. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Bruno Victal
2023-04-02services: configuration: Add user-defined sanitizer support....This changes the 'custom-serializer' field into a generic 'extra-args' field that can be extended to support new literals. Within extra-args, the literals 'sanitizer' and 'serializer' allow for user-defined sanitization and serialization procedures respectively. The 'empty-serializer' was also added as a literal to be used as before. To prevent confusion between the new “explicit” style of specifying a sanitizer, and the old “implicit” style, the latter has been deprecated, and a warning is issued if it is encountered. * gnu/services/configuration.scm (define-configuration-helper): Rename 'custom-serializer' to 'extra-args'. Add support for literals 'sanitizer', 'serializer' and 'empty-serializer'. Rename procedure 'field-sanitizer' to 'default-field-sanitizer' to avoid syntax clash. Only define default field sanitizers if user-defined ones are absent. (normalize-extra-args): New variable. (<configuration-field>)[sanitizer]: New field. * doc/guix.texi (Complex Configurations): Document the newly added literals. * tests/services/configuration.scm: Add tests for the new literals. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Bruno Victal
2023-03-28Revert "lint: Append "/info/refs" to git-reference-url."...This reverts commit c9af27d4ca733b20f09019f1465d3e5fdc1ec724. The change causes 'guix lint' to print URI not reachable (403) errors for GitHub every URLs. Maxim Cournoyer
2023-03-27lint: Append "/info/refs" to git-reference-url....For the atftp package added in the preceeding commit, lint produced this warning: gnu/packages/networking.scm:2924:5: atftp@0.8.0: URI https://git.code.sf.net/p/atftp/code not reachable: 404 ("Not Found") Thanks to Sergey Trofimov for suggesting a fix! [1] [1] https://issues.guix.gnu.org/62156#3 It was implemented here, and the warning disappeared. * guix/lint.scm (check-source): Append "/info/refs" to git-reference-url. Co-authored-by: Sergey Trofimov <sarg@sarg.org.ru> Signed-off-by: Ludovic Courtès <ludo@gnu.org> Felix Lechner
2023-03-26tests: Fix guix-home.sh when guix isn't installed...* tests/guix-home.sh: Reorder NIX_STORE_DIR variable definition to prevent guix from crashing due to missing /gnu/store. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Ting-Wei Lan
2023-03-17Revert "tests: pack: Fix indentation."...This reverts commit ac1d530d56c1a259630c8873b2281033878a4acb. Maxim Cournoyer
2023-03-16read-print: 'read-with-comments' reads comments within gexps....Fixes <https://issues.guix.gnu.org/62059>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/read-print.scm (read-with-comments): Special-case #~, #$, and #+. * tests/read-print.scm: Add two tests. Ludovic Courtès
2023-03-13packages: 'package-input-rewriting/spec' ignores hidden packages....The primary motivation is to support things like: guix build guix --with-input=guile=guile-next without triggering a rebuild of (@@ (gnu packages commencement) guile-final) and similar things. It is also consistent with package name resolution on the command line: a package that cannot be named cannot be replaced. * guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is hidden, return it as-is. * tests/packages.scm ("package-input-rewriting/spec, hidden package"): New test. * doc/guix.texi (Defining Package Variants): Update. (Package Transformation Options): Update '--with-input' example. Ludovic Courtès
2023-03-13packages: Consider 'patches' by 'package-direct-sources'....* guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Simon Tournier
2023-03-07read-print: Correctly handle comments that follow a list head....Fixes <https://issues.guix.gnu.org/61013>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/read-print.scm (pretty-print-with-comments)[starts-with-line-comment?]: New procedure. Use it when printing a list. * tests/read-print.scm: Add two tests. Ludovic Courtès
2023-02-27pack: Adjust shell tests to read-only tarball root....Fixes <https://issues.guix.gnu.org/61853>. Fixes a regression introduced in 68380db4c40a2ee1156349a87254fd7b1f1a52d5, whereby the tarball's root entry is now read-only, due to the creation of "profile-directory" in the store. * tests/guix-pack.sh: Remove and recreate $test_directory before transformation option test. * tests/guix-pack-relocatable.sh: Add "chmod +w $test_directory" lines before attempts to write to it. Ludovic Courtès
2023-02-27pack: Make sure tests can run without a world rebuild....Commit 68380db4c40a2ee1156349a87254fd7b1f1a52d5 moved from 'gexp->derivation', which as a side effect, would lead tests to require a "world rebuild"--specifically, they'd have to build (default-guile). This was mitigated by 68775338a510f84e63657ab09242d79e726fa457, but that change introduced another regression. * guix/scripts/pack.scm (populate-profile-root): Define 'bootstrap?'. Pass #:guile to 'computed-file', with a value depending on 'bootstrap?'. * tests/pack.scm ("self-contained-tarball + localstatedir") ("docker-image + localstatedir", "squashfs-image + localstatedir") ("deb archive with symlinks and control files") ("rpm archive can be installed/uninstalled"): Use a <profile> record instead of a derivation. Ludovic Courtès
2023-02-26import: hackage: Add upstream-name property....* guix/import/hackage.scm (hackage-module->sexp): Add property upstream-name to imported package. * tests/hackage.scm (match-ghc-foo): Add upstream-name property. (match-ghc-foo-6): Ditto. (match-ghc-elif): Ditto. (match-ghc-foo-revision): Ditto. (match-ghc-foo-import): Ditto. Lars-Dominik Braun