mbox series

[bug#60520,0/4] Tests for 'guix refresh'

Message ID 20230103164439.16477-1-ludo@gnu.org
Headers show
Series Tests for 'guix refresh' | expand

Message

Ludovic Courtès Jan. 3, 2023, 4:44 p.m. UTC
Hi!

Following the discussion at
<https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00311.html>,
I thought it’s about time to have tests for the ‘guix refresh’ CLI
(so far we had tests for importers, for (guix gnu-maintenance), and
for (guix upstream), but that did not cover the logic in ‘guix refresh’
itself as we’ve seen).

The strategy is to define a “pseudo updater”: the test defines an
environment variable that specifies which package updates the updater
should simulate, and then we go on using ‘guix refresh’.

Thoughts?

Ludo’.

Ludovic Courtès (4):
  gnu-maintenance: Factorize 'false-if-networking-failure'.
  gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking
    errors.
  import: stackage: Catch networking errors in predicate.
  refresh: Add CLI tests.

 Makefile.am              |   4 +-
 guix/gnu-maintenance.scm |  31 ++++-------
 guix/import/stackage.scm |  15 ++---
 guix/import/test.scm     |  88 +++++++++++++++++++++++++++++
 guix/import/utils.scm    |  24 +++++++-
 tests/guix-refresh.sh    | 117 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 251 insertions(+), 28 deletions(-)
 create mode 100644 guix/import/test.scm
 create mode 100644 tests/guix-refresh.sh


base-commit: 473692b812b4ab4267d9bddad0fb27787d2112ff

Comments

Hartmut Goebel Jan. 3, 2023, 6:51 p.m. UTC | #1
Am 03.01.23 um 17:44 schrieb Ludovic Courtès:
> Thoughts?

Thanks for implementing this,  It was terribly missing.

Two mini remarks:

+IFS=X

What about using a symbol like underscore?

+ "guileX-r" \

For symetry I'd write "-r guile".
Ludovic Courtès Jan. 8, 2023, 3:16 p.m. UTC | #2
Hi,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> Two mini remarks:
>
> +IFS=X
>
> What about using a symbol like underscore?
>
> + "guileX-r" \
>
> For symetry I'd write "-r guile".

Good ideas.  I made those changes and pushed:

  04f247be81 * refresh: Add CLI tests.
  2e9c0e1ff6 * import: stackage: Catch networking errors in predicate.
  472dd29f37 * gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.
  f3edf29c67 * gnu-maintenance: Factorize 'false-if-networking-failure'.

Thanks,
Ludo’.