Merge branch 'jk/t3419-drop-expensive-tests'

Test update.

* jk/t3419-drop-expensive-tests:
  t3419: drop EXPENSIVE tests
This commit is contained in:
Junio C Hamano
2020-04-22 13:42:42 -07:00

View File

@ -4,15 +4,6 @@ test_description='git rebase - test patch id computation'
. ./test-lib.sh . ./test-lib.sh
count () {
i=0
while test $i -lt $1
do
echo "$i"
i=$(($i+1))
done
}
scramble () { scramble () {
i=0 i=0
while read x while read x
@ -26,54 +17,37 @@ scramble () {
mv -f "$1.new" "$1" mv -f "$1.new" "$1"
} }
run () {
echo \$ "$@"
/usr/bin/time "$@" >/dev/null
}
test_expect_success 'setup' ' test_expect_success 'setup' '
git commit --allow-empty -m initial && git commit --allow-empty -m initial &&
git tag root git tag root
' '
do_tests () { test_expect_success 'setup: 500 lines' '
nlines=$1 pr=${2-}
test_expect_success $pr "setup: $nlines lines" "
rm -f .gitattributes && rm -f .gitattributes &&
git checkout -q -f master && git checkout -q -f master &&
git reset --hard root && git reset --hard root &&
count $nlines >file && test_seq 500 >file &&
git add file && git add file &&
git commit -q -m initial && git commit -q -m initial &&
git branch -f other && git branch -f other &&
scramble file && scramble file &&
git add file && git add file &&
git commit -q -m 'change big file' && git commit -q -m "change big file" &&
git checkout -q other && git checkout -q other &&
: >newfile && : >newfile &&
git add newfile && git add newfile &&
git commit -q -m 'add small file' && git commit -q -m "add small file" &&
git cherry-pick master >/dev/null 2>&1 git cherry-pick master >/dev/null 2>&1
" '
test_debug " test_expect_success 'setup attributes' '
run git diff master^\! echo "file binary" >.gitattributes
" '
test_expect_success $pr 'setup attributes' " test_expect_success 'detect upstream patch' '
echo 'file binary' >.gitattributes
"
test_debug "
run git format-patch --stdout master &&
run git format-patch --stdout --ignore-if-in-upstream master
"
test_expect_success $pr 'detect upstream patch' '
git checkout -q master && git checkout -q master &&
scramble file && scramble file &&
git add file && git add file &&
@ -82,9 +56,9 @@ do_tests () {
git rebase master && git rebase master &&
git rev-list master...HEAD~ >revs && git rev-list master...HEAD~ >revs &&
test_must_be_empty revs test_must_be_empty revs
' '
test_expect_success $pr 'do not drop patch' ' test_expect_success 'do not drop patch' '
git branch -f squashed master && git branch -f squashed master &&
git checkout -q -f squashed && git checkout -q -f squashed &&
git reset -q --soft HEAD~2 && git reset -q --soft HEAD~2 &&
@ -92,10 +66,6 @@ do_tests () {
git checkout -q other^{} && git checkout -q other^{} &&
test_must_fail git rebase squashed && test_must_fail git rebase squashed &&
git rebase --quit git rebase --quit
' '
}
do_tests 500
do_tests 50000 EXPENSIVE
test_done test_done