finiegit add performance_tests.sh

This commit is contained in:
eleonore12345 2024-07-08 13:10:56 +02:00
parent 6556852657
commit 6ff18efe34

View File

@ -70,7 +70,7 @@ test0(){
echo "memory usage in a classic cloning : $mem"
echo "bandwidth usage : $bw"
run rm cloning_text
#run rm -rf $REPO_NAME
run rm -rf $REPO_NAME
}
test1(){
@ -106,7 +106,7 @@ test3(){
echo "memory usage in a --depth=1 with single-branch cloning : $mem"
echo "bandwidth usage : $bw"
run rm cloning_text
#run rm -rf $REPO_NAME
run rm -rf $REPO_NAME
}
test4(){
@ -125,7 +125,7 @@ test4(){
echo "memory usage: $mem"
echo "bandwidth usage : unknown"
cd ..
#run rm -rf $REPO_NAME
run rm -rf $REPO_NAME
}
@ -158,7 +158,7 @@ test5(){
cd ../$REMOTE
git reset --hard -q HEAD~1
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test6(){
@ -186,7 +186,7 @@ test6(){
git reset --hard -q HEAD~1
git clean -df
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test7(){
@ -216,7 +216,7 @@ test7(){
cd ../$REMOTE
git reset --hard -q HEAD~2
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test8(){
@ -244,7 +244,7 @@ test8(){
cd ../$REMOTE
git reset --hard -q HEAD~1
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test9(){
@ -271,7 +271,7 @@ test9(){
cd ../$REMOTE
git reset --hard -q HEAD~1
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test10(){
@ -301,7 +301,7 @@ test10(){
cd ../$REMOTE
git reset --hard -q HEAD~2
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test11(){
@ -320,7 +320,7 @@ test11(){
git commit --quiet -m"second 1M sample created"
cd ../../$REPO_NAME
#fetching
run git submodule update --init --recursive --force --recommend-shallow --remote &> /dev/null
run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null
run git fetch --progress --tags --depth=1 origin #&> /dev/null
git checkout -f origin/main #&> /dev/null
get_storage_used .
@ -330,7 +330,7 @@ test11(){
cd ../$REPO_PATH/$SUB_NAME
git reset --hard -q HEAD~1
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
test12(){
@ -340,26 +340,26 @@ test12(){
cd $REPO_NAME
get_storage_used .
mem_before=$mem
pwd
#modification of the remote repo
cd ../$REMOTE/$SUB_NAME
ls -la
rm sub_sample1
git add sub_sample1
git commit -m"1M sub_sample1 deleted"
echo "mem before vaut $mem_before"
#modification of the remote submodule
cd ..
cd $REPO_PATH/$SUB_NAME
rm sub_sample0
git add sub_sample0
git commit --quiet -m"1M 'sub_sample0' deleted"
cd ../../$REPO_NAME
#fetching
run git submodule update --init --recursive --force --recommend-shallow
run git fetch --progress --tags --depth=1 --recurse-submodules origin &> /dev/null
git checkout -f --recurse-submodules origin/main &> /dev/null
run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null
run git fetch --progress --tags --depth=1 origin #&> /dev/null
git checkout -f origin/main #&> /dev/null
get_storage_used .
mem_after=$mem
mem=$(($mem_after-$mem_before))
echo "memory usage: $mem"
cd ../$REMOTE
git reset --hard -q HEAD~2
cd ../$REPO_PATH/$SUB_NAME
git reset --hard -q HEAD~1
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
@ -368,31 +368,31 @@ test13(){
run echo 'TEST 13 : case of --depth=1 fetching and merging, after addition then removal of a 1M file in submodule'
run git clone --recurse-submodules $1 &> /dev/null
cd $REPO_NAME
run git fetch --progress origin &> /dev/null
run git merge --progress origin &> /dev/null
get_storage_used .
mem_before=$mem
#modification of the remote repo
cd ../$REMOTE/$SUB_NAME
create_random_file 'sub_sample1' '5M'
git add sub_sample1
git commit -m"first 1M sample created"
rm sub_sample1
git add sub_sample1
git commit -m"1M sub_sample1 deleted"
echo "mem before vaut $mem_before"
#modification of the remote submodule
cd ..
cd $REPO_PATH/$SUB_NAME
create_random_file 'sub_sample1' '1M'
git add sub_sample1
git commit --quiet -m"second 1M sample created"
rm sub_sample1
git add sub_sample1
git commit --quiet -m"1M 'sub_sample1' deleted"
cd ../../$REPO_NAME
#fetching
run git submodule update --init --recursive --force --recommend-shallow
run git fetch --progress --tags --depth=1 --recurse-submodules origin &> /dev/null
git checkout -f --recurse-submodules origin/main &> /dev/null
run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null
run git fetch --progress --tags --depth=1 origin #&> /dev/null
git checkout -f origin/main #&> /dev/null
get_storage_used .
mem_after=$mem
mem=$(($mem_after-$mem_before))
echo "memory usage: $mem"
cd ../$REMOTE
cd ../$REPO_PATH/$SUB_NAME
git reset --hard -q HEAD~2
cd ../..
#rm -rf performance_testing
rm -rf performance_testing
}
while getopts ":hn:a" option; do