actually add test to suite
This commit is contained in:
parent
5a5b461453
commit
0b216e9851
2 changed files with 2 additions and 0 deletions
35
upgrade/test-pprof-upload.sh
Normal file
35
upgrade/test-pprof-upload.sh
Normal file
|
@ -0,0 +1,35 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
function test_upload_profiles() {
|
||||
FORGEJO_URL="http://${IP}: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")
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
function test_forgejo_pprof() {
|
||||
stop
|
||||
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
|
||||
|
||||
log_info "run 8.0-dev"
|
||||
|
||||
start 8.0-dev
|
||||
test_upload_profiles
|
||||
stop
|
||||
|
||||
docker stop test_pyroscope
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue