pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <myon@debian.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Reporting script runtimes in pg_regress
Date: Thu, 21 Feb 2019 10:37:02 +0100
Message-ID: <20190221093702.GA5238@msg.df7cb.de> (raw)
In-Reply-To: <28360.1550506699@sss.pgh.pa.us>
References: <20190218143028.GA3700@alvherre.pgsql>
	<28360.1550506699@sss.pgh.pa.us>

Re: Tom Lane 2019-02-18 <28360.1550506699@sss.pgh.pa.us>
> >>> We should also strive to align "FAILED" properly.
> 
> >> Yeah, not strictly required, but someone might want to play around with
> >> it a bit.
> 
> > FWIW I don't think we localize pg_regress output currently, so that
> > argument seems moot ... But I think we can get away with constant four
> > spaces for now.
> 
> I pushed Peter's suggestion for %8.0f; let's live with that for a little
> and see if it's still annoying.

The ryu changes make postgresql-unit fail quite loudly:

$ cat regression.out
test extension                    ... ok      359 ms
test tables                       ... FAILED      164 ms
test unit                         ... FAILED      867 ms
test binary                       ... ok       20 ms
test unicode                      ... ok       18 ms
test prefix                       ... FAILED       43 ms
test units                        ... FAILED      207 ms
test time                         ... FAILED       99 ms
test temperature                  ... FAILED       22 ms
...

The misalignment annoyed me enough (especially the false alignment
between "ms" on the first row and "164" on the next row) to look into
it. Aligned it looks like this:

test extension                    ... ok          399 ms
test tables                       ... FAILED      190 ms
test unit                         ... FAILED      569 ms
test binary                       ... ok           14 ms
test unicode                      ... ok           15 ms
test prefix                       ... FAILED       44 ms
test units                        ... FAILED      208 ms
test time                         ... FAILED       99 ms
test temperature                  ... FAILED       21 ms
...

It doesn't break translations because it prints the extra spaces
separately.

In run_single_test() (which this output is from), it simply aligns the
output with FAILED. In run_schedule(), there is the 3rd output string
"failed (ignored)" which is considerably longer. I aligned the output
with that, but also made the timestamp field shorter so it's not too
much to the right.

Christoph

Attachments:

0001-Align-timestamps-in-pg_regress-output.patch (text/x-diff, 1.3K) download From 3acba7cc50f4711abedfb61cd06b1f8e640caac5 Mon Sep 17 00:00:00 2001 From: Christoph Berg <christoph.berg@credativ.de> Date: Thu, 21 Feb 2019 10:35:19 +0100 Subject: [PATCH] Align timestamps in pg_regress output --- src/test/regress/pg_regress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index a18a6f6c45..8080626e94 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1794,12 +1794,14 @@ run_schedule(const char *schedule, test_function tfunc) else { status(_("FAILED")); + status(" "); /* align with failed (ignored) */ fail_count++; } } else { status(_("ok")); + status(" "); /* align with failed (ignored) */ success_count++; } @@ -1807,7 +1809,7 @@ run_schedule(const char *schedule, test_function tfunc) log_child_failure(statuses[i]); INSTR_TIME_SUBTRACT(stoptimes[i], starttimes[i]); - status(_(" %8.0f ms"), INSTR_TIME_GET_MILLISEC(stoptimes[i])); + status(_(" %5.0f ms"), INSTR_TIME_GET_MILLISEC(stoptimes[i])); status_end(); } @@ -1880,6 +1882,7 @@ run_single_test(const char *test, test_function tfunc) else { status(_("ok")); + status(" "); /* align with FAILED */ success_count++; } -- 2.20.1

view thread (25+ messages)  latest in thread

Message-ID: <20190221093702.GA5238@msg.df7cb.de>
Permalink:  ../20190221093702.GA5238@msg.df7cb.de/
Also on:    postgresql.org/message-id/20190221093702.GA5238@msg.df7cb.de

 ·  · 

reply

Reply instructions:

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

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: myon@debian.org, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, daniel@yesql.se, pgsql-hackers@lists.postgresql.org
  Subject: Re: Reporting script runtimes in pg_regress
  In-Reply-To: <20190221093702.GA5238@msg.df7cb.de>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox