summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-08-28import-utils: Do not include punctuation when wrapping in @code{}.Ricardo Wurmus
* guix/import/utils.scm (beautify-description): Exclude punctuation. * tests/import-utils.scm: Add new test.
2023-08-26gnu-maintenance: Consider Qt source tarballs as "release files".Maxim Cournoyer
* guix/gnu-maintenance.scm (release-file?): Use positive logic in doc. Add a special case for Qt source archives. * tests/gnu-maintenance.scm ("release-file?"): Update test.
2023-08-26gnu-maintenance: Add support to rewrite version in URL path.Maxim Cournoyer
Fixes <https://issues.guix.gnu.org/64015>. Fixes <https://issues.guix.gnu.org/65304>. Previously, the generic HTML updater would only look for the list of files found at the parent of its current source URL, ignoring that the URL may embed the version elsewhere in its path. This could cause 'guix refresh' to report no updates available, while in fact there were, such as for 'libuv'. * guix/gnu-maintenance.scm (strip-trailing-slash): New procedure. (%version-rx): New variable. (rewrite-url): New procedure. (import-html-release): New rewrite-url? argument. When true, use the above procedure. (import-html-updatable-release): Call import-html-release with #:rewrite-url set to #t. * tests/gnu-maintenance.scm ("rewrite-url, to-version specified") ("rewrite-url, without to-version"): New tests.
2023-08-25tests: guix-home: Fix description search for home-mcron.Josselin Poiret
* tests/guix-home.sh: home-mcron has changed description, adapt the search.
2023-08-25tests: guix-shell: Use bash instead of user's $SHELL.Josselin Poiret
* tests/guix-shell.sh (fd_list): Use bash instead of $SHELL. Some other shells have trouble not opening too many fds. Also, bash in an implicit input of guix, so it should always be available.
2023-08-21tests: Adjust 'node-back-edges' test for 'bag' to system-dependent glibc.Ludovic Courtès
Fixes a regression introduced in 560cb51e7b37e2c6f6fe4b72a3781185c57fdf83, which would lead this test on x86_64-linux to return a DIFF with two packages, nhc98 and dev86 (both have #:system "i686-linux" and thus depend on a different glibc object; why other system-specific packages such as 'wine' aren't reported is unclear). * tests/graph.scm ("node-transitive-edges + node-back-edges"): Use 'test-equal'. Define 'system-specific?' and use it.
2023-08-18tests: store-roots: Remove bogus test.Ludovic Courtès
This test was added in 1261ce15233cbf7e24de9959df86a23b46314a28 but it proved to be bogus: <https://issues.guix.gnu.org/64760>. * tests/store-roots.scm ("gc-roots, initial"): Remove.
2023-08-18tests: packages: Set system for expected result of package->bag.Josselin Poiret
* tests/packages.scm ("package->bag"): Parameterize the expected result by the system used to lower the package to a bag. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-17ui: 'load*' accepts /dev/fd/N files pointing to a pipe.Ludovic Courtès
This allows users to write Bash commands like: guix time-machine -C <(echo %default-channels) -- ... or: guix build -m <(echo '(specifications->manifest (list "guile"))') Previously, on GNU/Linux, they would fail with: error: failed to load '/dev/fd/63': No such file or directory * guix/ui.scm (try-canonicalize-path): New procedure. (load*): Use it. * tests/guix-build.sh: Test 'guix build -m' with a /dev/fd/N file.
2023-08-16scripts: time-machine: Error when attempting to visit too old commits.Maxim Cournoyer
* doc/guix.texi (Invoking guix time-machine): Document limitation. * guix/inferior.scm (cached-channel-instance): New VALIDATE-CHANNELS argument. Use it to validate channels when there are no cache hit. * guix/scripts/time-machine.scm (%options): Tag the given reference with 'tag-or-commit instead of 'commit. (%oldest-possible-commit): New variable. (guix-time-machine) <validate-guix-channel>: New nested procedure. Pass it to the 'cached-channel-instance' call. * tests/guix-time-machine.sh: New test. * Makefile.am (SH_TESTS): Register it. Suggested-by: Simon Tournier <zimon.toutoune@gmail.com> Reviewed-by: Ludovic Courtès <ludo@gnu.org> Reviewed-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-08-13tests: Fix texlive->guix-package test.Tobias Geerinckx-Rice
This follows up on commit 985cf777b9aa394d4469205d6fea98d367a2ef32. * tests/texlive.scm ("texlive->guix-package"): Don't expect a texlive-texworks propagated input.
2023-08-13tests: Fix texlive->guix-package test.Tobias Geerinckx-Rice
This follows up on commit 1619f2c18c1b3cca41f52fea3d7231b9ad490af8. * tests/texlive.scm ("texlive->guix-package"): Don't expect a ‘license:’ prefix to ‘fsf-free’.
2023-08-15refresh: Add --target-version option.Maxim Cournoyer
* guix/scripts/refresh.scm (%options): Register 'target-version' long version. (update-specification->update-spec): Add a fallback-version argument. (options->update-specs): Honor target-version option. * tests/guix-refresh.sh: Test it. * doc/guix.texi (Invoking guix refresh): Document it. Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-08-10services: Add pam-mount-volume-service-type.Brian Cully
The `pam-mount-volumes-service-type' adds additional volumes to the pam-mount-service-type in addition to any that are already specified in `pam-mount-rules'. * doc/guix.texi (PAM Mount Volume Service): add documentation for `pam-mount-service-type'. * gnu/services/pam-mount.scm: new file. * Makefile.am: add pam-mount tests * tests/services/pam-mount.scm: new tests Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-07-21services: wireguard: Implement a dynamic IP monitoring feature.Maxim Cournoyer
* gnu/services/vpn.scm (<wireguard-configuration>) [monitor-ips?, monitor-ips-internal]: New fields. * gnu/services/vpn.scm (define-with-source): New syntax. (wireguard-service-name, strip-port/maybe) (ipv4-address?, ipv6-address?, host-name?) (endpoint-host-names): New procedure. (wireguard-monitoring-jobs): Likewise. (wireguard-service-type): Register it. * tests/services/vpn.scm: New file. * Makefile.am (SCM_TESTS): Register it. * doc/guix.texi (VPN Services): Update doc. Reviewed-by: Bruno Victal <mirai@makinata.eu>
2023-07-19import/utils: beautify-description: Wrap class names in @code{...}.Ricardo Wurmus
* guix/import/utils.scm (beautify-description): Add procedure to wrap words in @code{...} markup. * tests/import-utils.scm: Add two tests.
2023-07-18tests: pack: Fix indentation.Maxim Cournoyer
* tests/pack.scm: Fix indentation.
2023-07-18pack: Move common build code to (guix build pack).Maxim Cournoyer
The rationale is to reduce the number of derivations built per pack to ideally one, to minimize storage requirements. The number of derivations had gone up with 68380db4 ("pack: Extract populate-profile-root from self-contained-tarball/builder.") as a side effect to improving code reuse. * guix/scripts/pack.scm (guix): Add commentary comment. (populate-profile-root, self-contained-tarball/builder): Extract to... * guix/build/pack.scm (populate-profile-root): ... this, and... (build-self-contained-tarball): ... that, adjusting for use on the build side. (assert-utf8-locale): New procedure. (self-contained-tarball, debian-archive, rpm-archive): Adjust accordingly. Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-07-18guix: Let texlive importer handle linked scripts.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Also retrieve so-called binfiles. (formats): (linked-scripts): New functions. (tlpdb->package): Use new functions to set #:LINK-SCRIPTS argument and possibly INPUTS. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, single script, no extension"): ("texlive->guix-package, multiple scripts, with extensions"): ("texlive->guix-package, script with associated input"): New tests.
2023-07-18guix: texlive importer: Set #:texlive-latex-bin? when appropriate.Nicolas Goaziou
* guix/import/texlive.scm (latex-bin-dependency-tree): New function. (tlpdb->package): Set #:TEXLIVE-LATEX-BIN? when appropriate. * tests/texlive.scm ("texlive->guix-package, lonely `hyphen-base' dependency and ARCH"): Update test.
2023-07-18guix: texlive importer: Fix build system and arguments for meta-packages.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Meta packages should use trivial build system and an appropriate builder. * tests/texlive.scm ("texlive->guix-package, meta-package"): ("texlive->guix-package, translate dependencies"): Update tests.
2023-07-18guix: texlive importer ignores dependencies unnecessary in Guix.Nicolas Goaziou
* guix/import/texlive.scm (translate-depends): New function. (tlpdb->package): Use new function. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, translate dependencies"): ("texlive->guix-package, lonely `hyphen-base' dependency and ARCH"): New tests.
2023-07-18guix: Let texlive importer suggest format creation.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Store "execute" entries. (tlpdb->package): Add #:CREATE-FORMATS argument when there is an AddFormat execute action. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, with TeX format"): ("texlive->guix-package, execute but no TeX format"): New tests.
2023-07-18guix: import: Improve importing texlive meta packages.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Generate more appropriate source, home page and license fields when importing meta packages, i.e., TeX Live collections and schemes. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, meta-package"): New test.
2023-07-18guix: import: Handle native inputs in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Add TEXLIVE-METAFONT as a native input whenever font metrics are to be generated. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, with METAFONT files"): New test.
2023-07-18guix: import: Fix multiple licenses output in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (string->license): Add missing case and try first to split license strings before giving up. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, multiple licenses"): New test.
2023-07-18guix: import: Improve home-page generation in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Also register `catalogue' key. (tlpdb->package): First try to use catalogue for the home-page, then the name. * tests/texlive.scm (%fake-tlpdb): Add tests data. ("texlive->guix-package, with catalogue entry, no inputs"): New test.
2023-07-18guix: import: Update texlive importer according to new build system.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Generate a package that doesn't need SIMPLE-TEXLIVE-PACKAGE. * guix/import/utils.scm (package->definition): Remove special case for `simple-texlive-package'. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package"): Update test. ("texlive->guix-package, no docfiles"): New test.
2023-07-11home: services: bash: Properly quote shell aliases.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/63048>. Reported by Ekaitz Zarraga <ekaitz@elenq.tech>. * gnu/home/services.scm (with-shell-quotation-bindings): New procedure. (environment-variable-shell-definitions): Use it instead of inline copy. * gnu/home/services/shells.scm (bash-serialize-aliases): Use it. Add clause for 'literal-string?'. * tests/guix-home.sh: Add 'aliases' to 'home-bash-extension' and test it.
2023-06-18Add 'guix locate'.Ludovic Courtès
* guix/scripts/locate.scm, tests/guix-locate.sh: New files. * Makefile.am (MODULES): Add 'guix/scripts/locate.scm'. (SH_TESTS): Add 'tests/guix-locate.sh'. * po/guix/POTFILES.in: Add it. * doc/guix.texi (Invoking guix locate): New node. Co-authored-by: Antoine R. Dumont <antoine.romain.dumont@gmail.com>
2023-06-18store: Tolerate non-existent GC root directories.Ludovic Courtès
* guix/store/roots.scm (gc-roots): Wrap 'scandir*' call in 'catch'. * tests/store-roots.scm ("gc-roots, initial"): New test. Move 'open-connection' call below.
2023-06-14packages: 'package-transitive-supported-systems' detects cycles.Ludovic Courtès
With this change, commands such as 'guix build' or 'guix package' report obvious package-level cycles upfront. Derivation-level cycles are not detected. * guix/packages.scm (&package-cyclic-dependency-error): New condition type. (package-transitive-supported-systems): Define 'visited', check it, and parameterize it. * guix/ui.scm (call-with-error-handling): Handle '&package-cyclic-dependency-error'. * tests/packages.scm ("package-transitive-supported-systems detects cycles"): Add test.
2023-06-09tests: Ensure 'elpa' test does not access the network.Ludovic Courtès
Previously it would try to access the real elpa.gnu.org. This would succeed when network is available because "taxy-magit-section" is an existing package. * guix/import/elpa.scm (elpa-repository) (package-from-elpa-repository?): Recognize 'gnu/http. * tests/elpa.scm ("package-latest-release"): Use 'http' instead of 'https'. Change "taxy-magit-section" to "fake-taxy-magit-section".
2023-06-09tests: Ensure 'cpan' updater test does not access the network.Ludovic Courtès
Previously it would try to access the real metacpan.org. This would succeed when network is available because "Test-Script" is an existing package. * tests/cpan.scm ("package-latest-release"): Wrap 'upstream-source-inputs' call in 'parameterize'. Set 'current-http-proxy'. Change the order of responses in 'with-http-server'.
2023-06-09tests: Adjust minetest tests.Ludovic Courtès
Fixes a regression introduced in e7910f4882d520fcf8920df9ff4ddb00eb9ee41d. * tests/minetest.scm (call-with-packages): Add #:timeout parameter to 'http-fetch' mock.
2023-06-08substitute: Gracefully retry after failed partial downloads.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/63443>. Reported by Attila Lendvai <attila@lendvai.name>. * guix/scripts/substitute.scm (catch-system-error): New macro. (download-nar): Add call to 'delete-file-recursively'. * tests/substitute.scm ("substitute, previous partial download around"): New test.
2023-06-06services: 'modify-services' preserves service ordering.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/63921>. The regression was introduced in dbbc7e946131ba257728f1d05b96c4339b7ee88b, which changed the order of services. As a result, someone using 'modify-services' could find themselves with incorrect ordering of expressions in the "boot" script, whereby the cleanup expressions would come after (execl ".../shepherd"). This, in turn, would lead shepherd to error out at boot with EADDRINUSE on /var/run/shepherd/socket. * gnu/services.scm (%delete-service, %apply-clauses): Remove. (clause-alist): New macro. (apply-clauses): New procedure. (modify-services): Use it. Adjust docstring. * tests/services.scm ("modify-services: do nothing"): Remove 'sort' call. ("modify-services: delete service"): Likewise, and add 't4' service. ("modify-services: change value"): Remove 'sort' call and fix expected value.
2023-06-04tests: records: Add test for ellipsis in body.Josselin Poiret
* tests/records.scm ("match-record, ellipsis in body"): New test.
2023-06-04records: Add MATCH-RECORD-LAMBDA.(unmatched-parenthesis ew syntax
* guix/records.scm (match-record-lambda): New syntax. * tests/records.scm ("match-record-lambda"): New test. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04records: match-record: Support thunked and delayed fields.(unmatched-parenthesis d
* 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>
2023-06-02tests: Check for service existence in MODIFY-SERVICESBrian Cully
* 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>
2023-06-02tests: Add tests for MODIFY-SERVICES procedureBrian Cully
* 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>
2023-05-31tests: Use quasiquoted 'match' patterns for package sexps.Ludovic Courtès
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.
2023-05-31upstream: Honor package properties for ignored and extra inputs.Ludovic Courtès
* 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.
2023-05-31import: gem: Updater provides input list.Ludovic Courtès
* guix/import/gem.scm (import-release): Add 'inputs' field. * tests/gem.scm ("package-latest-release"): New test.
2023-05-31import: gem: Factorize "bundler" special case for name mapping.Ludovic Courtès
* 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.
2023-05-31import: elpa: Updater provides input list.Ludovic Courtès
* guix/import/elpa.scm (elpa-dependency->upstream-input): New procedure. (latest-release): Add 'inputs' field. * tests/elpa.scm ("package-latest-release"): New test.
2023-05-31import: cpan: Updater provides input list.Ludovic Courtès
* guix/import/cpan.scm (latest-release): Add 'inputs' field. * tests/cpan.scm ("package-latest-release"): New test.
2023-05-31import: cpan: Represent dependencies as <upstream-input> records.Ludovic Courtès
* 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.
2023-05-31tests: upstream: Restore test that was skipped.Ludovic Courtès
This test was being skipped since ea6fb108f6a3a53d48ea187b1f82b5f7ffce00a7. * tests/upstream.scm ("coalesce-sources same version"): Compare a serialized form of <upstream-source>.