diff --git a/t/03-count.t b/t/03-count.t index 2f9d4207fb775a2d41b755ae265662b8bdd1cc72..864e8aff4a96cbfe54900e342b73402312d5415f 100644 --- a/t/03-count.t +++ b/t/03-count.t @@ -1,6 +1,6 @@ use v5.36; use Test::Cmd; -use Test::More tests =>27; +use Test::More tests =>30; use Path::Tiny; my $perl = $^X; my $testapp = Test::Cmd->new( @@ -97,5 +97,12 @@ like($testapp->stdout, qr/^25$/, 'ta-tool count dates, existing, stdout'); like($testapp->stderr, qr/^$/, 'ta-tool count dates, existing, stderr'); is($? >> 8, 0, 'ta-tool count dates, existing, exit status'); +note "overrides"; +$testapp->run(args =>'count --elasticsearch-host localhost --creationdate 2023-09-05...2023-12-22'); +#say "STDOUT:",$testapp->stdout; +#say "STDERR:",$testapp->stderr; +like($testapp->stdout, qr/^$/, 'ta-tool count dates, existing, override, stdout'); +like($testapp->stderr, qr/^Hint: override local config with/, 'ta-tool count dates, existing, override, stderr'); +is($? >> 8, 111, 'ta-tool count dates, existing, override, exit status'); 1; diff --git a/t/03-info.t b/t/03-info.t index 6aa02612ed329518b5d111e63a71c2016cca0888..08ebf16f6b1a74e743723a3ab92de41076c4ff8c 100644 --- a/t/03-info.t +++ b/t/03-info.t @@ -27,7 +27,6 @@ password: 839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f9 user: lza _CFG_ # tests - note "help check"; foreach my $param ("help info", "info -h", "info --help") { $testapp->run(args => $param); @@ -44,12 +43,13 @@ like($testapp->stdout, qr/^6\.\d\.\d{1,2}$/, 'ta-tool elasticsearch version, std like($testapp->stderr, qr/^$/, 'ta-tool elasticsearch version, stderr'); is($? >> 8, 0, 'ta-tool elasticsearch version, exit status'); +note "overrides"; $testapp->run(args =>'info --elasticsearch-host localhost --target-version'); #say "STDOUT:",$testapp->stdout; #say "STDERR:",$testapp->stderr; -like($testapp->stdout, qr/^$/, 'ta-tool elasticsearch version, stdout'); -like($testapp->stderr, qr/^Hint: override local config/, 'ta-tool elasticsearch version, stderr'); -is($? >> 8, 111, 'ta-tool elasticsearch version, exit status'); +like($testapp->stdout, qr/^$/, 'ta-tool elasticsearch version, override, stdout'); +like($testapp->stderr, qr/^Hint: override local config/, 'ta-tool elasticsearch version, override, stderr'); +is($? >> 8, 111, 'ta-tool elasticsearch version, override, exit status'); 1; diff --git a/t/03-report.t b/t/03-report.t index f427e871dba3b68b97a148b0749abb5396a25395..62f33f523e0b19d4181725306b3faf539224b2c3 100644 --- a/t/03-report.t +++ b/t/03-report.t @@ -1,7 +1,6 @@ - use v5.36; use Test::Cmd; -use Test::More tests =>15; +use Test::More tests =>18; use Path::Tiny; my $perl = $^X; my $testapp = Test::Cmd->new( @@ -52,3 +51,11 @@ $testapp->run(args =>'report --output-as-csv'); like($testapp->stdout, qr/^"set","subset","aip_state","flavour","value"\n"([a-z]+)",,"([a-z]+)","([a-z]+)",\d+(\.\d+)?\n/s, 'ta-tool report, base, stdout'); like($testapp->stderr, qr/^reporting for period/s, 'ta-tool report, base, stderr'); is($? >> 8, 0, 'ta-tool report, base, exit status'); + +note "overrides"; +$testapp->run(args =>'report --elasticsearch-host localhost'); +#say "STDOUT:",$testapp->stdout; +#say "STDERR:",$testapp->stderr; +like($testapp->stdout, qr/^$/s, 'ta-tool report, base, stdout'); +like($testapp->stderr, qr/^Hint: override local config with/s, 'ta-tool report, base, stderr'); +is($? >> 8, 111, 'ta-tool report, base, exit status'); diff --git a/t/03-search.t b/t/03-search.t index 2c31d00642814a2c858c39ddf88da555892a7f61..a2c88a22c9f23f1395e6861238866a67dcb3a7fe 100644 --- a/t/03-search.t +++ b/t/03-search.t @@ -1,6 +1,6 @@ use v5.36; use Test::Cmd; -use Test::More tests =>108; +use Test::More tests =>111; use Path::Tiny; my $perl = $^X; my $testapp = Test::Cmd->new( @@ -173,4 +173,12 @@ like($testapp->stdout, qr/\A"aipid"\n"47daf26a-02a1-4776-a8db-de04c6708bd2"\n/s, like($testapp->stderr, qr/\Afound 25 results\nreporting results 1 … 10 output as csv/s, 'ta-tool search dates, existing, stderr'); is($? >> 8, 0, 'ta-tool search dates, existing, exit status'); +note "overrides"; +$testapp->run(args =>'search --elasticsearch-host localhost --creationdate 2023-09-05...2023-12-22'); +#say "STDOUT:",$testapp->stdout; +#say "STDERR:",$testapp->stderr; +like($testapp->stdout, qr/^$/s, 'ta-tool search dates, existing, override, stdout'); +like($testapp->stderr, qr/^Hint: override local config with/s, 'ta-tool search dates, existing, override stderr'); +is($? >> 8, 111, 'ta-tool search dates, existing, override, exit status'); + 1;