Skip to content
Snippets Groups Projects
Commit 3cdca472 authored by Dmytro Bogatov's avatar Dmytro Bogatov :two_hearts:
Browse files

Tidy.

parent 3feeb15a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
set -e
JUNIT_FILE="./tidy-junit.xml"
PASS=()
FAIL=()
for url in $TIDY_URLS
do
curl -Ls https://$CI_BUILD_REF_NAME-$CI_PROJECT_NAME.review.dbogatov.org/$TIDY_PREFIX/$url$TIDY_SUFFIX | tidy $TIDY_CONFIG -e &> tidy.out || true
cat tidy.out
if cat tidy.out | grep -q '\- Warning:'
then
echo "FAILED for $TIDY_PREFIX/$url$TIDY_SUFFIX"
FAIL+=( $TIDY_PREFIX/$url$TIDY_SUFFIX )
else
echo "Passed for $TIDY_PREFIX/$url$TIDY_SUFFIX"
PASS+=( $TIDY_PREFIX/$url$TIDY_SUFFIX )
fi
done
echo "" > $JUNIT_FILE
echo "<?xml version='1.0'?>" >> $JUNIT_FILE
echo "<testsuites>" >> $JUNIT_FILE
echo "<testsuite name='Tidy' tests='$(( ${#PASS[@]} + ${#FAIL[@]} ))' failures='$((${#FAIL[@]}))' skipped='0' time='0.0000'>" >> $JUNIT_FILE
for test in "${PASS[@]}"
do
echo "<testcase name='${test}' classname='Tidy' time='0.0000'/>" >> $JUNIT_FILE
done
for test in "${FAIL[@]}"
do
echo "<testcase name='${test}' classname='Tidy' time='0.0000'>" >> $JUNIT_FILE
echo "<failure message='malformed HTML'/>" >> $JUNIT_FILE
echo "</testcase>" >> $JUNIT_FILE
done
echo "</testsuite>" >> $JUNIT_FILE
echo "</testsuites>" >> $JUNIT_FILE
if [ ${#FAIL[@]} -eq 0 ]; then
echo "Checks passed!"
else
echo "There are some failures..."
exit 1
fi
review:
stage: review
image: $CI_REGISTRY/dbogatov/setup-manager
dependencies: []
variables:
GIT_STRATEGY: none
script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment