Skip to content

Commit 5984223

Browse files
committed
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
2 parents 3e12106 + 63ee933 commit 5984223

36 files changed

+84
-9
lines changed

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
begin_group "Install dependencies"
99

10-
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
10+
P4WHENCE=https://cdist2.perforce.com/perforce/r23.2
1111
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
1212
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
1313

t/t9800-git-p4-basic.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='git p4 tests'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./lib-git-p4.sh
910

1011
test_expect_success 'start p4d' '
@@ -297,8 +298,20 @@ test_expect_success 'exit when p4 fails to produce marshaled output' '
297298
# p4 changes, files, or describe; just in p4 print. If P4CLIENT is unset, the
298299
# message will include "Librarian checkout".
299300
test_expect_success 'exit gracefully for p4 server errors' '
300-
test_when_finished "mv \"$db\"/depot/file1,v,hidden \"$db\"/depot/file1,v" &&
301-
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden &&
301+
# Note that newer Perforce versions started to store files
302+
# compressed in directories. The case statement handles both
303+
# old and new layout.
304+
case "$(echo "$db"/depot/file1*)" in
305+
*,v)
306+
test_when_finished "mv \"$db\"/depot/file1,v,hidden \"$db\"/depot/file1,v" &&
307+
mv "$db"/depot/file1,v "$db"/depot/file1,v,hidden;;
308+
*,d)
309+
path="$(echo "$db"/depot/file1,d/*.gz)" &&
310+
test_when_finished "mv \"$path\",hidden \"$path\"" &&
311+
mv "$path" "$path",hidden;;
312+
*)
313+
BUG "unhandled p4d layout";;
314+
esac &&
302315
test_when_finished cleanup_git &&
303316
test_expect_code 1 git p4 clone --dest="$git" //depot@1 >out 2>err &&
304317
test_grep "Error from p4 print" err

t/t9801-git-p4-branch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='git p4 tests for p4 branches'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./lib-git-p4.sh
910

1011
test_expect_success 'start p4d' '

t/t9802-git-p4-filetype.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 filetype tests'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '
@@ -300,10 +301,22 @@ test_expect_success SYMLINKS 'empty symlink target' '
300301
# text
301302
# @@
302303
#
304+
# Note that newer Perforce versions started to store files
305+
# compressed in directories. The case statement handles both
306+
# old and new layout.
303307
cd "$db/depot" &&
304-
sed "/@target1/{; s/target1/@/; n; d; }" \
305-
empty-symlink,v >empty-symlink,v.tmp &&
306-
mv empty-symlink,v.tmp empty-symlink,v
308+
case "$(echo empty-symlink*)" in
309+
empty-symlink,v)
310+
sed "/@target1/{; s/target1/@/; n; d; }" \
311+
empty-symlink,v >empty-symlink,v.tmp &&
312+
mv empty-symlink,v.tmp empty-symlink,v;;
313+
empty-symlink,d)
314+
path="empty-symlink,d/$(ls empty-symlink,d/ | tail -n1)" &&
315+
rm "$path" &&
316+
gzip </dev/null >"$path";;
317+
*)
318+
BUG "unhandled p4d layout";;
319+
esac
307320
) &&
308321
(
309322
# Make sure symlink really is empty. Asking

t/t9803-git-p4-shell-metachars.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9804-git-p4-label.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 label tests'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9805-git-p4-skip-submit-edit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 skipSubmitEdit config variables'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9806-git-p4-options.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='git p4 options'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./lib-git-p4.sh
910

1011
test_expect_success 'start p4d' '

t/t9808-git-p4-chdir.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 relative chdir'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9809-git-p4-client-view.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 client view'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9810-git-p4-rcs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 rcs keywords'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
CP1252="\223\224"

t/t9811-git-p4-label-import.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='git p4 label tests'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./lib-git-p4.sh
910

1011
test_expect_success 'start p4d' '

t/t9812-git-p4-wildcards.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 wildcards'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9813-git-p4-preserve-users.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 preserve users'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9814-git-p4-rename.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 rename'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9815-git-p4-submit-fail.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 submit failure handling'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9816-git-p4-locked.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 locked file behavior'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9817-git-p4-exclude.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9818-git-p4-block.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 fetching changes in multiple blocks'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9819-git-p4-case-folding.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='interaction with P4 case-folding'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
if test_have_prereq CASE_INSENSITIVE_FS

t/t9820-git-p4-editor-handling.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 handling of EDITOR'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9821-git-p4-path-variations.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='Clone repositories with path case variations'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d with case folding enabled' '

t/t9822-git-p4-path-encoding.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='Clone repositories with non ASCII paths'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt"

t/t9823-git-p4-mock-lfs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_file_is_not_in_mock_lfs () {

t/t9825-git-p4-handle-utf16-without-bom.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
UTF16="\227\000\227\000"
@@ -22,9 +23,25 @@ test_expect_success 'init depot with UTF-16 encoded file and artificially remove
2223
cd db &&
2324
p4d -jc &&
2425
# P4D automatically adds a BOM. Remove it here to make the file invalid.
25-
sed -e "\$d" depot/file1,v >depot/file1,v.new &&
26-
mv depot/file1,v.new depot/file1,v &&
27-
printf "@$UTF16@" >>depot/file1,v &&
26+
#
27+
# Note that newer Perforce versions started to store files
28+
# compressed in directories. The case statement handles both
29+
# old and new layout.
30+
case "$(echo depot/file1*)" in
31+
depot/file1,v)
32+
sed -e "\$d" depot/file1,v >depot/file1,v.new &&
33+
mv depot/file1,v.new depot/file1,v &&
34+
printf "@$UTF16@" >>depot/file1,v;;
35+
depot/file1,d)
36+
path="$(echo depot/file1,d/*.gz)" &&
37+
gunzip -c "$path" >"$path.unzipped" &&
38+
sed -e "\$d" "$path.unzipped" >"$path.new" &&
39+
printf "$UTF16" >>"$path.new" &&
40+
gzip -c "$path.new" >"$path" &&
41+
rm "$path.unzipped" "$path.new";;
42+
*)
43+
BUG "unhandled p4d layout";;
44+
esac &&
2845
p4d -jrF checkpoint.1
2946
)
3047
'

t/t9826-git-p4-keep-empty-commits.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='Clone repositories and keep empty commits'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9827-git-p4-change-filetype.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 support for file type change'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9828-git-p4-map-user.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='Clone repositories and map users'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9829-git-p4-jobs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 retrieve job info'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9830-git-p4-symlink-dir.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 symlinked directories'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9831-git-p4-triggers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 with server triggers'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9832-unshelve.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ last_shelved_change () {
66

77
test_description='git p4 unshelve'
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./lib-git-p4.sh
1011

1112
test_expect_success 'start p4d' '

t/t9833-errors.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git p4 errors'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./lib-git-p4.sh
67

78
test_expect_success 'start p4d' '

t/t9834-git-p4-file-dir-bug.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This test creates files and directories with the same name in perforce and
66
checks that git-p4 recovers from the error at the same time as the perforce
77
repository.'
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./lib-git-p4.sh
1011

1112
test_expect_success 'start p4d' '

t/t9835-git-p4-metadata-encoding-python2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
66
encoding in p4 metadata (author names, commit messages, etc) without
77
failing, and produces maximally sane output in git.'
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./lib-git-p4.sh
1011

1112
python_target_version='2'

t/t9836-git-p4-metadata-encoding-python3.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This test checks that the import process handles inconsistent text
66
encoding in p4 metadata (author names, commit messages, etc) without
77
failing, and produces maximally sane output in git.'
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./lib-git-p4.sh
1011

1112
python_target_version='3'

0 commit comments

Comments
 (0)