aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Revert "lint: Append "/info/refs" to git-reference-url."Maxim Cournoyer2023-03-28
| | | | | | | This reverts commit c9af27d4ca733b20f09019f1465d3e5fdc1ec724. The change causes 'guix lint' to print URI not reachable (403) errors for GitHub every URLs.
* lint: Append "/info/refs" to git-reference-url.Felix Lechner2023-03-27
| | | | | | | | | | | | | | | | | | | | 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>
* tests: Fix guix-home.sh when guix isn't installedTing-Wei Lan2023-03-26
| | | | | | | * 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>
* Revert "tests: pack: Fix indentation."Maxim Cournoyer2023-03-17
| | | | This reverts commit ac1d530d56c1a259630c8873b2281033878a4acb.
* read-print: 'read-with-comments' reads comments within gexps.Ludovic Courtès2023-03-16
| | | | | | | | 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.
* packages: 'package-input-rewriting/spec' ignores hidden packages.Ludovic Courtès2023-03-13
| | | | | | | | | | | | | | | | | | | 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.
* packages: Consider 'patches' by 'package-direct-sources'.Simon Tournier2023-03-13
| | | | | | | * guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* read-print: Correctly handle comments that follow a list head.Ludovic Courtès2023-03-07
| | | | | | | | | | 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.
* pack: Adjust shell tests to read-only tarball root.Ludovic Courtès2023-02-27
| | | | | | | | | | | | | | 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.
* pack: Make sure tests can run without a world rebuild.Ludovic Courtès2023-02-27
| | | | | | | | | | | | | | | | | 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.
* import: hackage: Add upstream-name property.Lars-Dominik Braun2023-02-26
| | | | | | | | | | * 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.
* pack: Add RPM format.Maxim Cournoyer2023-02-19
| | | | | | | | | | | | * guix/rpm.scm: New file. * guix/scripts/pack.scm (rpm-archive): New procedure. (%formats): Register it. (show-formats): Add it. (guix-pack): Register supported extra-options for the rpm format. * tests/pack.scm (rpm-for-tests): New variable. ("rpm archive can be installed/uninstalled"): New test. * tests/rpm.scm: New test. * doc/guix.texi (Invoking guix pack): Document it.
* tests: pack: Fix indentation.Maxim Cournoyer2023-02-19
| | | | * tests/pack.scm: Fix indentation.
* linux-container: 'container-excursion' forks to join the PID namespace.Ludovic Courtès2023-01-30
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/61156>. * gnu/build/linux-container.scm (container-excursion): Add extra call to 'primitive-fork' and invoke THUNK in the child process. * tests/containers.scm ("container-excursion"): Remove extra 'primitive-fork' call, now unnecessary. ("container-excursion*, /proc"): New test.
* container: Correctly report exit status.Ludovic Courtès2023-01-30
| | | | | | | | | * gnu/build/linux-container.scm (container-excursion): Return the raw status value. * tests/containers.scm ("container-excursion, same namespaces"): Add 'status:exit-val' call. * guix/scripts/container/exec.scm (guix-container-exec): Correctly handle the different cases.
* tests: Do not try to create "$HOME/.config".Ludovic Courtès2023-01-25
| | | | | | | Previously this test would fail when HOME=/homeless-shelter and said directory cannot be created. * tests/guix-refresh.sh: Pass '--keyring' together with '-u'.
* transformations: Add '--with-version'.Ludovic Courtès2023-01-16
| | | | | | | | | | | | | | | This is a followup to 8aeccc6240ec45f0bc7bed655e0c8149ae4253eb. * guix/transformations.scm (package-with-upstream-version): New procedure. (transform-package-latest)[package-with-latest-upstream]: Remove. Use 'package-with-upstream-version' instead. (transform-package-version): New procedure. (%transformations, %transformation-options) (show-transformation-options-help/detailed): Add '-with-version'. * tests/transformations.scm ("options->transformation, with-version"): New test. * doc/guix.texi (Package Transformation Options): Document '--with-version'. (Defining Package Variants): Mention it.
* environment: Fix '--emulate-fhs' option overriding $PATH.John Kehayias2023-01-15
| | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/60566> where even if "--preserve='^PATH$'" was passed to 'guix shell' it would be replaced by just the FHS directories when '--emulate-fhs' was also set. * gnu/scripts/environment.scm (launch-environment): Add the FHS directories to $PATH rather than overriding $PATH completely. * tests/guix-environment-container.sh: Test that FHS directories are in $PATH in the container and that $PATH can be preserved. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* read-print: Do not use extended notation when printing '1+', '1-', etc.Ludovic Courtès2023-01-09
| | | | | | | * guix/read-print.scm (%special-non-extended-symbols): New variable. (symbol->display-string): New procedure. (pretty-print-with-comments): Use it in lieu of 'string->symbol'. * tests/read-print.scm: Add test.
* daemon: Improve error message for wrong hash sizes.Ludovic Courtès2023-01-09
| | | | | | | * nix/libutil/hash.cc (parseHash): Show the hash algorithm name and expected size in the error message. * tests/derivations.scm ("fixed-output derivation, invalid hash size"): New test.
* derivations: 'read-derivation' correctly handles case with empty hash.Ludovic Courtès2023-01-09
| | | | | | | | | | | Reported by Stephen Paul Weber <singpolyma@singpolyma.net> at <https://lists.gnu.org/archive/html/guix-devel/2023-01/msg00035.html>. * guix/derivations.scm (read-derivation)[outputs->alist]: Treat the empty hash case as non-fixed-output whether or not the hash algorithm is the empty string, and preserve the hash algorithm in <derivation-output>. * tests/derivations.scm ("'download' built-in builder, no fixed-output hash") ("fixed-output-derivation?, no hash", "read-derivation with hash = #f"): New tests.
* home: environment-variables: Fix escaping.Andrew Tropin2023-01-09
| | | | | | | | | * gnu/home/services.scm (environment-variable-shell-definitions): Fix escaping. * tests/guix-home.sh: Add STRING_WITH_ESCAPES environment variable and test its value. Reported-by: elevnkb
* home: environment-variables: Return support for file-likes and gexps.Andrew Tropin2023-01-09
| | | | | | | * gnu/home/services.scm (environment-variable-shell-definitions): Add support for file-likes and gexps. * tests/guix-home.sh: Add SHELL environment variable and test its value. Add BUILDHOSTTIME environment variable.
* refresh: Add CLI tests.Ludovic Courtès2023-01-08
| | | | | * guix/import/test.scm, tests/guix-refresh.sh: New files. * Makefile.am (MODULES, SH_TESTS): Add them.
* home: services: environment-variables: Add support for literal strings.Ludovic Courtès2023-01-05
| | | | | | | | | * gnu/home/services.scm (<literal-string>): New record type. (environment-variable-shell-definitions): Split 'shell-quote' into 'quote-string' and 'shell-double-quote'. Add 'shell-single-quote'. Add clause for 'literal-string' records. * tests/guix-home.sh: Test it. * doc/guix.texi (Essential Home Services): Document it.
* tests: Fix gnu-maintenance tests.Hartmut Goebel2023-01-02
| | | | | | | | | | | | The regression was introduce with commit a274a6a1acb99738f02de7b226e6a0d3883ec353 ("upstream-updater: Rename record field.") * tests/tests/gnu-maintenance.scm: ("latest-html-release, scheme-less URIs", "latest-html-release, no signature", "latest-html-release, signature"): Replace upstream-updater-latest by upstream-updater-import. Reported-by: Ricardo Wurmus <rekado@elephly.net>
* tests: import-utils: Ignore extra keyword arguments.Ricardo Wurmus2022-12-31
| | | | | | * tests/import-utils.scm ("recursive-import", "recursive-import: skip false packages (toplevel)", "recursive-import: skip false packages (dependency)"): Do not try to match all arguments.
* records: match-record supports specifying a different variable name.Attila Lendvai2022-12-27
| | | | | | | | | | | | | | An example: (match-record obj <my-type> (field1 (field2 custom-var-name) field3) ...) * guix/records.scm (match-record-inner): Add support for the new syntax. * tests/records.scm ("match-record, simple"): Add a simple test case for the new syntax. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* upstream-updater: Rename record field.Hartmut Goebel2022-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next commits will make the functions, which are currently importing the latest version of a package, change into importing the latest or a given version of the package (for those updaters supporting specifying a version). Thus the name ‘latest‘ is no longer appropriate. * guix/upstream.scm (upstream-updater) Rename field [latest] to [import]. (lookup-updater, package-latest-release) Adjust fieldname accordingly. * guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater, %savannah-updater, %sourceforge-updater, %xorg-updater, %kernel.org-updater, %generic-html-updater), guix/import/cpan.scm (%cpan-updater), guix/import/cran.scm (%cran-updater, %bioconductor-updater), guix/import/crate.scm (%crate-updater), guix/import/egg.scm (%egg-updater), guix/import/elpa.scm (%elpa-updater), guix/import/gem.scm (%gem-updater), guix/import/git.scm (%generic-git-updater), guix/import/github.scm (%github-updater), guix/import/gnome.scm (%gnome-updater), guix/import/hackage.scm (%hackage-updater), guix/import/hexpm.scm (%hexpm-updater), guix/import/kde.scm (%kde-updater), guix/import/launchpad.scm (%launchpad-updater), guix/import/minetest.scm (%minetest-updater), guix/import/opam.scm (%opam-updater), guix/import/pypi.scm (%pypi-updater), guix/import/stackage.scm (%stackage-updater), tests/import-github.scm (found-sexp) tests/transformations.scm ("options->transformation, with-latest"): Adjust fieldname accordingly.
* cpio: Skip test on inode numbers that don't fit on 32 bits.Ludovic Courtès2022-12-20
| | | | | | | | | Fixes <https://issues.guix.gnu.org/60202>. Reported by Christopher Baines <mail@cbaines.net>. * tests/cpio.scm (%test-file): New variable. ("file->cpio-header + write-cpio-header + read-cpio-header"): Use it. Skip test when the inode number of %TEST-FILE is too big.
* tests: Adjust 'guix package' test to latest package search metrics.Ludovic Courtès2022-12-20
| | | | | | | | | | | | With commit bbcd06e56c06376e640a7ac81a7109e7135a20f2, the command "guix package -s '^fileutils$'" would match the 'ocaml-fileutils' package, because its 'package-upstream-name*' is "fileutils". Work around it. Reported by Vagrant Cascadian. * tests/guix-package.sh: Change "fileutils" example to use a different package name.
* ui: Take package upstream name into account when searching.Lars-Dominik Braun2022-12-13
| | | | | | | * guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*. * tests/ui.scm ("package-relevance and upstream name"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* packages: Add 'package-upstream-name*'.Lars-Dominik Braun2022-12-13
| | | | | | | * guix/packages.scm (package-upstream-name*): New procedure. * tests/packages.scm ("package-upstream-name*"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Merge branch 'version-1.4.0'Ludovic Courtès2022-12-12
|\
| * deduplicate: Use 'sendfile' for small file copies.Ludovic Courtès2022-12-10
| | | | | | | | | | | | | | * guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' instead of 'dump-port'. * tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"): New test.
| * records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès2022-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
* | pki: 'public-keys->acl' deduplicates entries.Ludovic Courtès2022-12-12
| | | | | | | | | | | | | | | | Reported by Tobias Geerinckx-Rice <me@tobias.gr> in <https://issues.guix.gnu.org/50892>. * guix/pki.scm (public-keys->acl): Add call to 'delete-duplicates'. * tests/pki.scm ("public-keys->acl deduplication"): New test.
* | tests: Fix guix-system.sh test.Maxim Cournoyer2022-12-04
| | | | | | | | | | | | | | | | | | | | The regression was introduce with commit c7793b82efd3383a9f7adf0dfa82d71ee032e41b ("gnu: raspberry-pi: Add a bootloader-chain for the Raspberry Pi and os examples.") due to the examples needing to be built for the aarch64-linux system. * tests/guix-system.sh: Invoke guix system build with '--system=aarch64-linux' to build the Raspberry Pi systems.
* | records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès2022-12-02
|/ | | | | | | | | | | | | | | | | | This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
* import/utils: spdx-string->license: Support '+' operator.Philip McGrath2022-11-18
| | | | | | | | | | | | | | Previously, '+' was supported only via special cases for deprecated GNU identifiers like 'GPL-N+'. This commit adds support for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'. Strictly speaking, '+' is an operator, not part of the SPDX license identifier, but it is useful to handle it here. * guix/import/utils.scm (spdx-string->license): Support '+' operator. * tests/import-utils.scm ("spdx-string->license"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import/utils: spdx-string->license: Match case-insensitively.Philip McGrath2022-11-18
| | | | | | | | | | | | SPDX specifies that license identifiers (unlike the 'AND', 'OR', and 'WITH' operators) are matched case-insensitively. * guix/import/utils.scm (%spdx-license-identifiers): New variable. (spdx-string->license): Search in '%spdx-license-identifiers' using 'string-ci=?'. * tests/import-utils.scm ("spdx-string->license"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* shell: Detect --symlink spec problems early.Maxim Cournoyer2022-11-15
| | | | | | | | | | | * guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous char-set. Raise an exception when the target is an absolute file name. (guix-pack): Move with-error-handler earlier. * guix/scripts/shell.scm (guix-shell): Likewise. * guix/scripts/environment.scm (guix-environment): Wrap the whole guix-environment* call with the with-error-handling handler. * tests/guix-environment-container.sh: Add tests. * tests/guix-pack.sh: Adjust symlink spec.
* guix: shell: Add '--symlink' option.Maxim Cournoyer2022-11-15
| | | | | | | | | | | | | | | | | * guix/scripts/pack.scm (%options): Extract symlink parsing logic to... (symlink-spec-option-parser): ... here. (self-contained-tarball/builder): Add a comment mentioning why a relative file name is used for the link target. * guix/scripts/environment.scm (show-environment-options-help): Document new --symlink option. (%default-options): Add default value for symlinks. (%options): Register new symlink option. (launch-environment/container): Add #:symlinks argument and extend doc, and create symlinks using evaluate-populate-directive. (guix-environment*): Pass symlinks arguments to launch-environment/container. * doc/guix.texi (Invoking guix shell): Document it. * tests/guix-shell.sh: Add a --symlink (negative) test. * tests/guix-environment-container.sh: Add tests.
* gnu-maintenance: 'release-file?' excludes "valgrind-3.20.0.RC1.tar.bz2".Ludovic Courtès2022-11-11
| | | | | | * guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before "(alpha|beta|...)". * tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
* grafts: Run with a UTF-8 locale.Ludovic Courtès2022-11-11
| | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/55968>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/grafts.scm (%graft-with-utf8-locale?): New parameter. (graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New variables. [build]: Use 'set-utf8-locale'. * tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set '%graft-with-utf8-locale?' to #f.
* shell: Fix '--emulate-fhs' sometimes not including 'glibc-for-fhs'.John Kehayias2022-11-06
| | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/58861>. Previously the order of the options giving to 'guix shell' could mean that the 'glibc-for-fhs' package included with the '--emulate-fhs' option would not appear in the container. For example, using the development option with a package using the 'gnu-build-system', e.g. 'guix shell -CFD hello', would include the regular 'glibc' package. The option ordered mattered: 'guix shell -CD hello -F' would include the expected 'glibc-for-fhs'. We fix this by having 'glibc-for-fhs' added to the package list just before calling 'options-with-caching' so the option order given by the user does not matter. * guix/scripts/shell.scm (%options): Move the '--emulate-fhs' (expression . ...) component from here... (parse-args): ... to here. * tests/guix-environment-container.sh: Add a test to check that 'glibc-for-fhs' is in the container even when 'glibc' is included in the 'guix shell' package list. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu: python-setuptools: Move to python-build.Lars-Dominik Braun2022-10-27
| | | | | | | | | | | * gnu/packages/python-xyz.scm (python-setuptools): Move… * gnu/packages/python-build.scm: …here. * gnu/packages/chemistry.scm, gnu/packages/messaging.scm, gnu/packages/sequoia.scm, tests/lint.scm: Adjust module imports accordingly. Co-authored-by: Marius Bakke <marius@gnu.org>
* Remove now unnecessary uses of (guix grafts).Ludovic Courtès2022-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These modules would use (guix grafts) just to access '%graft?' and related bindings, which are now in (guix store). * gnu/ci.scm, guix/gexp.scm, guix/lint.scm, guix/scripts.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/challenge.scm, guix/scripts/deploy.scm, guix/scripts/environment.scm, guix/scripts/home.scm, guix/scripts/pack.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/size.scm, guix/scripts/system.scm, guix/scripts/weather.scm, tests/builders.scm, tests/channels.scm, tests/cpan.scm, tests/derivations.scm, tests/gexp.scm, tests/graph.scm, tests/guix-daemon.sh, tests/monads.scm, tests/pack.scm, tests/packages.scm, tests/profiles.scm, tests/system.scm: Remove #:use-module (guix grafts).
* tests: 'guix build --with-commit' output no longer refers to the tag ID.Ludovic Courtès2022-10-22
| | | | | | This is a followup to 46f7011591601b4783b2dc2c7252c41564ca0140. * tests/guix-build-branch.sh: Replace tag ID by commit ID.
* lint: source: Add check for <svn-reference> over HTTP(S).Ludovic Courtès2022-10-17
| | | | | | | * guix/lint.scm (svn-reference-uri-with-userinfo): New procedure. (check-source): Add 'svn-reference?' clause. * tests/lint.scm ("source: svn-reference, HTTP 200") ("source: svn-reference, HTTP 404"): New tests.