Merge branch 'ps/p4-tests-updates'

Perforce tests have been updated.

* ps/p4-tests-updates:
  t98xx: mark Perforce tests as memory-leak free
  ci: update Perforce version to r23.2
  t98xx: fix Perforce tests with p4d r23 and newer
This commit is contained in:
Junio C Hamano
2024-08-08 10:41:20 -07:00
36 changed files with 84 additions and 9 deletions

View File

@ -7,7 +7,7 @@
begin_group "Install dependencies" begin_group "Install dependencies"
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2 P4WHENCE=https://cdist2.perforce.com/perforce/r23.2
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
JGITWHENCE=https://repo.eclipse.org/content/groups/releases//org/eclipse/jgit/org.eclipse.jgit.pgm/6.8.0.202311291450-r/org.eclipse.jgit.pgm-6.8.0.202311291450-r.sh JGITWHENCE=https://repo.eclipse.org/content/groups/releases//org/eclipse/jgit/org.eclipse.jgit.pgm/6.8.0.202311291450-r/org.eclipse.jgit.pgm-6.8.0.202311291450-r.sh

View File

@ -5,6 +5,7 @@ test_description='git p4 tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '
@ -297,8 +298,20 @@ test_expect_success 'exit when p4 fails to produce marshaled output' '
# p4 changes, files, or describe; just in p4 print. If P4CLIENT is unset, the # p4 changes, files, or describe; just in p4 print. If P4CLIENT is unset, the
# message will include "Librarian checkout". # message will include "Librarian checkout".
test_expect_success 'exit gracefully for p4 server errors' ' test_expect_success 'exit gracefully for p4 server errors' '
test_when_finished "mv \"$db\"/depot/file1,v,hidden \"$db\"/depot/file1,v" && # Note that newer Perforce versions started to store files
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden && # compressed in directories. The case statement handles both
# old and new layout.
case "$(echo "$db"/depot/file1*)" in
*,v)
test_when_finished "mv \"$db\"/depot/file1,v,hidden \"$db\"/depot/file1,v" &&
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden;;
*,d)
path="$(echo "$db"/depot/file1,d/*.gz)" &&
test_when_finished "mv \"$path\",hidden \"$path\"" &&
mv "$path" "$path",hidden;;
*)
BUG "unhandled p4d layout";;
esac &&
test_when_finished cleanup_git && test_when_finished cleanup_git &&
test_expect_code 1 git p4 clone --dest="$git" //depot@1 >out 2>err && test_expect_code 1 git p4 clone --dest="$git" //depot@1 >out 2>err &&
test_grep "Error from p4 print" err test_grep "Error from p4 print" err

View File

@ -5,6 +5,7 @@ test_description='git p4 tests for p4 branches'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 filetype tests' test_description='git p4 filetype tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '
@ -300,10 +301,22 @@ test_expect_success SYMLINKS 'empty symlink target' '
# text # text
# @@ # @@
# #
# Note that newer Perforce versions started to store files
# compressed in directories. The case statement handles both
# old and new layout.
cd "$db/depot" && cd "$db/depot" &&
sed "/@target1/{; s/target1/@/; n; d; }" \ case "$(echo empty-symlink*)" in
empty-symlink,v >empty-symlink,v.tmp && empty-symlink,v)
mv empty-symlink,v.tmp empty-symlink,v sed "/@target1/{; s/target1/@/; n; d; }" \
empty-symlink,v >empty-symlink,v.tmp &&
mv empty-symlink,v.tmp empty-symlink,v;;
empty-symlink,d)
path="empty-symlink,d/$(ls empty-symlink,d/ | tail -n1)" &&
rm "$path" &&
gzip </dev/null >"$path";;
*)
BUG "unhandled p4d layout";;
esac
) && ) &&
( (
# Make sure symlink really is empty. Asking # Make sure symlink really is empty. Asking

View File

@ -2,6 +2,7 @@
test_description='git p4 transparency to shell metachars in filenames' test_description='git p4 transparency to shell metachars in filenames'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 label tests' test_description='git p4 label tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 skipSubmitEdit config variables' test_description='git p4 skipSubmitEdit config variables'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -5,6 +5,7 @@ test_description='git p4 options'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 relative chdir' test_description='git p4 relative chdir'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 client view' test_description='git p4 client view'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 rcs keywords' test_description='git p4 rcs keywords'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
CP1252="\223\224" CP1252="\223\224"

View File

@ -5,6 +5,7 @@ test_description='git p4 label tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 wildcards' test_description='git p4 wildcards'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 preserve users' test_description='git p4 preserve users'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 rename' test_description='git p4 rename'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 submit failure handling' test_description='git p4 submit failure handling'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 locked file behavior' test_description='git p4 locked file behavior'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 tests for excluded paths during clone and sync' test_description='git p4 tests for excluded paths during clone and sync'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 fetching changes in multiple blocks' test_description='git p4 fetching changes in multiple blocks'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='interaction with P4 case-folding' test_description='interaction with P4 case-folding'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
if test_have_prereq CASE_INSENSITIVE_FS if test_have_prereq CASE_INSENSITIVE_FS

View File

@ -2,6 +2,7 @@
test_description='git p4 handling of EDITOR' test_description='git p4 handling of EDITOR'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='Clone repositories with path case variations' test_description='Clone repositories with path case variations'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d with case folding enabled' ' test_expect_success 'start p4d with case folding enabled' '

View File

@ -2,6 +2,7 @@
test_description='Clone repositories with non ASCII paths' test_description='Clone repositories with non ASCII paths'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt" UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt"

View File

@ -2,6 +2,7 @@
test_description='Clone repositories and store files in Mock LFS' test_description='Clone repositories and store files in Mock LFS'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_file_is_not_in_mock_lfs () { test_file_is_not_in_mock_lfs () {

View File

@ -2,6 +2,7 @@
test_description='git p4 handling of UTF-16 files without BOM' test_description='git p4 handling of UTF-16 files without BOM'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
UTF16="\227\000\227\000" UTF16="\227\000\227\000"
@ -22,9 +23,25 @@ test_expect_success 'init depot with UTF-16 encoded file and artificially remove
cd db && cd db &&
p4d -jc && p4d -jc &&
# P4D automatically adds a BOM. Remove it here to make the file invalid. # P4D automatically adds a BOM. Remove it here to make the file invalid.
sed -e "\$d" depot/file1,v >depot/file1,v.new && #
mv depot/file1,v.new depot/file1,v && # Note that newer Perforce versions started to store files
printf "@$UTF16@" >>depot/file1,v && # compressed in directories. The case statement handles both
# old and new layout.
case "$(echo depot/file1*)" in
depot/file1,v)
sed -e "\$d" depot/file1,v >depot/file1,v.new &&
mv depot/file1,v.new depot/file1,v &&
printf "@$UTF16@" >>depot/file1,v;;
depot/file1,d)
path="$(echo depot/file1,d/*.gz)" &&
gunzip -c "$path" >"$path.unzipped" &&
sed -e "\$d" "$path.unzipped" >"$path.new" &&
printf "$UTF16" >>"$path.new" &&
gzip -c "$path.new" >"$path" &&
rm "$path.unzipped" "$path.new";;
*)
BUG "unhandled p4d layout";;
esac &&
p4d -jrF checkpoint.1 p4d -jrF checkpoint.1
) )
' '

View File

@ -2,6 +2,7 @@
test_description='Clone repositories and keep empty commits' test_description='Clone repositories and keep empty commits'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 support for file type change' test_description='git p4 support for file type change'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='Clone repositories and map users' test_description='Clone repositories and map users'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 retrieve job info' test_description='git p4 retrieve job info'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 symlinked directories' test_description='git p4 symlinked directories'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 with server triggers' test_description='git p4 with server triggers'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -6,6 +6,7 @@ last_shelved_change () {
test_description='git p4 unshelve' test_description='git p4 unshelve'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -2,6 +2,7 @@
test_description='git p4 errors' test_description='git p4 errors'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -6,6 +6,7 @@ This test creates files and directories with the same name in perforce and
checks that git-p4 recovers from the error at the same time as the perforce checks that git-p4 recovers from the error at the same time as the perforce
repository.' repository.'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
test_expect_success 'start p4d' ' test_expect_success 'start p4d' '

View File

@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
encoding in p4 metadata (author names, commit messages, etc) without encoding in p4 metadata (author names, commit messages, etc) without
failing, and produces maximally sane output in git.' failing, and produces maximally sane output in git.'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
python_target_version='2' python_target_version='2'

View File

@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
encoding in p4 metadata (author names, commit messages, etc) without encoding in p4 metadata (author names, commit messages, etc) without
failing, and produces maximally sane output in git.' failing, and produces maximally sane output in git.'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh . ./lib-git-p4.sh
python_target_version='3' python_target_version='3'