Skip to content

Commit ffadf13

Browse files
committed
Revert "Debug output for failing tests"
This reverts commit 9384e34.
1 parent 9384e34 commit ffadf13

4 files changed

Lines changed: 60 additions & 102 deletions

File tree

http-tests/admin/packages/install-uninstall-package-ontology.sh

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,41 @@ package_ontology_uri="https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-
1313
namespace_ontology_uri="${END_USER_BASE_URL}ns#"
1414

1515
# install package
16-
echo "DEBUG: Installing package..." >&2
17-
install_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
16+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
1817
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
1918
-X POST \
2019
-H "Content-Type: application/x-www-form-urlencoded" \
2120
--data-urlencode "package-uri=$package_uri" \
22-
"$ADMIN_BASE_URL"packages/install)
23-
echo "DEBUG: Install status: $install_status" >&2
24-
echo "$install_status" | grep -q "$STATUS_SEE_OTHER"
21+
"$ADMIN_BASE_URL"packages/install \
22+
| grep -q "$STATUS_SEE_OTHER"
2523

2624
# verify owl:imports triple was added
27-
echo "DEBUG: Verifying owl:imports was added..." >&2
28-
ns_after_install=$(curl -k -s -H "Accept: application/n-triples" "${END_USER_BASE_URL}ns")
29-
echo "DEBUG: Namespace after install:" >&2
30-
echo "$ns_after_install" | grep "owl#imports" >&2
31-
echo "$ns_after_install" | grep -q "<${namespace_ontology_uri}> <http://www.w3.org/2002/07/owl#imports> <${package_ontology_uri}>"
25+
curl -k -s \
26+
-H "Accept: application/n-triples" \
27+
"${END_USER_BASE_URL}ns" \
28+
| grep -q "<${namespace_ontology_uri}> <http://www.w3.org/2002/07/owl#imports> <${package_ontology_uri}>"
3229

3330
# verify package ontology document exists
34-
echo "DEBUG: Verifying package ontology document exists..." >&2
3531
package_ontology_hash=$(echo -n "$package_ontology_uri" | shasum -a 1 | cut -d' ' -f1)
36-
ontology_doc_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${ADMIN_BASE_URL}ontologies/${package_ontology_hash}/")
37-
echo "DEBUG: Ontology document status: $ontology_doc_status" >&2
38-
echo "$ontology_doc_status" | grep -q "200"
32+
curl -k -f -s -o /dev/null \
33+
"${ADMIN_BASE_URL}ontologies/${package_ontology_hash}/"
3934

4035
# uninstall package
41-
echo "DEBUG: Uninstalling package..." >&2
42-
uninstall_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
36+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
4337
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
4438
-X POST \
4539
-H "Content-Type: application/x-www-form-urlencoded" \
4640
--data-urlencode "package-uri=$package_uri" \
47-
"$ADMIN_BASE_URL"packages/uninstall)
48-
echo "DEBUG: Uninstall status: $uninstall_status" >&2
49-
echo "$uninstall_status" | grep -q "$STATUS_SEE_OTHER"
41+
"$ADMIN_BASE_URL"packages/uninstall \
42+
| grep -q "$STATUS_SEE_OTHER"
5043

5144
# verify owl:imports triple was removed
52-
echo "DEBUG: Verifying owl:imports was removed..." >&2
5345
ns_after=$(curl -k -s -H "Accept: application/n-triples" "${END_USER_BASE_URL}ns")
54-
echo "DEBUG: Namespace after uninstall:" >&2
55-
echo "$ns_after" | grep "owl#imports" >&2 || echo "DEBUG: No owl:imports found (expected)" >&2
5646
if echo "$ns_after" | grep -q "<${namespace_ontology_uri}> <http://www.w3.org/2002/07/owl#imports> <${package_ontology_uri}>"; then
57-
echo "ERROR: Package ontology import still present after uninstall!" >&2
5847
exit 1
5948
fi
6049

6150
# verify package ontology document was deleted
62-
echo "DEBUG: Verifying package ontology document was deleted..." >&2
63-
deleted_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${ADMIN_BASE_URL}ontologies/${package_ontology_hash}/")
64-
echo "DEBUG: Deleted ontology document status: $deleted_status" >&2
65-
echo "$deleted_status" | grep -q "$STATUS_FORBIDDEN"
51+
curl -k -w "%{http_code}\n" -o /dev/null -s \
52+
"${ADMIN_BASE_URL}ontologies/${package_ontology_hash}/" \
53+
| grep -q "$STATUS_FORBIDDEN"

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

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,38 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"
1111
package_uri="https://packages.linkeddatahub.com/skos/#this"
1212

1313
# install package
14-
echo "DEBUG: Installing package..." >&2
15-
install_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
14+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
1615
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
1716
-X POST \
1817
-H "Content-Type: application/x-www-form-urlencoded" \
1918
--data-urlencode "package-uri=$package_uri" \
20-
"$ADMIN_BASE_URL"packages/install)
21-
echo "DEBUG: Install status: $install_status" >&2
22-
echo "$install_status" | grep -q "$STATUS_SEE_OTHER"
19+
"$ADMIN_BASE_URL"packages/install \
20+
| grep -q "$STATUS_SEE_OTHER"
2321

2422
# verify package stylesheet was installed (should return 200)
25-
echo "DEBUG: Verifying package stylesheet was installed..." >&2
26-
package_xsl_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl")
27-
echo "DEBUG: Package stylesheet status: $package_xsl_status" >&2
28-
echo "$package_xsl_status" | grep -q "200"
23+
curl -k -f -s -o /dev/null \
24+
"${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl"
2925

3026
# verify master stylesheet includes package
31-
echo "DEBUG: Verifying master stylesheet includes package..." >&2
32-
master_xsl_before=$(curl -k -s "$END_USER_BASE_URL"static/xsl/layout.xsl)
33-
if echo "$master_xsl_before" | grep -q "com/linkeddatahub/packages/skos/layout.xsl"; then
34-
echo "DEBUG: Master stylesheet includes package (expected)" >&2
35-
else
36-
echo "ERROR: Master stylesheet does not include package after install!" >&2
37-
exit 1
38-
fi
27+
curl -k -s "$END_USER_BASE_URL"static/xsl/layout.xsl \
28+
| grep -q "com/linkeddatahub/packages/skos/layout.xsl"
3929

4030
# uninstall package
41-
echo "DEBUG: Uninstalling package..." >&2
42-
uninstall_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
31+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
4332
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
4433
-X POST \
4534
-H "Content-Type: application/x-www-form-urlencoded" \
4635
--data-urlencode "package-uri=$package_uri" \
47-
"$ADMIN_BASE_URL"packages/uninstall)
48-
echo "DEBUG: Uninstall status: $uninstall_status" >&2
49-
echo "$uninstall_status" | grep -q "$STATUS_SEE_OTHER"
36+
"$ADMIN_BASE_URL"packages/uninstall \
37+
| grep -q "$STATUS_SEE_OTHER"
5038

5139
# verify package stylesheet was deleted (should return 404)
52-
echo "DEBUG: Verifying package stylesheet was deleted..." >&2
53-
deleted_xsl_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl")
54-
echo "DEBUG: Deleted package stylesheet status: $deleted_xsl_status" >&2
55-
echo "$deleted_xsl_status" | grep -q "$STATUS_NOT_FOUND"
40+
curl -k -w "%{http_code}\n" -o /dev/null -s \
41+
"${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl" \
42+
| grep -q "$STATUS_NOT_FOUND"
5643

5744
# verify master stylesheet no longer includes package
58-
echo "DEBUG: Verifying master stylesheet no longer includes package..." >&2
5945
master_xsl=$(curl -k -s "$END_USER_BASE_URL"static/xsl/layout.xsl)
6046
if echo "$master_xsl" | grep -q "com/linkeddatahub/packages/skos/layout.xsl"; then
61-
echo "ERROR: Master stylesheet still includes package after uninstall!" >&2
62-
echo "DEBUG: Master stylesheet content:" >&2
63-
echo "$master_xsl" | grep -C 2 "com/linkeddatahub/packages/skos/layout.xsl" >&2
6447
exit 1
6548
fi
66-
echo "DEBUG: Master stylesheet does not include package (expected)" >&2

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

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,34 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"
1111
package_uri="https://packages.linkeddatahub.com/skos/#this"
1212

1313
# first install the package
14-
echo "DEBUG: Installing package first..." >&2
15-
install_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
14+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
1615
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
1716
-X POST \
1817
-H "Content-Type: application/x-www-form-urlencoded" \
1918
--data-urlencode "package-uri=$package_uri" \
20-
"${ADMIN_BASE_URL}packages/install")
21-
echo "DEBUG: Install status: $install_status" >&2
22-
echo "$install_status" | grep -q "$STATUS_SEE_OTHER"
19+
"${ADMIN_BASE_URL}packages/install" \
20+
| grep -q "$STATUS_SEE_OTHER"
2321

2422
# verify package stylesheet exists before uninstall (should return 200)
25-
echo "DEBUG: Verifying package stylesheet exists before uninstall..." >&2
26-
before_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl")
27-
echo "DEBUG: Package stylesheet status before uninstall: $before_status" >&2
28-
echo "$before_status" | grep -q "200"
23+
curl -k -f -s -o /dev/null \
24+
"${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl"
2925

3026
# uninstall package via POST to packages/uninstall endpoint
31-
echo "DEBUG: Uninstalling package..." >&2
32-
uninstall_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s \
27+
curl -k -w "%{http_code}\n" -o /dev/null -f -s \
3328
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
3429
-X POST \
3530
-H "Content-Type: application/x-www-form-urlencoded" \
3631
--data-urlencode "package-uri=$package_uri" \
37-
"${ADMIN_BASE_URL}packages/uninstall")
38-
echo "DEBUG: Uninstall status: $uninstall_status" >&2
39-
echo "$uninstall_status" | grep -q "$STATUS_SEE_OTHER"
32+
"${ADMIN_BASE_URL}packages/uninstall" \
33+
| grep -q "$STATUS_SEE_OTHER"
4034

4135
# verify package stylesheet was deleted (should return 404)
42-
echo "DEBUG: Verifying package stylesheet was deleted..." >&2
43-
deleted_status=$(curl -k -w "%{http_code}\n" -o /dev/null -s "${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl")
44-
echo "DEBUG: Deleted package stylesheet status: $deleted_status" >&2
45-
echo "$deleted_status" | grep -q "$STATUS_NOT_FOUND"
36+
curl -k -w "%{http_code}\n" -o /dev/null -s \
37+
"${END_USER_BASE_URL}static/com/linkeddatahub/packages/skos/layout.xsl" \
38+
| grep -q "$STATUS_NOT_FOUND"
4639

4740
# verify master stylesheet was regenerated without package import
48-
echo "DEBUG: Verifying master stylesheet no longer includes package..." >&2
4941
master_xsl=$(curl -k -s "$END_USER_BASE_URL"static/xsl/layout.xsl)
5042
if echo "$master_xsl" | grep -q "com/linkeddatahub/packages/skos/layout.xsl"; then
51-
echo "ERROR: Master stylesheet still includes package after uninstall!" >&2
52-
echo "DEBUG: Master stylesheet content:" >&2
53-
echo "$master_xsl" | grep -C 2 "com/linkeddatahub/packages/skos/layout.xsl" >&2
5443
exit 1
5544
fi
56-
echo "DEBUG: Master stylesheet does not include package (expected)" >&2

http-tests/run.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ function run_tests()
4545
echo -n "$script_pathname";
4646
script_filename=$(basename "$script_pathname")
4747
script_directory=$(dirname "$script_pathname")
48-
local output=$(cd "$script_directory" || exit; bash -e "$script_filename" 2>&1)
49-
local exit_code=$?
50-
if [[ $exit_code == "0" ]]
48+
( cd "$script_directory" || exit;
49+
bash -e "$script_filename";
50+
)
51+
if [[ $? == "0" ]]
5152
then
5253
echo " ok"
5354
else
5455
echo " failed";
55-
echo "$output"
5656
(( error_count += 1))
5757
fi
5858
done
@@ -138,24 +138,24 @@ download_dataset "$ADMIN_ENDPOINT_URL" > "$TMP_ADMIN_DATASET"
138138

139139
### Other tests ###
140140

141-
#run_tests $(find ./add/ -type f -name '*.sh')
142-
#(( error_count += $? ))
143-
run_tests $(find ./admin/packages -type f -name '*.sh')
141+
run_tests $(find ./add/ -type f -name '*.sh')
142+
(( error_count += $? ))
143+
run_tests $(find ./admin/ -type f -name '*.sh')
144+
(( error_count += $? ))
145+
run_tests $(find ./dataspaces/ -type f -name '*.sh')
146+
(( error_count += $? ))
147+
run_tests $(find ./access/ -type f -name '*.sh')
148+
(( error_count += $? ))
149+
run_tests $(find ./imports/ -type f -name '*.sh')
150+
(( error_count += $? ))
151+
run_tests $(find ./document-hierarchy/ -type f -name '*.sh')
152+
(( error_count += $? ))
153+
run_tests $(find ./misc/ -type f -name '*.sh')
154+
(( error_count += $? ))
155+
run_tests $(find ./proxy/ -type f -name '*.sh')
156+
(( error_count += $? ))
157+
run_tests $(find ./sparql-protocol/ -type f -name '*.sh')
144158
(( error_count += $? ))
145-
#run_tests $(find ./dataspaces/ -type f -name '*.sh')
146-
#(( error_count += $? ))
147-
#run_tests $(find ./access/ -type f -name '*.sh')
148-
#(( error_count += $? ))
149-
#run_tests $(find ./imports/ -type f -name '*.sh')
150-
#(( error_count += $? ))
151-
#run_tests $(find ./document-hierarchy/ -type f -name '*.sh')
152-
#(( error_count += $? ))
153-
#run_tests $(find ./misc/ -type f -name '*.sh')
154-
#(( error_count += $? ))
155-
#run_tests $(find ./proxy/ -type f -name '*.sh')
156-
#(( error_count += $? ))
157-
#run_tests $(find ./sparql-protocol/ -type f -name '*.sh')
158-
#(( error_count += $? ))
159159

160160
end_time=$(date +%s)
161161
runtime=$((end_time-start_time))

0 commit comments

Comments
 (0)