Skip to content

Commit

Permalink
Merge branch 'ps/p4-tests-updates' into seen
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Jul 24, 2024
2 parents 41445ce + e26b8a9 commit c5e9a4d
Show file tree
Hide file tree
Showing 36 changed files with 74 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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
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

Expand Down
14 changes: 12 additions & 2 deletions t/t9800-git-p4-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test_description='git p4 tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down Expand Up @@ -297,8 +298,17 @@ 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
# message will include "Librarian checkout".
test_expect_success 'exit gracefully for p4 server errors' '
test_when_finished "mv \"$db\"/depot/file1,v,hidden \"$db\"/depot/file1,v" &&
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden &&
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_expect_code 1 git p4 clone --dest="$git" //depot@1 >out 2>err &&
test_grep "Error from p4 print" err
Expand Down
1 change: 1 addition & 0 deletions t/t9801-git-p4-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test_description='git p4 tests for p4 branches'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
16 changes: 13 additions & 3 deletions t/t9802-git-p4-filetype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 filetype tests'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down Expand Up @@ -301,9 +302,18 @@ test_expect_success SYMLINKS 'empty symlink target' '
# @@
#
cd "$db/depot" &&
sed "/@target1/{; s/target1/@/; n; d; }" \
empty-symlink,v >empty-symlink,v.tmp &&
mv empty-symlink,v.tmp empty-symlink,v
case "$(echo empty-symlink*)" in
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
Expand Down
1 change: 1 addition & 0 deletions t/t9803-git-p4-shell-metachars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 transparency to shell metachars in filenames'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9804-git-p4-label.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 label tests'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9805-git-p4-skip-submit-edit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 skipSubmitEdit config variables'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9806-git-p4-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test_description='git p4 options'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9808-git-p4-chdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 relative chdir'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9809-git-p4-client-view.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 client view'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9810-git-p4-rcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 rcs keywords'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

CP1252="\223\224"
Expand Down
1 change: 1 addition & 0 deletions t/t9811-git-p4-label-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test_description='git p4 label tests'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9812-git-p4-wildcards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 wildcards'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9813-git-p4-preserve-users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 preserve users'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9814-git-p4-rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 rename'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9815-git-p4-submit-fail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 submit failure handling'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9816-git-p4-locked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 locked file behavior'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9817-git-p4-exclude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 tests for excluded paths during clone and sync'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9818-git-p4-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 fetching changes in multiple blocks'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9819-git-p4-case-folding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='interaction with P4 case-folding'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

if test_have_prereq CASE_INSENSITIVE_FS
Expand Down
1 change: 1 addition & 0 deletions t/t9820-git-p4-editor-handling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 handling of EDITOR'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9821-git-p4-path-variations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='Clone repositories with path case variations'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d with case folding enabled' '
Expand Down
1 change: 1 addition & 0 deletions t/t9822-git-p4-path-encoding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='Clone repositories with non ASCII paths'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt"
Expand Down
1 change: 1 addition & 0 deletions t/t9823-git-p4-mock-lfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='Clone repositories and store files in Mock LFS'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_file_is_not_in_mock_lfs () {
Expand Down
19 changes: 16 additions & 3 deletions t/t9825-git-p4-handle-utf16-without-bom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 handling of UTF-16 files without BOM'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

UTF16="\227\000\227\000"
Expand All @@ -22,9 +23,21 @@ test_expect_success 'init depot with UTF-16 encoded file and artificially remove
cd db &&
p4d -jc &&
# 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 &&
printf "@$UTF16@" >>depot/file1,v &&
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
)
'
Expand Down
1 change: 1 addition & 0 deletions t/t9826-git-p4-keep-empty-commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='Clone repositories and keep empty commits'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9827-git-p4-change-filetype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 support for file type change'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9828-git-p4-map-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='Clone repositories and map users'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9829-git-p4-jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 retrieve job info'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9830-git-p4-symlink-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 symlinked directories'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9831-git-p4-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 with server triggers'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9832-unshelve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ last_shelved_change () {

test_description='git p4 unshelve'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9833-errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

test_description='git p4 errors'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9834-git-p4-file-dir-bug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
repository.'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

test_expect_success 'start p4d' '
Expand Down
1 change: 1 addition & 0 deletions t/t9835-git-p4-metadata-encoding-python2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
encoding in p4 metadata (author names, commit messages, etc) without
failing, and produces maximally sane output in git.'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

python_target_version='2'
Expand Down
1 change: 1 addition & 0 deletions t/t9836-git-p4-metadata-encoding-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
encoding in p4 metadata (author names, commit messages, etc) without
failing, and produces maximally sane output in git.'

TEST_PASSES_SANITIZE_LEAK=true
. ./lib-git-p4.sh

python_target_version='3'
Expand Down

0 comments on commit c5e9a4d

Please sign in to comment.