Skip to content

Commit 6ba9e2c

Browse files
luked99gitster
authored andcommitted
git-p4: test with limited p4 server results
Change the --changes-block-size git-p4 test to use an account with limited "maxresults" and "maxscanrows" values. These conditions are applied in the server *before* the "-m maxchanges" parameter to "p4 changes" is applied, and so the strategy that git-p4 uses for limiting the number of changes does not work. As a result, the tests all fail. Note that "maxscanrows" is set quite high, as it appears to not only limit results from "p4 changes", but *also* limits results from "p4 print". Files that have more than "maxscanrows" changes seem (experimentally) to be impossible to print. There's no good way to work around this. Signed-off-by: Luke Diamand <[email protected]> Acked-by: Lex Spoon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 755113b commit 6ba9e2c

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

t/t9818-git-p4-block.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ test_expect_success 'start p4d' '
88
start_p4d
99
'
1010

11+
create_restricted_group() {
12+
p4 group -i <<-EOF
13+
Group: restricted
14+
MaxResults: 7
15+
MaxScanRows: 40
16+
Users: author
17+
EOF
18+
}
19+
20+
test_expect_success 'Create group with limited maxrows' '
21+
create_restricted_group
22+
'
23+
1124
test_expect_success 'Create a repo with many changes' '
1225
(
1326
client_view "//depot/included/... //client/included/..." \
@@ -32,30 +45,34 @@ test_expect_success 'Create a repo with many changes' '
3245
)
3346
'
3447

35-
test_expect_success 'Clone the repo' '
48+
test_expect_success 'Default user cannot fetch changes' '
49+
! p4 changes -m 1 //depot/...
50+
'
51+
52+
test_expect_failure 'Clone the repo' '
3653
git p4 clone --dest="$git" --changes-block-size=7 --verbose //depot/included@all
3754
'
3855

39-
test_expect_success 'All files are present' '
56+
test_expect_failure 'All files are present' '
4057
echo file.txt >expected &&
4158
test_write_lines outer0.txt outer1.txt outer2.txt outer3.txt outer4.txt >>expected &&
4259
test_write_lines outer5.txt >>expected &&
4360
ls "$git" >current &&
4461
test_cmp expected current
4562
'
4663

47-
test_expect_success 'file.txt is correct' '
64+
test_expect_failure 'file.txt is correct' '
4865
echo 55 >expected &&
4966
test_cmp expected "$git/file.txt"
5067
'
5168

52-
test_expect_success 'Correct number of commits' '
69+
test_expect_failure 'Correct number of commits' '
5370
(cd "$git" && git log --oneline) >log &&
5471
wc -l log &&
5572
test_line_count = 43 log
5673
'
5774

58-
test_expect_success 'Previous version of file.txt is correct' '
75+
test_expect_failure 'Previous version of file.txt is correct' '
5976
(cd "$git" && git checkout HEAD^^) &&
6077
echo 53 >expected &&
6178
test_cmp expected "$git/file.txt"
@@ -85,7 +102,7 @@ test_expect_success 'Add some more files' '
85102

86103
# This should pick up the 10 new files in "included", but not be confused
87104
# by the additional files in "excluded"
88-
test_expect_success 'Syncing files' '
105+
test_expect_failure 'Syncing files' '
89106
(
90107
cd "$git" &&
91108
git p4 sync --changes-block-size=7 &&

0 commit comments

Comments
 (0)