Skip to content

Commit

Permalink
Merge branch 'jk/test-annoyances' into maint
Browse files Browse the repository at this point in the history
Test fixes.

* jk/test-annoyances:
  t5551: make EXPENSIVE test cheaper
  t5541: move run_with_cmdline_limit to test-lib.sh
  t: pass GIT_TRACE through Apache
  t: redirect stderr GIT_TRACE to descriptor 4
  t: translate SIGINT to an exit
  • Loading branch information
Junio C Hamano committed Apr 21, 2015
2 parents 42b2f89 + 376e4b3 commit d3115a3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions t/lib-httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www
# hack to suppress apache PassEnv warnings
GIT_VALGRIND=$GIT_VALGRIND; export GIT_VALGRIND
GIT_VALGRIND_OPTIONS=$GIT_VALGRIND_OPTIONS; export GIT_VALGRIND_OPTIONS
GIT_TRACE=$GIT_TRACE; export GIT_TRACE

if ! test -x "$LIB_HTTPD_PATH"
then
Expand Down
1 change: 1 addition & 0 deletions t/lib-httpd/apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ PassEnv GIT_VALGRIND
PassEnv GIT_VALGRIND_OPTIONS
PassEnv GNUPGHOME
PassEnv ASAN_OPTIONS
PassEnv GIT_TRACE

Alias /dumb/ www/
Alias /auth/dumb/ www/auth/dumb/
Expand Down
6 changes: 0 additions & 6 deletions t/t5541-http-push-smart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ test_expect_success 'push into half-auth-complete requires password' '
test_cmp expect actual
'

run_with_limited_cmdline () {
(ulimit -s 128 && "$@")
}

test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'

test_expect_success CMDLINE_LIMIT 'push 2000 tags over http' '
sha1=$(git rev-parse HEAD) &&
test_seq 2000 |
Expand Down
19 changes: 14 additions & 5 deletions t/t5551-http-fetch-smart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ test_expect_success 'transfer.hiderefs works over smart-http' '
git -C hidden.git rev-parse --verify b
'

test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
test_expect_success 'create 2,000 tags in the repo' '
(
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
for i in `test_seq 50000`
for i in $(test_seq 2000)
do
echo "commit refs/heads/too-many-refs"
echo "mark :$i"
Expand All @@ -248,13 +248,22 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
)
'

test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
git clone $HTTPD_URL/smart/repo.git too-many-refs &&
test_expect_success CMDLINE_LIMIT \
'clone the 2,000 tag repo to check OS command line overflow' '
run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs &&
(
cd too-many-refs &&
test $(git for-each-ref refs/tags | wc -l) = 50000
git for-each-ref refs/tags >actual &&
test_line_count = 2000 actual
)
'

test_expect_success 'large fetch-pack requests can be split across POSTs' '
GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \
clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
grep "^> POST" err >posts &&
test_line_count = 2 posts
'

stop_httpd
test_done
12 changes: 8 additions & 4 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ unset UNZIP

case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
1|2|true)
echo "* warning: Some tests will not work if GIT_TRACE" \
"is set as to trace on STDERR ! *"
echo "* warning: Please set GIT_TRACE to something" \
"other than 1, 2 or true ! *"
GIT_TRACE=4
;;
esac

Expand Down Expand Up @@ -299,6 +296,7 @@ die () {

GIT_EXIT_OK=
trap 'die' EXIT
trap 'exit $?' INT

# The user-facing functions are loaded from a separate file so that
# test_perf subshells can have them too
Expand Down Expand Up @@ -1064,3 +1062,9 @@ test_lazy_prereq UNZIP '
"$GIT_UNZIP" -v
test $? -ne 127
'

run_with_limited_cmdline () {
(ulimit -s 128 && "$@")
}

test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'

0 comments on commit d3115a3

Please sign in to comment.