* [PATCH] tests: Avoid printing the entire test database
@ 2026-10-26 20:16 Valters Jansons
2026-10-27 10:59 ` Michael Tremer
0 siblings, 1 reply; 2+ messages in thread
From: Valters Jansons @ 2026-10-26 20:16 UTC (permalink / raw)
To: location
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-27 10:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 20:16 [PATCH] tests: Avoid printing the entire test database Valters Jansons
2026-10-27 10:59 ` Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox