about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-25 06:20:21 +0200
committerEric Wong <e@80x24.org>2021-03-25 17:58:59 +0000
commit700f2675366ce6cf2cd39a00b5742ba6fea753e9 (patch)
treeb61ee92e0ce7b42026dea97b08f64bf07b5df98a /t
parenta3e3a5f5f34f258744938e60639c0b4d7a362f60 (diff)
downloadpublic-inbox-700f2675366ce6cf2cd39a00b5742ba6fea753e9.tar.gz
While we were exiting with a error code, showing a successful
"# mirrored $URL" message is misleading and wrong.  Don't show
success until everything is complete and the config is written.
Diffstat (limited to 't')
-rw-r--r--t/lei-mirror.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/lei-mirror.t b/t/lei-mirror.t
index 9769f31b..6039e568 100644
--- a/t/lei-mirror.t
+++ b/t/lei-mirror.t
@@ -41,6 +41,24 @@ test_lei({ tmpdir => $tmpdir }, sub {
         ok(!-d "$t2-fail", 'destination not created on failure');
         lei_ok('ls-external');
         unlike($lei_out, qr!\Q$t2-fail\E!, 'not added to ls-external');
+
+        my %phail = (
+                HTTPS => 'https://public-inbox.org/' . 'phail',
+                ONION => 'http://ou63pmih66umazou.onion/' . 'phail,'
+        );
+        for my $t (qw(HTTPS ONION)) {
+        SKIP: {
+                my $k = "TEST_LEI_EXTERNAL_$t";
+                $ENV{$k} or skip "$k unset", 1;
+                my $url = $phail{$t};
+                my $dir = "phail-$t";
+                ok(!lei(qw(add-external -Lmedium --mirror),
+                        $url, $dir), '--mirror non-existent v2');
+                is($? >> 8, 22, 'curl 404');
+                ok(!-d $dir, 'directory not created');
+                unlike($lei_err, qr/# mirrored/, 'no success message');
+        } # SKIP
+        } # for
 });
 
 ok($td->kill, 'killed -httpd');