[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/20: squash! Update test.
From: |
guix-commits |
Subject: |
03/20: squash! Update test. |
Date: |
Sun, 4 Jun 2023 17:34:40 -0400 (EDT) |
civodul pushed a commit to branch wip-guix-index
in repository guix.
commit dc18cbacd83a3c9962effcdcde626a323460af3e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Apr 2 18:02:24 2023 +0200
squash! Update test.
Test now runs fine.
---
tests/guix-index.sh | 70 ++++++++++++++++++++++++++---------------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/tests/guix-index.sh b/tests/guix-index.sh
index 2c21d45a6b..8e77e53371 100755
--- a/tests/guix-index.sh
+++ b/tests/guix-index.sh
@@ -1,5 +1,6 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2013, 2014, 2015, 2019, 2020, 2023 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2023 Antoine R. Dumont <antoine.romain.dumont@gmail.com>
+# Copyright © 2023 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -22,52 +23,51 @@
set -x
-tmpdir="guix-index-$$"
-trap 'rm -rf "$tmpdir"' EXIT
-
-guix index --version
-
-# Basic application to install and lookup through the index subcommand
-APPLICATION=guile-bootstrap
-
-# The subcommand exposes two indexation methods so far:
-# - manifests: fast and less exhaustive
-# - store: slow, exhaustive
+RUN_EXPENSIVE_TESTS="${RUN_EXPENSIVE_TESTS:-false}"
-# In the following tests, we will store in 2 different dbs for both indexation
-# methods
+tmpdir="guix-index-$$"
+# In the following tests, we use two different databases, one for each
+# indexation method.
tmpdb_manifests="$tmpdir/manifests/db.sqlite"
tmpdb_store="$tmpdir/store/db.sqlite"
+trap 'rm -rf "$tmpdir" "$tmpdb_store" "$tmpdb_manifests"' EXIT
+
+guix index --version
-echo "### Preparing db locations for both indexation methods"
-mkdir -p `dirname $tmpdb_manifests` `dirname $tmpdb_store`
+# Preparing db locations for both indexation methods.
+mkdir -p "$(dirname "$tmpdb_manifests")" "$(dirname "$tmpdb_store")"
cmd_manifests="guix index --db-path=$tmpdb_manifests --method=manifests"
cmd_store="guix index --db-path=$tmpdb_store --method=store"
-echo "### Lookup without any db should fail"
-! $cmd_manifests search "$APPLICATION"
-! $cmd_store search "$APPLICATION"
+# Lookup without any db should fail.
+! guix index --db-path="$tmpdb_manifests" search guile
+! guix index --db-path="$tmpdb_store" search guile
-echo "### Initializing db with bare guix store should work"
+# Initializing db with bare store should work.
$cmd_manifests
-# ! $cmd_store
-echo "### lookup without anything in db should yield no result"
-! test `$cmd_manifests search "$APPLICATION"`
-# ! test `$cmd_store search "$APPLICATION"`
+# Lookup without anything in db should yield no results because the indexer
+# didn't stumble upon any profile.
+test -z "$(guix index --db-path="$tmpdb_manifests" search guile)"
-echo "### Add some package to the temporary store"
-guix package --bootstrap \
- --install $APPLICATION \
- --profile=$tmpdir/profile
+# Install a package.
+guix package --bootstrap --install guile-bootstrap \
+ --profile="$tmpdir/profile"
-echo "### Both both indexation call should work"
+# Both indexation call should work.
# Testing indexation should work for both method
-test `$cmd_manifests`
-# test `$cmd_store`
-
-echo "### lookup indexed '$APPLICATION' should yield result"
+$cmd_manifests
-test `$cmd_manifests search "$APPLICATION"`
-# test `$cmd_store search "$APPLICATION"`
+# Look for 'guile'.
+$cmd_manifests search guile
+$cmd_manifests search guile | grep $(guix build guile-bootstrap)/bin/guile
+$cmd_manifests search boot-9.scm | grep ^guile-bootstrap
+
+if $RUN_EXPENSIVE_TESTS
+then
+ $cmd_store
+ $cmd_store search guile
+ $cmd_store search guile | grep $(guix build guile-bootstrap)/bin/guile
+ $cmd_store search boot-9.scm | grep ^guile-bootstrap
+fi
- branch wip-guix-index created (now 861a4e42e7), guix-commits, 2023/06/04
- 04/20: squash! "--db-path" -> "--database"., guix-commits, 2023/06/04
- 07/20: squash! Don't insert directory if it's already present., guix-commits, 2023/06/04
- 08/20: squash! Remove debugging statements., guix-commits, 2023/06/04
- 12/20: squash! Add one variant of each package (name/version pair)., guix-commits, 2023/06/04
- 13/20: squash! Create database when it doesn't already exist., guix-commits, 2023/06/04
- 16/20: squash! Simplify '--help'., guix-commits, 2023/06/04
- 18/20: squash! Optimize 'insert-package'., guix-commits, 2023/06/04
- 19/20: squash! Show output name except for "out"; remove '-d'., guix-commits, 2023/06/04
- 02/20: DRAFT Add 'guix index'., guix-commits, 2023/06/04
- 03/20: squash! Update test.,
guix-commits <=
- 05/20: squash! Improve error reporting and i18n., guix-commits, 2023/06/04
- 01/20: store: Tolerate non-existent GC root directories., guix-commits, 2023/06/04
- 06/20: squash! "with-method" -> "method", guix-commits, 2023/06/04
- 09/20: squash! Choose system-wide database if it's more recent., guix-commits, 2023/06/04
- 11/20: squash! Keep store prefix in database., guix-commits, 2023/06/04
- 15/20: squash! Rename to 'guix locate'., guix-commits, 2023/06/04
- 17/20: squash! Migrate schema when opening., guix-commits, 2023/06/04
- 20/20: squash! Document., guix-commits, 2023/06/04
- 10/20: squash! Do not insert the same directory more than once., guix-commits, 2023/06/04
- 14/20: squash! Remove actions; auto-update database when needed., guix-commits, 2023/06/04