From f071638cbb4ded41ef04fb228a3307e7946d0941 Mon Sep 17 00:00:00 2001 From: Emre Hasegeli Date: Fri, 14 May 2021 15:09:35 +0000 Subject: [PATCH 1/2] Remove --filter=nolanguage test This feature is demoved by commit 054c5796d69e203bc9070079347866d4c513c6a3. --- perlcriticrc | 2 +- t/02_same_schema.t | 5 +---- t/99_spellcheck.t | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/perlcriticrc b/perlcriticrc index c9e95cfb..915b182b 100644 --- a/perlcriticrc +++ b/perlcriticrc @@ -4,7 +4,7 @@ verbose = 8 profile-strictness = quiet [Documentation::PodSpelling] -stop_words = artemus Astill autovacuum backends battlestar boxinfo Bucardo bucardo burrick checksum checksums commitratio contrib criticals cronjob Cwd datadir datallowconn dbhost dbname dbpass dbport dbstats dbuser del dir dylan EB emma exabytes excludeuser ExclusiveLock executables faceoff filenames flagg franklin fsm garrett greg grimm GSM hitratio idxblkshit idxblksread idxscan idxtupfetch idxtupread includeuser Ioannis klatch lancre localhost logfile login lsfunc mallory maxwait MERCHANTABILITY minvalue morpork MRTG mrtg Mullane NAGIOS Nagios nagios nextval nofuncbody noidle nolanguage nols noname noobjectnames noperm noperms noposition noschema ok oskar pageslots parens perflimit petabytes pgAgent pgBouncer pgbouncer pgbouncer's pgpass plasmid plugin pluto postgres PostgreSQL psql queryname quirm refactoring ret robert Sabino salesrep sami schemas scott Seklecki seqscan seqtupread showperf skipcycled slon Slony slony Slony's snazzo speedtest SQL stderr symlink symlinked symlinks syslog tablespace tablespaces Tambouras tardis timesync tuples unlinked upd uptime USERNAME usernames WAL watson wget wilkins xlog zettabytes +stop_words = artemus Astill autovacuum backends battlestar boxinfo Bucardo bucardo burrick checksum checksums commitratio contrib criticals cronjob Cwd datadir datallowconn dbhost dbname dbpass dbport dbstats dbuser del dir dylan EB emma exabytes excludeuser ExclusiveLock executables faceoff filenames flagg franklin fsm garrett greg grimm GSM hitratio idxblkshit idxblksread idxscan idxtupfetch idxtupread includeuser Ioannis klatch lancre localhost logfile login lsfunc mallory maxwait MERCHANTABILITY minvalue morpork MRTG mrtg Mullane NAGIOS Nagios nagios nextval nofuncbody noidle nols noname noobjectnames noperm noperms noposition noschema ok oskar pageslots parens perflimit petabytes pgAgent pgBouncer pgbouncer pgbouncer's pgpass plasmid plugin pluto postgres PostgreSQL psql queryname quirm refactoring ret robert Sabino salesrep sami schemas scott Seklecki seqscan seqtupread showperf skipcycled slon Slony slony Slony's snazzo speedtest SQL stderr symlink symlinked symlinks syslog tablespace tablespaces Tambouras tardis timesync tuples unlinked upd uptime USERNAME usernames WAL watson wget wilkins xlog zettabytes [-Bangs::ProhibitDebuggingModules] [-Bangs::ProhibitFlagComments] diff --git a/t/02_same_schema.t b/t/02_same_schema.t index a77ed3c8..3e59ef78 100644 --- a/t/02_same_schema.t +++ b/t/02_same_schema.t @@ -6,7 +6,7 @@ use 5.008; use strict; use warnings; use Data::Dumper; -use Test::More tests => 76; +use Test::More tests => 75; use lib 't','.'; use CP_Testing; @@ -103,9 +103,6 @@ Language "plpgsql" does not exist on all databases: \s+Missing on:\s+1, 2\s*$}s, $t); -$t = qq{$S does not report language differences if the 'nolanguage' filter is given}; -like ($cp1->run("$connect3 --filter=nolanguage"), qr{^$label OK}, $t); - $dbh1->do(q{CREATE LANGUAGE plpgsql}); $dbh2->do(q{CREATE LANGUAGE plpgsql}); diff --git a/t/99_spellcheck.t b/t/99_spellcheck.t index 363490b0..e18f7a76 100644 --- a/t/99_spellcheck.t +++ b/t/99_spellcheck.t @@ -425,7 +425,6 @@ nofuncbody nofunctions noidle noindexes -nolanguage nols noname noname From 4df3b4ecbccf1e4030587d28d7d30b626d22b48b Mon Sep 17 00:00:00 2001 From: Emre Hasegeli Date: Fri, 7 May 2021 18:29:14 +0000 Subject: [PATCH 2/2] Make tests running against Postgres 13 I gave a try to the tests and noticed a few failing. This fixes them so "make test" runs successfully against Postgres 13.2 using the "postgres" user under CentOS 8. A few of the tests were expecting "No matching entries found" when called with "--includeuser postgres --includeuser mycatbeda" and failing because "postgres" owned objects were appearing in the result. I removed "--includeuser postgres" option so they pass. And there were 2 problems on the same_schema tests. Language change message was not matching with the expected because the check was reporting multiple differences not just the language. I changed the pattern to match with this. --- t/02_commitratio.t | 2 +- t/02_database_size.t | 2 +- t/02_hitratio.t | 2 +- t/02_same_schema.t | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/t/02_commitratio.t b/t/02_commitratio.t index 22f618a6..78ce26ed 100644 --- a/t/02_commitratio.t +++ b/t/02_commitratio.t @@ -80,6 +80,6 @@ $t=qq{$S returned correct performance data with include}; like ($cp->run('-w 5% --include=postgres'), qr{ \| time=\d\.\d\ds postgres=\d+}, $t); $t=qq{$S with includeuser option returns nothing}; -like ($cp->run('--includeuser postgres --includeuser mycatbeda -w 10%'), qr{No matching entries found due to user exclusion}, $t); +like ($cp->run('--includeuser mycatbeda -w 10%'), qr{No matching entries found due to user exclusion}, $t); exit; diff --git a/t/02_database_size.t b/t/02_database_size.t index 6e4dd47a..75c36e17 100644 --- a/t/02_database_size.t +++ b/t/02_database_size.t @@ -114,6 +114,6 @@ $t=qq{$S returned correct performance data with include}; like ($cp->run('-w 5g --include=postgres'), qr{ \| time=\d\.\d\ds postgres=\d+}, $t); $t=qq{$S with includeuser option returns nothing}; -like ($cp->run('--includeuser postgres --includeuser mycatbeda -w 10g'), qr{No matching entries found due to user exclusion}, $t); +like ($cp->run('--includeuser mycatbeda -w 10g'), qr{No matching entries found due to user exclusion}, $t); exit; diff --git a/t/02_hitratio.t b/t/02_hitratio.t index 259d9962..e9f3ba49 100644 --- a/t/02_hitratio.t +++ b/t/02_hitratio.t @@ -80,6 +80,6 @@ $t=qq{$S returned correct performance data with include}; like ($cp->run('-w 5% --include=postgres'), qr{ \| time=\d\.\d\ds postgres=\d+}, $t); $t=qq{$S with includeuser option returns nothing}; -like ($cp->run('--includeuser postgres --includeuser mycatbeda -w 10%'), qr{No matching entries found due to user exclusion}, $t); +like ($cp->run('--includeuser mycatbeda -w 10%'), qr{No matching entries found due to user exclusion}, $t); exit; diff --git a/t/02_same_schema.t b/t/02_same_schema.t index 3e59ef78..ccafb6ec 100644 --- a/t/02_same_schema.t +++ b/t/02_same_schema.t @@ -97,10 +97,10 @@ like ($cp1->run($connect3), qr{^$label OK}, $t); $t = qq{$S reports language on 3 but not 1 and 2}; $dbh3->do(q{CREATE LANGUAGE plpgsql}); like ($cp1->run($connect3), - qr{^$label CRITICAL.*Items not matched: 1 .* + qr{^$label CRITICAL.* Language "plpgsql" does not exist on all databases: \s*Exists on:\s+3 -\s+Missing on:\s+1, 2\s*$}s, +\s+Missing on:\s+1, 2}s, $t); $dbh1->do(q{CREATE LANGUAGE plpgsql});