shfmt -w globally

This commit is contained in:
Earl Warren 2024-08-07 08:31:33 +02:00
parent 4e207414d4
commit d5f66e4c0a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
27 changed files with 378 additions and 375 deletions

View file

@ -1,43 +1,43 @@
# SPDX-License-Identifier: MIT
function test_upload_profiles() {
FORGEJO_URL="http://localhost:6060"
PROFILECLI_URL="http://0.0.0.0:4040"
FORGEJO_URL="http://localhost:6060"
PROFILECLI_URL="http://0.0.0.0:4040"
endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5")
curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz
tar xzf profilecli.tar.gz
endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5")
curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz
tar xzf profilecli.tar.gz
for endpoint in "${endpoints[@]}"; do
output=$(basename "$endpoint")
if [[ $endpoint == *"/profile"* ]]; then
output="profile"
fi
output="${output}.pprof"
# Download the content and save it to a file
curl -s "${FORGEJO_URL}${endpoint}" -o "${output}"
./profilecli upload ${output} --url=${PROFILECLI_URL}
for endpoint in "${endpoints[@]}"; do
output=$(basename "$endpoint")
if [[ $endpoint == *"/profile"* ]]; then
output="profile"
fi
output="${output}.pprof"
# Download the content and save it to a file
curl -s "${FORGEJO_URL}${endpoint}" -o "${output}"
./profilecli upload ${output} --url=${PROFILECLI_URL}
rm ${output}
done
rm ${output}
done
}
function test_forgejo_pprof() {
stop
docker rm -f test_pyroscope
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
stop
docker rm -f test_pyroscope
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
reset_forgejo $UPGRADE_DIR/default-app.ini
log_info "run 7.0-test"
start 7.0-test
test_upload_profiles
stop
reset_forgejo $UPGRADE_DIR/default-app.ini
log_info "run 7.0-test"
start 7.0-test
test_upload_profiles
stop
log_info "run 8.0-test"
start 8.0-test
test_upload_profiles
stop
docker stop test_pyroscope
log_info "run 8.0-test"
start 8.0-test
test_upload_profiles
stop
docker stop test_pyroscope
}

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: MIT
UPGRADE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UPGRADE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
function upgrade_reset() {
local config=$1
@ -11,7 +11,7 @@ function upgrade_reset() {
function verify_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
for path in ${STORAGE_PATHS}; do
test -d $work_path/data/$path
done
}
@ -19,14 +19,14 @@ function verify_storage() {
function cleanup_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
for path in ${STORAGE_PATHS}; do
rm -fr $work_path/data/$path
done
}
function test_successful_upgrades() {
stop
for config in $UPGRADE_DIR/default-app.ini ; do
for config in $UPGRADE_DIR/default-app.ini; do
log_info "using $config"
upgrade_reset $config
@ -38,7 +38,7 @@ function test_successful_upgrades() {
fixture_assert
doctor_run $config
for version in $RELEASE_NUMBERS_AND_DEV ; do
for version in $RELEASE_NUMBERS_AND_DEV; do
stop
log_info "run $version"
start $version
@ -55,7 +55,7 @@ function test_gitea_upgrades() {
echo gitea 1.21 forgejo 7.0-test
echo gitea 1.21 forgejo 8.0-test
echo gitea 1.22 forgejo 8.0-test
) | while read gitea gitea_version forgejo forgejo_version ; do
) | while read gitea gitea_version forgejo forgejo_version; do
log_info "upgrading from Gitea $gitea_version to Forgejo $forgejo_version"
stop
upgrade_reset $config