mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-05-29 22:48:16 +02:00
Split full module into mock and real to allow better test combinations and save time in CI.
This commit is contained in:
parent
f6d4457d58
commit
692b1e274a
36
.travis.yml
36
.travis.yml
@ -13,27 +13,21 @@ services:
|
||||
- docker
|
||||
|
||||
env:
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=9.1" PGB_TEST_PARAM="--module=full --test=real --db=9.1 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=9.0" PGB_TEST_PARAM="--module=full --test=real --db=9.0 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u16" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --no-lint"
|
||||
- PGB_TEST_VM="u16" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="u16" PGB_BUILD_PARAM="--db=9.4" PGB_TEST_PARAM="--module=full --test=real --db=9.4 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --no-lint"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=9.3" PGB_TEST_PARAM="--module=full --test=real --db=9.3 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=8.4" PGB_TEST_PARAM="--module=full --test=real --db=8.4 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --no-lint"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=9.6" PGB_TEST_PARAM="--module=full --test=real --db=9.6 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=9.5" PGB_TEST_PARAM="--module=full --test=real --db=9.5 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u14" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --no-lint"
|
||||
- PGB_TEST_VM="u14" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="u14" PGB_BUILD_PARAM="--db=9.2" PGB_TEST_PARAM="--module=full --test=real --db=9.2 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u12" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --no-lint"
|
||||
- PGB_TEST_VM="u12" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=full --test=synthetic --no-lint --no-package"
|
||||
- PGB_TEST_VM="u12" PGB_BUILD_PARAM="--db=8.3" PGB_TEST_PARAM="--module=full --test=real --db=8.3 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=9.1" PGB_TEST_PARAM="--module=real --db=9.1 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co6" PGB_BUILD_PARAM="--db=9.0" PGB_TEST_PARAM="--module=real --db=9.0 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u16" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock --no-lint"
|
||||
- PGB_TEST_VM="u16" PGB_BUILD_PARAM="--db=9.4" PGB_TEST_PARAM="--module=real --db=9.4 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock --no-lint"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=9.3" PGB_TEST_PARAM="--module=real --db=9.3 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="d8" PGB_BUILD_PARAM="--db=8.4" PGB_TEST_PARAM="--module=real --db=8.4 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock --no-lint"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=9.6" PGB_TEST_PARAM="--module=real --db=9.6 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="co7" PGB_BUILD_PARAM="--db=9.5" PGB_TEST_PARAM="--module=real --db=9.5 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u14" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock --no-lint"
|
||||
- PGB_TEST_VM="u14" PGB_BUILD_PARAM="--db=9.2" PGB_TEST_PARAM="--module=real --db=9.2 --process-max=2 --no-lint --no-package"
|
||||
- PGB_TEST_VM="u12" PGB_BUILD_PARAM="--db=none" PGB_TEST_PARAM="--vm-max=2 --module=common --module=help --module=config --module=storage --module=protocol --module=info --module=archive --module=backup --module=expire --module=stanza --module=mock --no-lint"
|
||||
- PGB_TEST_VM="u12" PGB_BUILD_PARAM="--db=8.3" PGB_TEST_PARAM="--module=real --db=8.3 --process-max=2 --no-lint --no-package"
|
||||
|
||||
before_install:
|
||||
- sudo apt-get -qq update && sudo apt-get install libxml-checker-perl libdbd-pg-perl libperl-critic-perl libtemplate-perl libpod-coverage-perl libtest-differences-perl libhtml-parser-perl lintian debhelper txt2man devscripts libjson-perl libio-socket-ssl-perl libxml-libxml-perl python-pip
|
||||
|
@ -186,6 +186,10 @@
|
||||
<release-item>
|
||||
<p>Combine hardlink and non/compressed in synthetic tests to reduce test time and improve coverage.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Split <id>full</id> module into <id>mock</id> and <id>real</id> to allow better test combinations and save time in CI.</p>
|
||||
</release-item>
|
||||
</release-refactor-list>
|
||||
</release-test-list>
|
||||
</release>
|
||||
|
@ -95,18 +95,18 @@ sub process
|
||||
{
|
||||
my $hVm = vmGet();
|
||||
my @stryModule;
|
||||
my $strFullModule = undef;
|
||||
my $strRealModule = undef;
|
||||
|
||||
# Get all modules but full to break up the tests
|
||||
foreach my $strModule (testDefModuleList())
|
||||
{
|
||||
if ($strModule ne 'full')
|
||||
if ($strModule ne 'real')
|
||||
{
|
||||
push(@stryModule, $strModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
$strFullModule = $strModule;
|
||||
$strRealModule = $strModule;
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,40 +119,22 @@ sub process
|
||||
join(' --module=', @stryModule) . ($bFirst ? '' : " ${strConfigNotFirst}") . "\"\n";
|
||||
$bFirst = false;
|
||||
|
||||
# Now generate full tests
|
||||
my $strRealTest = undef;
|
||||
|
||||
if (!defined($strFullModule))
|
||||
# Now generate real tests
|
||||
if (!defined($strRealModule))
|
||||
{
|
||||
confess "${strFullModule} module not found, has the name changed?";
|
||||
confess "${strRealModule} module not found, has the name changed?";
|
||||
}
|
||||
|
||||
foreach my $strTest (testDefModuleTestList($strFullModule))
|
||||
foreach my $strTest (testDefModuleTestList($strRealModule))
|
||||
{
|
||||
if ($strTest eq 'real')
|
||||
{
|
||||
$strRealTest = $strTest;
|
||||
|
||||
foreach my $strDbVersion (sort {$b cmp $a} @{$hVm->{$strVm}{&VM_DB_MINIMAL}})
|
||||
{
|
||||
$strConfig .=
|
||||
" - PGB_TEST_VM=\"${strVm}\" PGB_BUILD_PARAM=\"--db=${strDbVersion}\"" .
|
||||
" PGB_TEST_PARAM=\"--module=full --test=real --db=${strDbVersion}" .
|
||||
" --process-max=2 ${strConfigNotFirst} ${strConfigNotFirstOS}\"\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
foreach my $strDbVersion (sort {$b cmp $a} @{$hVm->{$strVm}{&VM_DB_MINIMAL}})
|
||||
{
|
||||
$strConfig .=
|
||||
" - PGB_TEST_VM=\"${strVm}\" PGB_BUILD_PARAM=\"--db=none\"" .
|
||||
" PGB_TEST_PARAM=\"--vm-max=2 --module=full --test=${strTest} ${strConfigNotFirst} ${strConfigNotFirstOS}\"\n";
|
||||
" - PGB_TEST_VM=\"${strVm}\" PGB_BUILD_PARAM=\"--db=${strDbVersion}\"" .
|
||||
" PGB_TEST_PARAM=\"--module=${strRealModule} --db=${strDbVersion}" .
|
||||
" --process-max=2 ${strConfigNotFirst} ${strConfigNotFirstOS}\"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined($strRealTest))
|
||||
{
|
||||
confess "${strRealTest} test not found in ${strFullModule} module, has the name changed?";
|
||||
}
|
||||
}
|
||||
|
||||
# Configure install and script
|
||||
|
@ -408,9 +408,9 @@ my $oTestDef =
|
||||
},
|
||||
]
|
||||
},
|
||||
# Full tests
|
||||
# Mock tests
|
||||
{
|
||||
&TESTDEF_NAME => 'full',
|
||||
&TESTDEF_NAME => 'mock',
|
||||
&TESTDEF_EXPECT => true,
|
||||
&TESTDEF_INDIVIDUAL => true,
|
||||
&TESTDEF_PROCESS => true,
|
||||
@ -418,11 +418,22 @@ my $oTestDef =
|
||||
&TESTDEF_TEST =>
|
||||
[
|
||||
{
|
||||
&TESTDEF_NAME => 'synthetic',
|
||||
&TESTDEF_NAME => 'all',
|
||||
&TESTDEF_TOTAL => 3,
|
||||
},
|
||||
]
|
||||
},
|
||||
# Real tests
|
||||
{
|
||||
&TESTDEF_NAME => 'real',
|
||||
&TESTDEF_EXPECT => true,
|
||||
&TESTDEF_INDIVIDUAL => true,
|
||||
&TESTDEF_PROCESS => true,
|
||||
|
||||
&TESTDEF_TEST =>
|
||||
[
|
||||
{
|
||||
&TESTDEF_NAME => 'real',
|
||||
&TESTDEF_NAME => 'all',
|
||||
&TESTDEF_TOTAL => 12,
|
||||
&TESTDEF_DB => true,
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# FullSyntheticTest.pm - Tests for all commands that can be run against synthetic data
|
||||
# Test All Commands on Mock Data
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Full::FullSyntheticTest;
|
||||
package pgBackRestTest::Module::Mock::MockAllTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
@ -1,7 +1,7 @@
|
||||
####################################################################################################################################
|
||||
# FullRealTest.pm - Tests for all commands against a real database
|
||||
# Test All Commands On PostgreSQL Clusters
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Full::FullRealTest;
|
||||
package pgBackRestTest::Module::Real::RealAllTest;
|
||||
use parent 'pgBackRestTest::Env::HostEnvTest';
|
||||
|
||||
####################################################################################################################################
|
Loading…
x
Reference in New Issue
Block a user