public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
From: Valters Jansons <valter.jansons@gmail.com>
To: location@lists.ipfire.org
Subject: [PATCH] tests: Avoid printing the entire test database
Date: Tue, 27 Oct 2026 05:16:37 +0900	[thread overview]
Message-ID: <20261026201637.574025-1-valter.jansons@gmail.com> (raw)

Lua tests currently iterate the database, and dump all of its contents
into the runner's log. This might be beneficial in testing, however it
does not necessarily help during regular builds.

This commit retains the reverse_pointer() invocation, but instead of
printing simply counts the number of entries and asserts at at least
something existed.
---
 tests/lua/main.lua.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/lua/main.lua.in b/tests/lua/main.lua.in
index c947334..290e832 100755
--- a/tests/lua/main.lua.in
+++ b/tests/lua/main.lua.in
@@ -219,9 +219,14 @@ function test_list_networks()
 	db = location.Database.open(ENV_TEST_DATABASE)
 	luaunit.assertNotNil(db)
 
+	local count = 0
+
 	for network in db:list_networks() do
-		print(network, network:reverse_pointer())
+		network:reverse_pointer()
+		count = count + 1
 	end
+
+	luaunit.assertTrue(count > 0)
 end
 
 os.exit(luaunit.LuaUnit.run())
-- 
2.56.0



                 reply	other threads:[~2026-10-26 20:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026201637.574025-1-valter.jansons@gmail.com \
    --to=valter.jansons@gmail.com \
    --cc=location@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox