Merge branch 'jk/t3419-drop-expensive-tests'
Test update. * jk/t3419-drop-expensive-tests: t3419: drop EXPENSIVE tests
This commit is contained in:
commit
21e3bb1299
@ -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,76 +17,55 @@ 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-}
|
rm -f .gitattributes &&
|
||||||
|
git checkout -q -f master &&
|
||||||
|
git reset --hard root &&
|
||||||
|
test_seq 500 >file &&
|
||||||
|
git add file &&
|
||||||
|
git commit -q -m initial &&
|
||||||
|
git branch -f other &&
|
||||||
|
|
||||||
test_expect_success $pr "setup: $nlines lines" "
|
scramble file &&
|
||||||
rm -f .gitattributes &&
|
git add file &&
|
||||||
git checkout -q -f master &&
|
git commit -q -m "change big file" &&
|
||||||
git reset --hard root &&
|
|
||||||
count $nlines >file &&
|
|
||||||
git add file &&
|
|
||||||
git commit -q -m initial &&
|
|
||||||
git branch -f other &&
|
|
||||||
|
|
||||||
scramble file &&
|
git checkout -q other &&
|
||||||
git add file &&
|
: >newfile &&
|
||||||
git commit -q -m 'change big file' &&
|
git add newfile &&
|
||||||
|
git commit -q -m "add small file" &&
|
||||||
|
|
||||||
git checkout -q other &&
|
git cherry-pick master >/dev/null 2>&1
|
||||||
: >newfile &&
|
'
|
||||||
git add newfile &&
|
|
||||||
git commit -q -m 'add small file' &&
|
|
||||||
|
|
||||||
git cherry-pick master >/dev/null 2>&1
|
test_expect_success 'setup attributes' '
|
||||||
"
|
echo "file binary" >.gitattributes
|
||||||
|
'
|
||||||
|
|
||||||
test_debug "
|
test_expect_success 'detect upstream patch' '
|
||||||
run git diff master^\!
|
git checkout -q master &&
|
||||||
"
|
scramble file &&
|
||||||
|
git add file &&
|
||||||
|
git commit -q -m "change big file again" &&
|
||||||
|
git checkout -q other^{} &&
|
||||||
|
git rebase master &&
|
||||||
|
git rev-list master...HEAD~ >revs &&
|
||||||
|
test_must_be_empty revs
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success $pr 'setup attributes' "
|
test_expect_success 'do not drop patch' '
|
||||||
echo 'file binary' >.gitattributes
|
git branch -f squashed master &&
|
||||||
"
|
git checkout -q -f squashed &&
|
||||||
|
git reset -q --soft HEAD~2 &&
|
||||||
test_debug "
|
git commit -q -m squashed &&
|
||||||
run git format-patch --stdout master &&
|
git checkout -q other^{} &&
|
||||||
run git format-patch --stdout --ignore-if-in-upstream master
|
test_must_fail git rebase squashed &&
|
||||||
"
|
git rebase --quit
|
||||||
|
'
|
||||||
test_expect_success $pr 'detect upstream patch' '
|
|
||||||
git checkout -q master &&
|
|
||||||
scramble file &&
|
|
||||||
git add file &&
|
|
||||||
git commit -q -m "change big file again" &&
|
|
||||||
git checkout -q other^{} &&
|
|
||||||
git rebase master &&
|
|
||||||
git rev-list master...HEAD~ >revs &&
|
|
||||||
test_must_be_empty revs
|
|
||||||
'
|
|
||||||
|
|
||||||
test_expect_success $pr 'do not drop patch' '
|
|
||||||
git branch -f squashed master &&
|
|
||||||
git checkout -q -f squashed &&
|
|
||||||
git reset -q --soft HEAD~2 &&
|
|
||||||
git commit -q -m squashed &&
|
|
||||||
git checkout -q other^{} &&
|
|
||||||
test_must_fail git rebase squashed &&
|
|
||||||
git rebase --quit
|
|
||||||
'
|
|
||||||
}
|
|
||||||
|
|
||||||
do_tests 500
|
|
||||||
do_tests 50000 EXPENSIVE
|
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user