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 <luke@diamand.org> Acked-by: Lex Spoon <lex@lexspoon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Luke Diamand committed Jun 7, 2015 at 22:35 UTC 6ba9e2c1ba91ac34d1fb5d0fe659eb6611ddc903
1 file changed +23 -6
t/t9818-git-p4-block.sh
+23 -6
@@ -8,6 +8,19 @@ test_expect_success 'start p4d' '
8 start_p4d
9 '
10
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 +
24 test_expect_success 'Create a repo with many changes' '
25 (
26 client_view "//depot/included/... //client/included/..." \
@@ -32,11 +45,15 @@ test_expect_success 'Create a repo with many changes' '
45 )
46 '
47
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' '
53 git p4 clone --dest="$git" --changes-block-size=7 --verbose //depot/included@all
54 '
55
39 -test_expect_success 'All files are present' '
56 +test_expect_failure 'All files are present' '
57 echo file.txt >expected &&
58 test_write_lines outer0.txt outer1.txt outer2.txt outer3.txt outer4.txt >>expected &&
59 test_write_lines outer5.txt >>expected &&
@@ -44,18 +61,18 @@ test_expect_success 'All files are present' '
61 test_cmp expected current
62 '
63
47 -test_expect_success 'file.txt is correct' '
64 +test_expect_failure 'file.txt is correct' '
65 echo 55 >expected &&
66 test_cmp expected "$git/file.txt"
67 '
68
52 -test_expect_success 'Correct number of commits' '
69 +test_expect_failure 'Correct number of commits' '
70 (cd "$git" && git log --oneline) >log &&
71 wc -l log &&
72 test_line_count = 43 log
73 '
74
58 -test_expect_success 'Previous version of file.txt is correct' '
75 +test_expect_failure 'Previous version of file.txt is correct' '
76 (cd "$git" && git checkout HEAD^^) &&
77 echo 53 >expected &&
78 test_cmp expected "$git/file.txt"
@@ -85,7 +102,7 @@ test_expect_success 'Add some more files' '
102
103 # This should pick up the 10 new files in "included", but not be confused
104 # by the additional files in "excluded"
88 -test_expect_success 'Syncing files' '
105 +test_expect_failure 'Syncing files' '
106 (
107 cd "$git" &&
108 git p4 sync --changes-block-size=7 &&