* [PATCH] tests/qtest/qom-test: Do not print tested properties by default
@ 2022-12-15 14:01 Thomas Huth
2022-12-15 14:04 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2022-12-15 14:01 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Laurent Vivier
We're still running into the problem that some logs are cut in the
gitlab-CI since they got too big. The biggest part of the log is
still the output of the qom-test. Let's stop printing the properties
by default to get to a saner size here. The full output can still
be enabled by setting V=2 (or higher) in the environment.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/qom-test.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index 13510bc349..a0e5672cb3 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -14,6 +14,8 @@
#include "qemu/cutils.h"
#include "libqtest.h"
+static bool verbose;
+
static void test_properties(QTestState *qts, const char *path, bool recurse)
{
char *child_path;
@@ -49,7 +51,9 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
}
} else {
const char *prop = qdict_get_str(tuple, "name");
- g_test_message("-> %s", prop);
+ if (verbose) {
+ g_test_message("-> %s", prop);
+ }
tmp = qtest_qmp(qts,
"{ 'execute': 'qom-get',"
" 'arguments': { 'path': %s, 'property': %s } }",
@@ -103,6 +107,12 @@ static void add_machine_test_case(const char *mname)
int main(int argc, char **argv)
{
+ char *v_env = getenv("V");
+
+ if (v_env && *v_env >= '2') {
+ verbose = true;
+ }
+
g_test_init(&argc, &argv, NULL);
qtest_cb_for_every_machine(add_machine_test_case, g_test_quick());
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/qtest/qom-test: Do not print tested properties by default
2022-12-15 14:01 [PATCH] tests/qtest/qom-test: Do not print tested properties by default Thomas Huth
@ 2022-12-15 14:04 ` Peter Maydell
2022-12-15 14:12 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2022-12-15 14:04 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Paolo Bonzini, Laurent Vivier
On Thu, 15 Dec 2022 at 14:01, Thomas Huth <thuth@redhat.com> wrote:
>
> We're still running into the problem that some logs are cut in the
> gitlab-CI since they got too big. The biggest part of the log is
> still the output of the qom-test. Let's stop printing the properties
> by default to get to a saner size here. The full output can still
> be enabled by setting V=2 (or higher) in the environment.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> @@ -103,6 +107,12 @@ static void add_machine_test_case(const char *mname)
>
> int main(int argc, char **argv)
> {
> + char *v_env = getenv("V");
> +
> + if (v_env && *v_env >= '2') {
> + verbose = true;
> + }
This is a bit cheesy -- I think we should parse the string
to a number properly rather than accepting '2', '23',
'2.89237', '2e45' '2fast2furious' etc :-)
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/qtest/qom-test: Do not print tested properties by default
2022-12-15 14:04 ` Peter Maydell
@ 2022-12-15 14:12 ` Thomas Huth
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2022-12-15 14:12 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, Paolo Bonzini, Laurent Vivier
On 15/12/2022 15.04, Peter Maydell wrote:
> On Thu, 15 Dec 2022 at 14:01, Thomas Huth <thuth@redhat.com> wrote:
>>
>> We're still running into the problem that some logs are cut in the
>> gitlab-CI since they got too big. The biggest part of the log is
>> still the output of the qom-test. Let's stop printing the properties
>> by default to get to a saner size here. The full output can still
>> be enabled by setting V=2 (or higher) in the environment.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>
>> @@ -103,6 +107,12 @@ static void add_machine_test_case(const char *mname)
>>
>> int main(int argc, char **argv)
>> {
>> + char *v_env = getenv("V");
>> +
>> + if (v_env && *v_env >= '2') {
>> + verbose = true;
>> + }
>
> This is a bit cheesy -- I think we should parse the string
> to a number properly rather than accepting '2', '23',
> '2.89237', '2e45' '2fast2furious' etc :-)
Ok, true, it's a little bit weird that it's verbose for V=9 but not for V=10
... I'll rework the patch and send a patch for hmp-test.c, too (where I've
copied the code from).
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-15 14:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15 14:01 [PATCH] tests/qtest/qom-test: Do not print tested properties by default Thomas Huth
2022-12-15 14:04 ` Peter Maydell
2022-12-15 14:12 ` Thomas Huth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).