mirror of https://github.com/postgres/postgres
PG-1482, PG-1289 Add coverage to repo and percona server version check. (#212)
- Added code coverage to link repo to codecov.io for coverage stats on PR and merge. - Added coverage badge on the landing page (readme) of the repo. - Updated GH action to run on PUSH/MERGE, as this is required for code coverage. - Updated bash files in ci_scripts folder to accommodate tde installcheck only. - Added percona server version scheme verification TAP test case.pull/209/head
parent
c8dd16849f
commit
dcdcebbf92
@ -0,0 +1,45 @@ |
||||
codecov: |
||||
strict_yaml_branch: TDE_REL_17_STABLE |
||||
fixes: |
||||
- "src/::contrib/pg_tde/src/" # move path for codecov file mappings e.g., "src/" => "contrib/pg_tde/src/" |
||||
coverage: |
||||
status: |
||||
project: |
||||
default: |
||||
target: 90% |
||||
threshold: 1% |
||||
base: auto |
||||
comment: |
||||
layout: "header, diff, components" |
||||
component_management: |
||||
default_rules: |
||||
statuses: |
||||
- type: project |
||||
target: auto |
||||
branches: |
||||
- "TDE_REL_17_STABLE" |
||||
individual_components: |
||||
- component_id: access |
||||
paths: |
||||
- contrib/pg_tde/src/access/** |
||||
- component_id: catalog |
||||
paths: |
||||
- contrib/pg_tde/src/catalog/** |
||||
- component_id: common |
||||
paths: |
||||
- contrib/pg_tde/src/common/** |
||||
- component_id: encryption |
||||
paths: |
||||
- contrib/pg_tde/src/encryption/** |
||||
- component_id: keyring |
||||
paths: |
||||
- contrib/pg_tde/src/keyring/** |
||||
- component_id: src |
||||
paths: |
||||
- contrib/pg_tde/src/*.c |
||||
- component_id: smgr |
||||
paths: |
||||
- contrib/pg_tde/src/smgr/** |
||||
- component_id: transam |
||||
paths: |
||||
- contrib/pg_tde/src/transam/** |
@ -0,0 +1,4 @@ |
||||
#!/bin/bash |
||||
|
||||
export TDE_MODE=1 |
||||
export PERCONA_SERVER_VERSION=17.4.1 |
@ -0,0 +1,62 @@ |
||||
#!/usr/bin/perl |
||||
use strict; |
||||
use warnings FATAL => 'all'; |
||||
use PostgreSQL::Test::Cluster; |
||||
use PostgreSQL::Test::Utils; |
||||
use Test::More; |
||||
use lib 't'; |
||||
use Env; |
||||
|
||||
plan tests => 6; |
||||
|
||||
# Initialize a test cluster |
||||
my $node = PostgreSQL::Test::Cluster->new('pg_server'); |
||||
$node->init(); |
||||
my $pgdata = $node->data_dir; |
||||
|
||||
# To make this testcase work, PERCONA_SERVER_VERSION variable should be available in environment. |
||||
# If you are using ci_scripts it is already declated in ci_scripts/env.sh |
||||
# If you are using command line make for regression then export like: |
||||
# export PERCONA_SERVER_VERSION=17.4.1 |
||||
|
||||
if (!defined($ENV{PERCONA_SERVER_VERSION})) |
||||
{ |
||||
BAIL_OUT("PERCONA_SERVER_VERSION variable not present in the environment"); |
||||
} |
||||
|
||||
my $percona_expected_server_version = $ENV{PERCONA_SERVER_VERSION}; |
||||
|
||||
# Start server |
||||
my $rt_value = $node->start; |
||||
ok($rt_value == 1, "Start Server"); |
||||
|
||||
# Get PG Server version (e.g 17.4) from pg_config |
||||
my $pg_server_version = `pg_config --version | awk {'print \$2'}`; |
||||
$pg_server_version=~ s/^\s+|\s+$//g; |
||||
|
||||
# Check pg_config output. |
||||
my $pg_config_output = `pg_config --version`; |
||||
$pg_config_output=~ s/^\s+|\s+$//g; |
||||
cmp_ok($pg_config_output,'eq',"PostgreSQL $pg_server_version - Percona Server for PostgreSQL $percona_expected_server_version", "Test pg_config --version output"); |
||||
|
||||
# Check psql --version output. |
||||
my $psql_version_output = `psql --version`; |
||||
$psql_version_output=~ s/^\s+|\s+$//g; |
||||
cmp_ok($psql_version_output,'eq',"psql (PostgreSQL) $pg_server_version - Percona Server for PostgreSQL $percona_expected_server_version", "Test psql --version output"); |
||||
|
||||
# Check postgres --version output. |
||||
my $postgres_output = `postgres --version`; |
||||
$postgres_output=~ s/^\s+|\s+$//g; |
||||
cmp_ok($postgres_output,'eq',"postgres (PostgreSQL) $pg_server_version - Percona Server for PostgreSQL $percona_expected_server_version", "Test postgres --version output"); |
||||
|
||||
# Check select version() output. |
||||
my ($cmdret, $stdout, $stderr) = $node->psql('postgres', "select version();", extra_params => ['-a', '-Pformat=aligned','-Ptuples_only=on']); |
||||
ok($cmdret == 0, "# Get output of select version();"); |
||||
$stdout=~ s/^\s+|\s+$//g; |
||||
like($stdout, "/PostgreSQL $pg_server_version - Percona Server for PostgreSQL $percona_expected_server_version/", "Test select version() output"); |
||||
|
||||
# Stop the server |
||||
$node->stop; |
||||
|
||||
# Done testing for this testcase file. |
||||
done_testing(); |
Loading…
Reference in new issue