From c29624bf7d58aeb698ddd12b983465d355fccf79 Mon Sep 17 00:00:00 2001
From: regnat <rg@regnat.ovh>
Date: Wed, 16 Sep 2020 13:52:15 +0200
Subject: [PATCH] Add a test for `nix describe-stores`

Doesn't test much, but at least ensures that the command runs properly
---
 tests/describe-stores.sh | 8 ++++++++
 tests/local.mk           | 1 +
 2 files changed, 9 insertions(+)
 create mode 100644 tests/describe-stores.sh

diff --git a/tests/describe-stores.sh b/tests/describe-stores.sh
new file mode 100644
index 000000000..3fea61483
--- /dev/null
+++ b/tests/describe-stores.sh
@@ -0,0 +1,8 @@
+source common.sh
+
+# Query an arbitrary value in `nix describe-stores --json`'s output just to
+# check that it has the right structure
+[[ $(nix --experimental-features 'nix-command flakes' describe-stores --json | jq '.["SSH Store"]["compress"]["defaultValue"]') == false ]]
+
+# Ensure that the output of `nix describe-stores` isn't empty
+[[ -n $(nix --experimental-features 'nix-command flakes' describe-stores) ]]
diff --git a/tests/local.mk b/tests/local.mk
index 5d25de019..594901504 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -32,6 +32,7 @@ nix_tests = \
   post-hook.sh \
   function-trace.sh \
   recursive.sh \
+  describe-stores.sh \
   flakes.sh \
   content-addressed.sh
   # parallel.sh
-- 
GitLab