Skip to content

Commit 39cf849

Browse files
committed
Debug output
1 parent 1f84753 commit 39cf849

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

http-tests/admin/packages/install-package-stylesheet.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# Helper to get millisecond timestamp
5+
get_ms() {
6+
if [[ "$OSTYPE" == "darwin"* ]]; then
7+
python3 -c 'import time; print(int(time.time() * 1000))'
8+
else
9+
date +%s%3N
10+
fi
11+
}
12+
413
echo "### STEP 1: Initializing datasets"
514
initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL"
615
initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL"
@@ -13,26 +22,33 @@ package_uri="https://packages.linkeddatahub.com/skos/#this"
1322

1423
# install package via POST to packages/install endpoint
1524
echo "### STEP 2: Installing package"
25+
t1=$(get_ms)
1626
install_status=$(curl -k -w "%{http_code}\n" -o /dev/null -f -s \
1727
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
1828
-X POST \
1929
-H "Content-Type: application/x-www-form-urlencoded" \
2030
--data-urlencode "package-uri=$package_uri" \
2131
"${ADMIN_BASE_URL}packages/install")
22-
echo "Install status: $install_status (expected: $STATUS_SEE_OTHER)"
32+
t2=$(get_ms)
33+
echo "Install status: $install_status (expected: $STATUS_SEE_OTHER) [took $((t2-t1))ms]"
2334
echo "$install_status" | grep -q "$STATUS_SEE_OTHER"
2435

2536
# Verify stylesheet file exists in Tomcat's webapps directory
2637
# docker compose exec -T linkeddatahub ls -l webapps/ROOT/static/com/linkeddatahub/packages/skos
2738

2839
# Make internal request from nginx to Tomcat to warm up static file cache
29-
docker compose exec -T nginx curl -s http://linkeddatahub:7070/static/com/linkeddatahub/packages/skos/layout.xsl
40+
t3=$(get_ms)
41+
docker compose exec -T nginx curl -s -o /dev/null http://linkeddatahub:7070/static/com/linkeddatahub/packages/skos/layout.xsl
42+
t4=$(get_ms)
43+
echo "Internal request took $((t4-t3))ms"
3044

3145
# verify package stylesheet was installed (should return 200)
32-
echo "### STEP 3: Verifying package stylesheet exists"
46+
echo "### STEP 3: Verifying package stylesheet exists (delay since install: $((t4-t2))ms)"
47+
t5=$(get_ms)
3348
stylesheet_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
3449
"${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl")
35-
echo "Stylesheet status: $stylesheet_status (expected: 200)"
50+
t6=$(get_ms)
51+
echo "Stylesheet status: $stylesheet_status (expected: 200) [took $((t6-t5))ms]"
3652
if [ "$stylesheet_status" != "200" ]; then
3753
echo "ERROR: Expected 200, got $stylesheet_status"
3854
exit 1

0 commit comments

Comments
 (0)