1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-29 00:21:56 +02:00

Automate coverage summary report generation.

This report replaces the lcov report that was generated manually for each release.

The lcov report was overly verbose just to say that we have virtually 100% coverage.
This commit is contained in:
David Steele
2019-05-15 13:04:56 -04:00
parent 5bba72b874
commit 5c1d4bcd0d
13 changed files with 505 additions and 115 deletions

View File

@ -26,6 +26,7 @@ use pgBackRest::Version;
use pgBackRestTest::Common::BuildTest;
use pgBackRestTest::Common::ContainerTest;
use pgBackRestTest::Common::CoverageTest;
use pgBackRestTest::Common::DefineTest;
use pgBackRestTest::Common::ExecuteTest;
use pgBackRestTest::Common::ListTest;
@ -70,6 +71,7 @@ sub new
$self->{iRetry},
$self->{bValgrindUnit},
$self->{bCoverageUnit},
$self->{bCoverageSummary},
$self->{bOptimize},
$self->{bBackTrace},
$self->{bProfile},
@ -99,6 +101,7 @@ sub new
{name => 'iRetry'},
{name => 'bValgrindUnit'},
{name => 'bCoverageUnit'},
{name => 'bCoverageSummary'},
{name => 'bOptimize'},
{name => 'bBackTrace'},
{name => 'bProfile'},
@ -578,13 +581,16 @@ sub end
"module/$self->{oTest}->{&TEST_MODULE}/" . testRunName($self->{oTest}->{&TEST_NAME}, false) . 'Test');
# Generate coverage reports for the modules
my $strLCovExe = "lcov --config-file=$self->{strGCovPath}/test/lcov.conf";
my $strLCovConf = $self->{strBackRestBase} . '/test/.vagrant/code/lcov.conf';
coverageLCovConfigGenerate($self->{oStorageTest}, $strLCovConf, $self->{bCoverageSummary});
my $strLCovExeBase = "lcov --config-file=${strLCovConf}";
my $strLCovOut = $self->{strGCovPath} . '/test.lcov';
my $strLCovOutTmp = $self->{strGCovPath} . '/test.tmp.lcov';
executeTest(
'docker exec -i -u ' . TEST_USER . " ${strImage} " .
"${strLCovExe} --capture --directory=$self->{strGCovPath} --o=${strLCovOut}");
"${strLCovExeBase} --capture --directory=$self->{strGCovPath} --o=${strLCovOut}");
# Generate coverage report for each module
foreach my $strModule (@stryCoveredModule)
@ -599,6 +605,14 @@ sub end
$bTest = true;
}
# Disable branch coverage for test files
my $strLCovExe = $strLCovExeBase;
if ($bTest)
{
$strLCovExe .= ' --rc lcov_branch_coverage=0';
}
# Generate lcov reports
my $strModulePath = $self->{strBackRestBase} . "/test/.vagrant/code/${strModuleOutName}";
my $strLCovFile = "${strModulePath}.lcov";