tests: fix protocol version for overspecifications

These tests are also marked with a NEEDSWORK comment. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Feb 25, 2019 at 13:54 UTC d790ee1707374022d9296e8af62c137fb2627587
4 files changed +46 -11
t/t5515-fetch-merge-logic.sh
+4
@@ -6,6 +6,10 @@
6
7 test_description='Merge logic in fetch'
8
9 +# NEEDSWORK: If the overspecification of the expected result is reduced, we
10 +# might be able to run this test in all protocol versions.
11 +GIT_TEST_PROTOCOL_VERSION=
12 +
13 . ./test-lib.sh
14
15 LF='
t/t5539-fetch-http-shallow.sh
+4 -1
@@ -67,7 +67,10 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
67 cd clone &&
68 git checkout --orphan newnew &&
69 test_commit new-too &&
70 - GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" git fetch --depth=2 &&
70 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
71 + # might be able to run this test in all protocol versions.
72 + GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" GIT_TEST_PROTOCOL_VERSION= \
73 + git fetch --depth=2 &&
74 grep "fetch-pack< ACK .* ready" ../trace &&
75 ! grep "fetch-pack> done" ../trace
76 )
t/t5541-http-push-smart.sh
+12 -2
@@ -47,7 +47,12 @@ test_expect_success 'no empty path components' '
47 cd "$ROOT_PATH" &&
48 git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&
49
50 - check_access_log exp
50 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
51 + # might be able to run this test in all protocol versions.
52 + if test -z "$GIT_TEST_PROTOCOL_VERSION"
53 + then
54 + check_access_log exp
55 + fi
56 '
57
58 test_expect_success 'clone remote repository' '
@@ -128,7 +133,12 @@ GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
133 POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
134 EOF
135 test_expect_success 'used receive-pack service' '
131 - check_access_log exp
136 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
137 + # might be able to run this test in all protocol versions.
138 + if test -z "$GIT_TEST_PROTOCOL_VERSION"
139 + then
140 + check_access_log exp
141 + fi
142 '
143
144 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
t/t5551-http-fetch-smart.sh
+26 -8
@@ -81,12 +81,18 @@ test_expect_success 'clone http repository' '
81 /^< Content-Length: /d
82 /^< Transfer-Encoding: /d
83 " >actual &&
84 - sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \
85 - actual >actual.smudged &&
86 - test_cmp exp actual.smudged &&
84
88 - grep "Accept-Encoding:.*gzip" actual >actual.gzip &&
89 - test_line_count = 2 actual.gzip
85 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
86 + # might be able to run this test in all protocol versions.
87 + if test -z "$GIT_TEST_PROTOCOL_VERSION"
88 + then
89 + sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \
90 + actual >actual.smudged &&
91 + test_cmp exp actual.smudged &&
92 +
93 + grep "Accept-Encoding:.*gzip" actual >actual.gzip &&
94 + test_line_count = 2 actual.gzip
95 + fi
96 '
97
98 test_expect_success 'fetch changes via http' '
@@ -104,7 +110,13 @@ test_expect_success 'used upload-pack service' '
110 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
111 POST /smart/repo.git/git-upload-pack HTTP/1.1 200
112 EOF
107 - check_access_log exp
113 +
114 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
115 + # might be able to run this test in all protocol versions.
116 + if test -z "$GIT_TEST_PROTOCOL_VERSION"
117 + then
118 + check_access_log exp
119 + fi
120 '
121
122 test_expect_success 'follow redirects (301)' '
@@ -216,8 +228,14 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
228 git config http.cookiefile cookies.txt &&
229 git config http.savecookies true &&
230 git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
219 - tail -3 cookies.txt | sort >cookies_tail.txt &&
220 - test_cmp expect_cookies.txt cookies_tail.txt
231 +
232 + # NEEDSWORK: If the overspecification of the expected result is reduced, we
233 + # might be able to run this test in all protocol versions.
234 + if test -z "$GIT_TEST_PROTOCOL_VERSION"
235 + then
236 + tail -3 cookies.txt | sort >cookies_tail.txt &&
237 + test_cmp expect_cookies.txt cookies_tail.txt
238 + fi
239 '
240
241 test_expect_success 'transfer.hiderefs works over smart-http' '