* [PATCH 10/10] t/lei: add more diagnostics for failures
2021-03-25 4:20 7% [PATCH 00/10] lei testing improvements Eric Wong
@ 2021-03-25 4:20 6% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-25 4:20 UTC (permalink / raw)
To: meta
This seems to error out while looping the test suite and
I'm not 100% sure why.
---
t/lei-import-maildir.t | 13 +++++++++----
t/lei-q-thread.t | 15 ++++++++-------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/t/lei-import-maildir.t b/t/lei-import-maildir.t
index bd89677a..6706b014 100644
--- a/t/lei-import-maildir.t
+++ b/t/lei-import-maildir.t
@@ -11,17 +11,20 @@ test_lei(sub {
symlink(abs_path('t/data/0001.patch'), "$md/cur/x:2,S") or
BAIL_OUT "symlink $md $!";
lei_ok(qw(import), $md, \'import Maildir');
+ my $imp_err = $lei_err;
lei_ok(qw(q s:boolean));
my $res = json_utf8->decode($lei_out);
- like($res->[0]->{'s'}, qr/use boolean/, 'got expected result');
+ like($res->[0]->{'s'}, qr/use boolean/, 'got expected result')
+ or diag explain($imp_err, $res);
is_deeply($res->[0]->{kw}, ['seen'], 'keyword set');
is($res->[1], undef, 'only got one result');
lei_ok(qw(import), $md, \'import Maildir again');
+ $imp_err = $lei_err;
lei_ok(qw(q -d none s:boolean), \'lei q w/o dedupe');
my $r2 = json_utf8->decode($lei_out);
- is_deeply($r2, $res, 'idempotent import');
-
+ is_deeply($r2, $res, 'idempotent import')
+ or diag explain($imp_err, $res);
rename("$md/cur/x:2,S", "$md/cur/x:2,SR") or BAIL_OUT "rename: $!";
lei_ok('import', "maildir:$md", \'import Maildir after +answered');
lei_ok(qw(q -d none s:boolean), \'lei q after +answered');
@@ -33,8 +36,10 @@ test_lei(sub {
symlink(abs_path('t/utf8.eml'), "$md/cur/u:2,ST") or
BAIL_OUT "symlink $md $!";
lei_ok('import', "maildir:$md", \'import Maildir w/ trashed message');
+ $imp_err = $lei_err;
lei_ok(qw(q -d none m:testmessage@example.com));
$res = json_utf8->decode($lei_out);
- is_deeply($res, [ undef ], 'trashed message not imported');
+ is_deeply($res, [ undef ], 'trashed message not imported')
+ or diag explain($imp_err, $res);
});
done_testing;
diff --git a/t/lei-q-thread.t b/t/lei-q-thread.t
index c999d12b..26d06eec 100644
--- a/t/lei-q-thread.t
+++ b/t/lei-q-thread.t
@@ -13,7 +13,8 @@ test_lei(sub {
lei_ok qw(q -t m:testmessage@example.com);
my $res = json_utf8->decode($lei_out);
- is_deeply($res->[0]->{kw}, [ 'seen' ], 'q -t sets keywords');
+ is_deeply($res->[0]->{kw}, [ 'seen' ], 'q -t sets keywords') or
+ diag explain($res);
$eml = eml_load('t/utf8.eml');
$eml->header_set('References', $eml->header('Message-ID'));
@@ -28,9 +29,9 @@ test_lei(sub {
pop @$res;
my %m = map { $_->{'m'} => $_ } @$res;
is_deeply($m{'testmessage@example.com'}->{kw}, ['seen'],
- 'flag set in direct hit');
- 'TODO' or is_deeply($m{'a-reply@miss'}->{kw}, ['draft'],
- 'flag set in thread hit');
+ 'flag set in direct hit') or diag explain($res);
+ is_deeply($m{'a-reply@miss'}->{kw}, ['draft'],
+ 'flag set in thread hit') or diag explain($res);
lei_ok qw(q -t -t m:testmessage@example.com);
$res = json_utf8->decode($lei_out);
@@ -38,9 +39,9 @@ test_lei(sub {
pop @$res;
%m = map { $_->{'m'} => $_ } @$res;
is_deeply($m{'testmessage@example.com'}->{kw}, ['flagged', 'seen'],
- 'flagged set in direct hit');
- 'TODO' or is_deeply($m{'testmessage@example.com'}->{kw}, ['draft'],
- 'flagged set in direct hit');
+ 'flagged set in direct hit') or diag explain($res);
+ is_deeply($m{'a-reply@miss'}->{kw}, ['draft'],
+ 'set in thread hit') or diag explain($res);
lei_ok qw(q -tt m:testmessage@example.com --only), "$ro_home/t2";
$res = json_utf8->decode($lei_out);
is_deeply($res->[0]->{kw}, [ qw(flagged seen) ],
^ permalink raw reply related [relevance 6%]
* [PATCH 00/10] lei testing improvements
@ 2021-03-25 4:20 7% Eric Wong
2021-03-25 4:20 6% ` [PATCH 10/10] t/lei: add more diagnostics for failures Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-03-25 4:20 UTC (permalink / raw)
To: meta
[7/10] is the centerpiece and gives a ~10% speedup for tests,
which are still slow to me. Speedup or not, it's uncovered a
bunch of subtle bugs over the past few days so I'm glad I
worked on it.
There's still some rare errors that come from looping
"make check-run TEST_LEI_ERR_LOUD" which I'm still trying
to figure out...
Eric Wong (10):
test_common: cleanup inbox objects after use
lei: janky $PATH2CFG garbage collection
test_common: TEST_LEI_ERR_LOUD does not hide path names
lei add-external: do not initialize writable store
lei_mirror: don't show success on failure
t/*: drop unnecessary v1-specific index calls
tests: "check-run" uses persistent lei daemon
lei import: force store, improve test diagnostics
t/cmd_ipc: workaround signal handling raciness
t/lei: add more diagnostics for failures
lib/PublicInbox/LEI.pm | 6 +++++
lib/PublicInbox/LeiExternal.pm | 2 --
lib/PublicInbox/LeiImport.pm | 6 ++---
lib/PublicInbox/LeiMirror.pm | 11 ++++++---
lib/PublicInbox/TestCommon.pm | 41 +++++++++++++++++++++++-----------
t/cmd_ipc.t | 28 ++++++++++++++++-------
t/inbox_idle.t | 2 --
t/lei-externals.t | 7 ++++--
t/lei-import-maildir.t | 13 +++++++----
t/lei-mark.t | 2 +-
t/lei-mirror.t | 18 +++++++++++++++
t/lei-q-kw.t | 6 ++---
t/lei-q-thread.t | 15 +++++++------
t/nntpd.t | 4 ----
t/run.perl | 19 ++++++++++++++++
t/v2mda.t | 4 ----
t/watch_filter_rubylang.t | 7 ++----
17 files changed, 130 insertions(+), 61 deletions(-)
^ permalink raw reply [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-25 4:20 7% [PATCH 00/10] lei testing improvements Eric Wong
2021-03-25 4:20 6% ` [PATCH 10/10] t/lei: add more diagnostics for failures Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).