1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-09-16 09:06:18 +02:00

Add check for test path inside repo path.

If the test path is inside the repo path then it can cause strange issues during testing because the entire repo path is duplicated into the test path so that all tests see a consistent view of the repo.

Another solution might be to pick a better test path name and exclude it from the rsync, but this fix at least addresses the immediate issue.
This commit is contained in:
David Steele
2021-07-29 11:09:51 -04:00
committed by GitHub
parent 58cc470b3e
commit e32f9e146b
3 changed files with 31 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ freebsd_12_task:
install_script: pkg install -y bash git postgresql-libpqxx pkgconf libxml2 gmake perl5 libyaml p5-YAML-LibYAML rsync
script:
- perl ${CIRRUS_WORKING_DIR}/test/test.pl --no-gen --make-cmd=gmake --vm=none --vm-max=2 --no-coverage --no-valgrind --module=command --test=backup
- cd .. && perl ${CIRRUS_WORKING_DIR}/test/test.pl --no-gen --make-cmd=gmake --vm=none --vm-max=2 --no-coverage --no-valgrind --module=command --test=backup
debug_script:
- ls -lah ${CIRRUS_WORKING_DIR}
@@ -39,7 +39,7 @@ macos_catalina_task:
- cpanm --local-lib=/usr/local/opt/perl5 install YAML::XS
script:
- ${CIRRUS_WORKING_DIR}/test/test.pl --no-gen --vm=none --vm-max=2 --no-coverage --no-valgrind --module=command --test=backup
- cd .. && ${CIRRUS_WORKING_DIR}/test/test.pl --no-gen --vm=none --vm-max=2 --no-coverage --no-valgrind --module=command --test=backup
debug_script:
- ls -lah ${CIRRUS_WORKING_DIR}

View File

@@ -180,6 +180,19 @@
<release-test-list>
<release-improvement-list>
<release-item>
<github-issue id="1472"/>
<github-pull-request id="1474"/>
<release-item-contributor-list>
<release-item-ideator id="greg.sabino.mullane"/>
<release-item-contributor id="david.steele"/>
<release-item-reviewer id="greg.sabino.mullane"/>
</release-item-contributor-list>
<p>Add check for test path inside repo path.</p>
</release-item>
<release-item>
<github-pull-request id="1457"/>
@@ -10089,6 +10102,11 @@
<contributor-id type="github">fpa-postgres</contributor-id>
</contributor>
<contributor id="greg.sabino.mullane">
<contributor-name-display>Greg Sabino Mullane</contributor-name-display>
<contributor-id type="github">turnstep</contributor-id>
</contributor>
<contributor id="greg.smith">
<contributor-name-display>Greg Smith</contributor-name-display>
<contributor-id type="github">gregscds</contributor-id>

View File

@@ -359,6 +359,17 @@ eval
my $oStorageBackRest = new pgBackRestTest::Common::Storage(
$strBackRestBase, new pgBackRestTest::Common::StoragePosix({bFileSync => false, bPathSync => false}));
# Check that the test path is not in the git repo path
if (index("${strTestPath}/", "${strBackRestBase}/") != -1)
{
confess &log(
ERROR,
"test path '${strTestPath}' may not be in the repo path '${strBackRestBase}'\n" .
"HINT: was test.pl run in '${strBackRestBase}'?\n" .
"HINT: use --test-path to set a test path\n" .
"HINT: run test.pl from outside the repo, e.g. 'pgbackrest/test/test.pl'");
}
################################################################################################################################
# Clean working and result paths
################################################################################################################################