Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwkmx-0001zW-JR for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Feb 2019 09:37:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gwkmw-00062f-7n for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Feb 2019 09:37:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwkmw-00062N-0T for pgsql-hackers@lists.postgresql.org; Thu, 21 Feb 2019 09:37:06 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwkmt-0002QA-I4 for pgsql-hackers@lists.postgresql.org; Thu, 21 Feb 2019 09:37:05 +0000 Received: from msg.df7cb.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 444qB656xCz3F1k; Thu, 21 Feb 2019 10:37:02 +0100 (CET) Date: Thu, 21 Feb 2019 10:37:02 +0100 From: Christoph Berg To: Tom Lane Cc: Alvaro Herrera , Peter Eisentraut , Daniel Gustafsson , pgsql-hackers@lists.postgresql.org Subject: Re: Reporting script runtimes in pg_regress Message-ID: <20190221093702.GA5238@msg.df7cb.de> References: <20190218143028.GA3700@alvherre.pgsql> <28360.1550506699@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <28360.1550506699@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --tKW2IUtsqtDRztdT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Align-timestamps-in-pg_regress-output.patch" From 3acba7cc50f4711abedfb61cd06b1f8e640caac5 Mon Sep 17 00:00:00 2001 From: Christoph Berg 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 --tKW2IUtsqtDRztdT--