mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-05-31 22:49:46 +02:00
Divide tests into three types (unit, integration, performance).
Many options that were set per test can instead be inferred from the types, i.e. container, c, expect, and individual. Also finish renaming Perl unit tests with the -perl suffix.
This commit is contained in:
parent
bb8c315cad
commit
88a633da17
@ -198,6 +198,10 @@
|
||||
<p>Rename Perl tests so they don't conflict with their C counterparts.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Divide tests into three types (<id>unit</id>, <id>integration</id>, <id>performance</id>). Many options that were set per test can instead be inferred from the types, i.e. <id>container</id>, <id>c</id>, <id>expect</id>, and <id>individual</id>.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Try tweaking time sync settings to prevent clock drift rather than restarting <id>VBoxService</id> on every test run.</p>
|
||||
</release-item>
|
||||
|
144
test/define.yaml
144
test/define.yaml
@ -9,33 +9,34 @@
|
||||
#
|
||||
# Most options can be set for modules and tests (test option will override module option if both are set):
|
||||
# * db - determines if the test will be run against multiple db versions
|
||||
# * container - determines if the test will be run in a container or will create containers itself
|
||||
# * coverage - determines coverage for the test
|
||||
# full - the module/test provides full coverage for the code module
|
||||
# partial - the module/test provides partial coverage for the code module
|
||||
# noCode - the code module should not contain any coverable code. If it does an error will be thrown.
|
||||
# * expect - should expect log tests be run?
|
||||
# * c - is this a C test (instead of Perl)?
|
||||
# * cDef - defines for C testing
|
||||
# * define - defines for C testing
|
||||
# * debugUnitSuppress - don't define DEBUG_UNIT for unit tests -- this is used to test unit test debugging macros
|
||||
# * individual - determines if each run in a test will be run in a new container
|
||||
# * perlReq - is Perl required for this C test?
|
||||
#
|
||||
# Some options are unique to tests:
|
||||
# * total - total runs in the test
|
||||
# * vm - VMs that the test will be run on
|
||||
# **********************************************************************************************************************************
|
||||
module:
|
||||
|
||||
# **********************************************************************************************************************************
|
||||
# Unit tests
|
||||
#
|
||||
# Unit tests are assumed to be C tests unless they end in "-perl".
|
||||
# **********************************************************************************************************************************
|
||||
unit:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: common
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: time
|
||||
total: 2
|
||||
c: true
|
||||
cDef: -DNO_ERROR -DNO_LOG
|
||||
define: -DNO_ERROR -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/time: full
|
||||
@ -43,8 +44,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: error
|
||||
total: 6
|
||||
c: true
|
||||
cDef: -DNO_ERROR -DNO_LOG
|
||||
define: -DNO_ERROR -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/error: full
|
||||
@ -53,8 +53,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: assert-on
|
||||
total: 2
|
||||
c: true
|
||||
cDef: -DNO_LOG
|
||||
define: -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/assert: noCode
|
||||
@ -62,8 +61,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: assert-off
|
||||
total: 2
|
||||
c: true
|
||||
cDef: -DNDEBUG -DNO_LOG
|
||||
define: -DNDEBUG -DNO_LOG
|
||||
debugUnitSuppress: true
|
||||
|
||||
coverage:
|
||||
@ -72,8 +70,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: fork
|
||||
total: 1
|
||||
c: true
|
||||
cDef: -DNO_LOG
|
||||
define: -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/fork: full
|
||||
@ -81,8 +78,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: mem-context
|
||||
total: 7
|
||||
c: true
|
||||
cDef: -DNO_MEM_CONTEXT -DNO_LOG
|
||||
define: -DNO_MEM_CONTEXT -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/memContext: full
|
||||
@ -90,8 +86,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: log
|
||||
total: 4
|
||||
c: true
|
||||
cDef: -DNO_LOG
|
||||
define: -DNO_LOG
|
||||
|
||||
coverage:
|
||||
common/log: full
|
||||
@ -99,7 +94,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: debug-on
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/debug: noCode
|
||||
@ -107,8 +101,7 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: debug-off
|
||||
total: 2
|
||||
c: true
|
||||
cDef: -DNDEBUG -DNO_LOG
|
||||
define: -DNDEBUG -DNO_LOG
|
||||
debugUnitSuppress: true
|
||||
|
||||
coverage:
|
||||
@ -117,7 +110,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: lock
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/lock: full
|
||||
@ -125,7 +117,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: io-handle
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/io/handle: full
|
||||
@ -133,7 +124,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: exit
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/exit: full
|
||||
@ -141,7 +131,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: wait
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/wait: full
|
||||
@ -149,7 +138,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-list
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/list: full
|
||||
@ -157,7 +145,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-string
|
||||
total: 9
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/string: full
|
||||
@ -165,7 +152,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-string-list
|
||||
total: 7
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/stringList: full
|
||||
@ -173,7 +159,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-buffer
|
||||
total: 4
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/buffer: full
|
||||
@ -181,7 +166,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-variant
|
||||
total: 7
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/variant: full
|
||||
@ -189,7 +173,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-variant-list
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/variantList: full
|
||||
@ -197,7 +180,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: type-key-value
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/type/keyValue: full
|
||||
@ -205,7 +187,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: encode
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/encode: full
|
||||
@ -216,7 +197,7 @@ module:
|
||||
total: 1
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: http-client
|
||||
- name: http-client-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
@ -225,7 +206,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: reg-exp
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/regExp: full
|
||||
@ -233,7 +213,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: ini
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
common/ini: full
|
||||
@ -253,14 +232,14 @@ module:
|
||||
Common/Io/Handle: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: io-buffered
|
||||
- name: io-buffered-perl
|
||||
total: 3
|
||||
|
||||
coverage:
|
||||
Common/Io/Buffered: partial
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: io-process
|
||||
- name: io-process-perl
|
||||
total: 3
|
||||
|
||||
coverage:
|
||||
@ -275,13 +254,11 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: cipher
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: random
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
cipher/random: full
|
||||
@ -289,33 +266,28 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: block
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
cipher/block: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: postgres
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: page-checksum
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
postgres/pageChecksum: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: perl
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: config
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
perl/config: full
|
||||
@ -323,7 +295,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: exec
|
||||
total: 2
|
||||
c: true
|
||||
perlReq: true
|
||||
|
||||
coverage:
|
||||
@ -331,26 +302,22 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: help
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: help
|
||||
total: 4
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
command/help/help: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: config
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: define
|
||||
total: 2
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
config/define: full
|
||||
@ -359,7 +326,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: config
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
config/config: full
|
||||
@ -368,7 +334,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: parse
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
config/parse: full
|
||||
@ -377,39 +342,37 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: load
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
config/load: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: storage
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: filter-cipher-block
|
||||
- name: filter-cipher-block-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
Storage/Filter/CipherBlock: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: filter-gzip
|
||||
- name: filter-gzip-perl
|
||||
total: 3
|
||||
|
||||
coverage:
|
||||
Storage/Filter/Gzip: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: filter-sha
|
||||
- name: filter-sha-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
Storage/Filter/Sha: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: posix
|
||||
- name: posix-perl
|
||||
total: 9
|
||||
|
||||
coverage:
|
||||
@ -418,25 +381,25 @@ module:
|
||||
Storage/Posix/FileWrite: partial
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: s3-auth
|
||||
- name: s3-auth-perl
|
||||
total: 5
|
||||
|
||||
coverage:
|
||||
Storage/S3/Auth: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: s3-cert
|
||||
- name: s3-cert-perl
|
||||
total: 1
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: s3-request
|
||||
- name: s3-request-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
Storage/S3/Request: partial
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: s3
|
||||
- name: s3-perl
|
||||
total: 7
|
||||
|
||||
coverage:
|
||||
@ -451,7 +414,7 @@ module:
|
||||
- d8
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: local
|
||||
- name: local-perl
|
||||
total: 10
|
||||
|
||||
coverage:
|
||||
@ -467,7 +430,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: file
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
storage/driver/posix/driverFile: full
|
||||
@ -479,7 +441,6 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: storage
|
||||
total: 13
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
storage/driver/posix/driver: full
|
||||
@ -488,25 +449,23 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: helper
|
||||
total: 3
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
storage/helper: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: protocol
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: common-minion
|
||||
- name: common-minion-perl
|
||||
total: 1
|
||||
|
||||
coverage:
|
||||
Protocol/Base/Minion: partial
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: helper
|
||||
- name: helper-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
@ -514,11 +473,10 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: info
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: unit
|
||||
- name: unit-perl
|
||||
total: 2
|
||||
|
||||
coverage:
|
||||
@ -526,20 +484,17 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: command
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: command
|
||||
total: 1
|
||||
c: true
|
||||
|
||||
coverage:
|
||||
command/command: full
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: archive
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
@ -562,14 +517,13 @@ module:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: push
|
||||
total: 2
|
||||
c: true
|
||||
perlReq: true
|
||||
|
||||
coverage:
|
||||
command/archive/push/push: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: info-unit
|
||||
- name: info-unit-perl
|
||||
total: 4
|
||||
|
||||
coverage:
|
||||
@ -585,18 +539,17 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: backup
|
||||
container: true
|
||||
|
||||
coverage:
|
||||
Backup/Common: full
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: unit
|
||||
- name: unit-perl
|
||||
total: 3
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: info-unit
|
||||
- name: info-unit-perl
|
||||
total: 3
|
||||
|
||||
coverage:
|
||||
@ -604,11 +557,10 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: manifest
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: all
|
||||
- name: all-perl
|
||||
total: 9
|
||||
|
||||
coverage:
|
||||
@ -616,20 +568,25 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: stanza
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: all
|
||||
- name: all-perl
|
||||
total: 9
|
||||
|
||||
coverage:
|
||||
Stanza: full
|
||||
|
||||
# **********************************************************************************************************************************
|
||||
# Integration tests
|
||||
#
|
||||
# Integration tests are not run in a container. They are expected to create their own containers since most integration runs will
|
||||
# create more than one. For this reason each run is executed individually.
|
||||
# **********************************************************************************************************************************
|
||||
integration:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: mock
|
||||
individual: true
|
||||
expect: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
@ -654,8 +611,6 @@ module:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: real
|
||||
individual: true
|
||||
expect: true
|
||||
db: true
|
||||
|
||||
test:
|
||||
@ -663,9 +618,16 @@ module:
|
||||
- name: all
|
||||
total: 6
|
||||
|
||||
# **********************************************************************************************************************************
|
||||
# Performance tests
|
||||
#
|
||||
# Performance tests run in a single container but are more like integration tests than unit tests since they call the pgbackrest
|
||||
# executable directly.
|
||||
# **********************************************************************************************************************************
|
||||
performance:
|
||||
|
||||
# ********************************************************************************************************************************
|
||||
- name: performance
|
||||
container: true
|
||||
|
||||
test:
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,13 @@ use pgBackRestTest::Common::VmTest;
|
||||
#
|
||||
# Documentation for these constants is in test/define.yaml.
|
||||
################################################################################################################################
|
||||
use constant TESTDEF_INTEGRATION => 'integration';
|
||||
push @EXPORT, qw(TESTDEF_INTEGRATION);
|
||||
use constant TESTDEF_PERFORMANCE => 'performance';
|
||||
push @EXPORT, qw(TESTDEF_PERFORMANCE);
|
||||
use constant TESTDEF_UNIT => 'unit';
|
||||
push @EXPORT, qw(TESTDEF_UNIT);
|
||||
|
||||
use constant TESTDEF_MODULE => 'module';
|
||||
push @EXPORT, qw(TESTDEF_MODULE);
|
||||
use constant TESTDEF_NAME => 'name';
|
||||
@ -40,8 +47,8 @@ use constant TESTDEF_EXPECT => 'expect';
|
||||
push @EXPORT, qw(TESTDEF_EXPECT);
|
||||
use constant TESTDEF_C => 'c';
|
||||
push @EXPORT, qw(TESTDEF_C);
|
||||
use constant TESTDEF_CDEF => 'cDef';
|
||||
push @EXPORT, qw(TESTDEF_CDEF);
|
||||
use constant TESTDEF_DEFINE => 'define';
|
||||
push @EXPORT, qw(TESTDEF_DEFINE);
|
||||
use constant TESTDEF_DEBUG_UNIT_SUPPRESS => 'debugUnitSuppress';
|
||||
push @EXPORT, qw(TESTDEF_DEBUG_UNIT_SUPPRESS);
|
||||
use constant TESTDEF_INDIVIDUAL => 'individual';
|
||||
@ -79,78 +86,100 @@ sub testDefLoad
|
||||
|
||||
my $hTestDef = Load($strDefineYaml);
|
||||
|
||||
# Iterate each module
|
||||
foreach my $hModule (@{$hTestDef->{&TESTDEF_MODULE}})
|
||||
# Iterate each test type
|
||||
foreach my $strModuleType (TESTDEF_UNIT, TESTDEF_INTEGRATION, TESTDEF_PERFORMANCE)
|
||||
{
|
||||
# Push the module onto the ordered list
|
||||
my $strModule = $hModule->{&TESTDEF_NAME};
|
||||
push(@stryModule, $strModule);
|
||||
my $hModuleType = $hTestDef->{$strModuleType};
|
||||
|
||||
# Iterate each test
|
||||
my @stryModuleTest;
|
||||
my $bExpect = false; # By default don't run expect tests
|
||||
my $bContainer = true; # By default run tests in a single container
|
||||
my $bIndividual = false; # By default runs are all executed in the same contanier
|
||||
|
||||
foreach my $hModuleTest (@{$hModule->{&TESTDEF_TEST}})
|
||||
if ($strModuleType eq TESTDEF_INTEGRATION)
|
||||
{
|
||||
# Push the test on the order list
|
||||
my $strTest = $hModuleTest->{&TESTDEF_NAME};
|
||||
push(@stryModuleTest, $strTest);
|
||||
|
||||
# Resolve variables that can be set in the module or the test
|
||||
foreach my $strVar (
|
||||
TESTDEF_C, TESTDEF_CDEF, TESTDEF_CONTAINER, TESTDEF_DEBUG_UNIT_SUPPRESS, TESTDEF_DB, TESTDEF_EXPECT,
|
||||
TESTDEF_INDIVIDUAL, TESTDEF_PERL_REQ, TESTDEF_VM)
|
||||
{
|
||||
$hTestDefHash->{$strModule}{$strTest}{$strVar} = coalesce(
|
||||
$hModuleTest->{$strVar}, $hModule->{$strVar}, $strVar eq TESTDEF_VM ? undef : false);
|
||||
|
||||
# Make false = 0 for debugging
|
||||
if ($strVar ne TESTDEF_VM && $hTestDefHash->{$strModule}{$strTest}{$strVar} eq '')
|
||||
{
|
||||
$hTestDefHash->{$strModule}{$strTest}{$strVar} = false;
|
||||
}
|
||||
}
|
||||
|
||||
# Set test count
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_TOTAL} = $hModuleTest->{&TESTDEF_TOTAL};
|
||||
|
||||
# If this is a C test then add the test module to coverage
|
||||
if ($hModuleTest->{&TESTDEF_C})
|
||||
{
|
||||
my $strTestFile = "module/${strModule}/${strTest}Test";
|
||||
|
||||
$hModuleTest->{&TESTDEF_COVERAGE}{$strTestFile} = TESTDEF_COVERAGE_FULL;
|
||||
}
|
||||
|
||||
# Concatenate coverage for modules and tests
|
||||
foreach my $hCoverage ($hModule->{&TESTDEF_COVERAGE}, $hModuleTest->{&TESTDEF_COVERAGE})
|
||||
{
|
||||
foreach my $strCodeModule (sort(keys(%{$hCoverage})))
|
||||
{
|
||||
if (defined($hTestDefHash->{$strModule}{$strTest}{&TESTDEF_COVERAGE}{$strCodeModule}))
|
||||
{
|
||||
confess &log(ASSERT,
|
||||
"${strCodeModule} is defined for coverage in both module ${strModule} and test ${strTest}");
|
||||
}
|
||||
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_COVERAGE}{$strCodeModule} = $hCoverage->{$strCodeModule};
|
||||
|
||||
# Build coverage type hash and make sure coverage type does not change
|
||||
if (!defined($hCoverageType->{$strCodeModule}))
|
||||
{
|
||||
$hCoverageType->{$strCodeModule} = $hCoverage->{$strCodeModule};
|
||||
}
|
||||
elsif ($hCoverageType->{$strCodeModule} ne $hCoverage->{$strCodeModule})
|
||||
{
|
||||
confess &log(ASSERT, "cannot mix coverage types for ${strCodeModule}");
|
||||
}
|
||||
|
||||
# Add to coverage list
|
||||
push(@{$hCoverageList->{$strCodeModule}}, {strModule=> $strModule, strTest => $strTest});
|
||||
}
|
||||
}
|
||||
$bExpect = true; # Integration tests run expect tests
|
||||
$bContainer = false; # Integration tests can run in multiple containers
|
||||
$bIndividual = true; # Integration tests can change containers on each run
|
||||
}
|
||||
|
||||
$hModuleTest->{$strModule} = \@stryModuleTest;
|
||||
# Iterate each module
|
||||
foreach my $hModule (@{$hModuleType})
|
||||
{
|
||||
# Push the module onto the ordered list
|
||||
my $strModule = $hModule->{&TESTDEF_NAME};
|
||||
push(@stryModule, $strModule);
|
||||
|
||||
# Iterate each test
|
||||
my @stryModuleTest;
|
||||
|
||||
foreach my $hModuleTest (@{$hModule->{&TESTDEF_TEST}})
|
||||
{
|
||||
# Push the test on the order list
|
||||
my $strTest = $hModuleTest->{&TESTDEF_NAME};
|
||||
push(@stryModuleTest, $strTest);
|
||||
|
||||
# Resolve variables that can be set in the module or the test
|
||||
foreach my $strVar (TESTDEF_DEFINE, TESTDEF_DEBUG_UNIT_SUPPRESS, TESTDEF_DB, TESTDEF_PERL_REQ, TESTDEF_VM)
|
||||
{
|
||||
$hTestDefHash->{$strModule}{$strTest}{$strVar} = coalesce(
|
||||
$hModuleTest->{$strVar}, $hModule->{$strVar}, $strVar eq TESTDEF_VM ? undef : false);
|
||||
|
||||
# Make false = 0 for debugging
|
||||
if ($strVar ne TESTDEF_VM && $hTestDefHash->{$strModule}{$strTest}{$strVar} eq '')
|
||||
{
|
||||
$hTestDefHash->{$strModule}{$strTest}{$strVar} = false;
|
||||
}
|
||||
}
|
||||
|
||||
# Set module type variables
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_C} =
|
||||
$strModuleType eq TESTDEF_UNIT && $strTest !~ /\-perl$/ ? true : false;
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_EXPECT} = $bExpect;
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_CONTAINER} = $bContainer;
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_INDIVIDUAL} = $bIndividual;
|
||||
|
||||
# Set test count
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_TOTAL} = $hModuleTest->{&TESTDEF_TOTAL};
|
||||
|
||||
# If this is a C test then add the test module to coverage
|
||||
if ($hModuleTest->{&TESTDEF_C})
|
||||
{
|
||||
my $strTestFile = "module/${strModule}/${strTest}Test";
|
||||
|
||||
$hModuleTest->{&TESTDEF_COVERAGE}{$strTestFile} = TESTDEF_COVERAGE_FULL;
|
||||
}
|
||||
|
||||
# Concatenate coverage for modules and tests
|
||||
foreach my $hCoverage ($hModule->{&TESTDEF_COVERAGE}, $hModuleTest->{&TESTDEF_COVERAGE})
|
||||
{
|
||||
foreach my $strCodeModule (sort(keys(%{$hCoverage})))
|
||||
{
|
||||
if (defined($hTestDefHash->{$strModule}{$strTest}{&TESTDEF_COVERAGE}{$strCodeModule}))
|
||||
{
|
||||
confess &log(ASSERT,
|
||||
"${strCodeModule} is defined for coverage in both module ${strModule} and test ${strTest}");
|
||||
}
|
||||
|
||||
$hTestDefHash->{$strModule}{$strTest}{&TESTDEF_COVERAGE}{$strCodeModule} = $hCoverage->{$strCodeModule};
|
||||
|
||||
# Build coverage type hash and make sure coverage type does not change
|
||||
if (!defined($hCoverageType->{$strCodeModule}))
|
||||
{
|
||||
$hCoverageType->{$strCodeModule} = $hCoverage->{$strCodeModule};
|
||||
}
|
||||
elsif ($hCoverageType->{$strCodeModule} ne $hCoverage->{$strCodeModule})
|
||||
{
|
||||
confess &log(ASSERT, "cannot mix coverage types for ${strCodeModule}");
|
||||
}
|
||||
|
||||
# Add to coverage list
|
||||
push(@{$hCoverageList->{$strCodeModule}}, {strModule=> $strModule, strTest => $strTest});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$hModuleTest->{$strModule} = \@stryModuleTest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ sub testListGet
|
||||
{
|
||||
&TEST_VM => $strTestOS,
|
||||
&TEST_C => coalesce($hTest->{&TESTDEF_C}, $hModule->{&TESTDEF_C}, false),
|
||||
&TEST_CDEF => $hTest->{&TESTDEF_CDEF},
|
||||
&TEST_CDEF => $hTest->{&TESTDEF_DEFINE},
|
||||
&TEST_DEBUG_UNIT_SUPPRESS => $hTest->{&TEST_DEBUG_UNIT_SUPPRESS},
|
||||
&TEST_CONTAINER => defined($hTest->{&TESTDEF_CONTAINER}) ?
|
||||
$hTest->{&TESTDEF_CONTAINER} : $hModule->{&TESTDEF_CONTAINER},
|
||||
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# BackupInfoUnitTest.pm - Unit tests for BackupInfo
|
||||
# Unit tests for ArchiveInfo
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Archive::ArchiveInfoUnitTest;
|
||||
package pgBackRestTest::Module::Archive::ArchiveInfoUnitPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# BackupInfoUnitTest.pm - Unit tests for BackupInfo
|
||||
# Unit tests for BackupInfo
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Backup::BackupInfoUnitTest;
|
||||
package pgBackRestTest::Module::Backup::BackupInfoUnitPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# BackupUnitTest.pm - Tests for Backup module
|
||||
# Tests for Backup module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Backup::BackupUnitTest;
|
||||
package pgBackRestTest::Module::Backup::BackupUnitPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# S3 Request Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Common::CommonHttpClientTest;
|
||||
package pgBackRestTest::Module::Common::CommonHttpClientPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# CommonIoBufferedTest.pm - tests for Common::Io::Buffered module
|
||||
# Tests for Common::Io::Buffered module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Common::CommonIoBufferedTest;
|
||||
package pgBackRestTest::Module::Common::CommonIoBufferedPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# CommonIoProcessTest.pm - tests for Common::Io::Process module
|
||||
# Tests for Common::Io::Process module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Common::CommonIoProcessTest;
|
||||
package pgBackRestTest::Module::Common::CommonIoProcessPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# InfoUnitTest.pm - Unit tests for Info module
|
||||
# Unit tests for Info module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Info::InfoUnitTest;
|
||||
package pgBackRestTest::Module::Info::InfoUnitPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# ManifestAllTest.pm - Unit tests for Manifest module
|
||||
# Unit tests for Manifest module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Manifest::ManifestAllTest;
|
||||
package pgBackRestTest::Module::Manifest::ManifestAllPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# ProtocolCommonMinionTest.pm - tests for Protocol::Common::Minion module
|
||||
# Tests for Protocol::Common::Minion module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Protocol::ProtocolCommonMinionTest;
|
||||
package pgBackRestTest::Module::Protocol::ProtocolCommonMinionPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# Protocol Helper Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Protocol::ProtocolHelperTest;
|
||||
package pgBackRestTest::Module::Protocol::ProtocolHelperPerlTest;
|
||||
use parent 'pgBackRestTest::Env::ConfigEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# StanzaAllTest.pm - Unit tests for Stanza.pm
|
||||
# Unit tests for Stanza module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Stanza::StanzaAllTest;
|
||||
package pgBackRestTest::Module::Stanza::StanzaAllPerlTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# Tests for Block Cipher
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageFilterCipherBlockTest;
|
||||
package pgBackRestTest::Module::Storage::StorageFilterCipherBlockPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# StorageFilterGzipTest.pm - Tests for Storage::Filter::Gzip module.
|
||||
# Tests for Storage::Filter::Gzip module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageFilterGzipTest;
|
||||
package pgBackRestTest::Module::Storage::StorageFilterGzipPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# StorageFilterShaTest.pm - Tests for StorageFilterSha module.
|
||||
# Tests for StorageFilterSha module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageFilterShaTest;
|
||||
package pgBackRestTest::Module::Storage::StorageFilterShaPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# StorageLocalTest.pm - Tests for Storage::Local module
|
||||
# Tests for Storage::Local module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageLocalTest;
|
||||
package pgBackRestTest::Module::Storage::StorageLocalPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# Posix Driver Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StoragePosixTest;
|
||||
package pgBackRestTest::Module::Storage::StoragePosixPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# S3 Authentication Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageS3AuthTest;
|
||||
package pgBackRestTest::Module::Storage::StorageS3AuthPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# Verify that SSL certificate validation works on live S3 servers.
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageS3CertTest;
|
||||
package pgBackRestTest::Module::Storage::StorageS3CertPerlTest;
|
||||
use parent 'pgBackRestTest::Env::ConfigEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# S3 Storage Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageS3Test;
|
||||
package pgBackRestTest::Module::Storage::StorageS3PerlTest;
|
||||
use parent 'pgBackRestTest::Env::S3EnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# S3 Request Tests
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Storage::StorageS3RequestTest;
|
||||
package pgBackRestTest::Module::Storage::StorageS3RequestPerlTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
Loading…
x
Reference in New Issue
Block a user