Skip to content

Commit

Permalink
Simplify TAP test structure to align with upstream (#169)
Browse files Browse the repository at this point in the history
postgres/postgres@549ec20 moved to using "done_testing()" from
the Perl testing framework, which removed the need to include test
counts.
  • Loading branch information
jkatz authored Jun 29, 2023
1 parent 7aaba14 commit de6502a
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion test/t/001_wal.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 31;
use Test::More;

my $dim = 32;

Expand Down Expand Up @@ -95,3 +95,5 @@ sub test_index_replay
);
test_index_replay("insert $i");
}

done_testing();
4 changes: 3 additions & 1 deletion test/t/002_vacuum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 1;
use Test::More;

my $dim = 3;

Expand Down Expand Up @@ -39,3 +39,5 @@
# Check size
my $new_size = $node->safe_psql("postgres", "SELECT pg_total_relation_size('tst_v_idx');");
is($size, $new_size, "size does not change");

done_testing();
4 changes: 3 additions & 1 deletion test/t/003_recall.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 14;
use Test::More;

my $node;
my @queries = ();
Expand Down Expand Up @@ -97,3 +97,5 @@ sub test_recall
# Account for equal distances
test_recall(100, 0.9975, $operator);
}

done_testing();
4 changes: 3 additions & 1 deletion test/t/004_centers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 3;
use Test::More;

# Initialize node
my $node = get_new_node('node');
Expand Down Expand Up @@ -34,3 +34,5 @@ sub test_centers

# Test no error for duplicate centers
test_centers(10);

done_testing();
4 changes: 3 additions & 1 deletion test/t/005_query_recall.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 60;
use Test::More;

# Initialize node
my $node = get_new_node('node');
Expand Down Expand Up @@ -43,3 +43,5 @@
is($res, $query);
}
}

done_testing();
4 changes: 3 additions & 1 deletion test/t/006_lists.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 3;
use Test::More;

# Initialize node
my $node = get_new_node('node');
Expand All @@ -29,3 +29,5 @@
"CREATE INDEX lists10000 ON tst USING ivfflat (v) WITH (lists = 10000);"
);
like($stderr, qr/memory required is/);

done_testing();
4 changes: 3 additions & 1 deletion test/t/007_inserts.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 7;
use Test::More;

my $dim = 768;

Expand Down Expand Up @@ -53,3 +53,5 @@ sub idx_scan
));
is($count, $expected);
is(idx_scan(), 1);

done_testing();
4 changes: 3 additions & 1 deletion test/t/008_avg.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 5;
use Test::More;

# Initialize node
my $node = get_new_node('node');
Expand Down Expand Up @@ -33,3 +33,5 @@
# Test explain
my $explain = $node->safe_psql("postgres", "EXPLAIN SELECT AVG(v) FROM tst;");
like($explain, qr/Partial Aggregate/);

done_testing();
4 changes: 3 additions & 1 deletion test/t/009_storage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 1;
use Test::More;

my $dim = 1024;

Expand Down Expand Up @@ -30,3 +30,5 @@
"INSERT INTO tst SELECT array_agg(n), array_agg(n), array_agg(n) FROM generate_series(1, $dim) n"
);
like($stderr, qr/row is too big/);

done_testing();

0 comments on commit de6502a

Please sign in to comment.