Skip to content

Commit

Permalink
Merge ffd23f7 into b94cae8
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasylow committed May 31, 2018
2 parents b94cae8 + ffd23f7 commit 4ff273d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -97,6 +97,7 @@ before_script:

script:
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi
- bash .travis/build_docs.sh
Expand Down
25 changes: 25 additions & 0 deletions .travis/validate_report_files.sh
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

echo "validate html"

HTML_FILENAME="coverage.html"
#Exclude existing issue with OL nested in PRE
EXCLUSION_REGEX=".*Element\s.?ol.?\snot\sallowed\sas\schild\sof\selement\s.?pre.*"
HTML_VALIDATOR_URL="https://validator.w3.org/nu/"
VALIDATOR_OUT="gnu"
WARNING_REGEX="info warning:"
ERROR_REGEX="error:"

VALIDATION_RESULTS=$(curl -H "Content-Type: text/html; charset=utf-8" --data-binary @$HTML_FILENAME "$HTML_VALIDATOR_URL?out=$VALIDATOR_OUT&filterpattern=$EXCLUSION_REGEX")

ERROR_COUNT=`echo "$VALIDATION_RESULTS" | grep -c "$ERROR_REGEX"`
WARNING_COUNT=`echo "$VALIDATION_RESULTS" | grep -c "$WARNING_REGEX"`

echo "There are $ERROR_COUNT errors, $WARNING_COUNT warning in $HTML_FILENAME"

if [ $ERROR_COUNT -gt 0 ]; then
echo "$VALIDATION_RESULTS" | grep "$ERROR_REGEX"
exit 1
else
exit 0
fi
8 changes: 4 additions & 4 deletions source/reporters/ut_coverage_report_html_helper.pkb
Expand Up @@ -241,7 +241,7 @@ function get_details_file_content(a_object_id varchar2, a_unit ut_object_name, a
'<span class="' ||line_hits_css_class(executions_per_line(a_coverage.executions
,a_coverage.uncovered_lines + a_coverage.covered_lines)) || '">' ||
executions_per_line(a_coverage.executions, a_coverage.uncovered_lines + a_coverage.covered_lines)
|| '</span></span> hits/line)</h2>' || '<a name="' || l_id || '"></a>' || '<div><b>' ||
|| '</span></span> hits/line)</h2>' || '<a id="a_' || l_id || '"></a>' || '<div><b>' ||
a_coverage.objects.count || '</b> files in total. </div><div>' || '<b>' ||
(a_coverage.uncovered_lines + a_coverage.covered_lines)
|| '</b> relevant lines. ' || '<span class="green"><b>' || a_coverage.covered_lines ||
Expand Down Expand Up @@ -306,9 +306,9 @@ function get_details_file_content(a_object_id varchar2, a_unit ut_object_name, a
--TODO - build main file containing total run data and per schema data
l_file_part := '<!DOCTYPE html><html xmlns=''http://www.w3.org/1999/xhtml''><head>' || '<title>' || l_title ||
'</title>' || '<meta http-equiv="content-type" content="text/html; charset=utf-8" />' ||
'<script src=''' || a_assets_path || 'application.js'' type=''text/javascript''></script>' ||
'<script src=''' || a_assets_path || 'application.js''></script>' ||
'<link href=''' || a_assets_path ||
'application.css'' media=''screen, projection, print'' rel=''stylesheet'' type=''text/css''>' ||
'application.css'' media=''screen, print'' rel=''stylesheet'' type=''text/css''/>' ||
'<link rel="shortcut icon" type="image/png" href="' || a_assets_path || 'favicon_' ||
coverage_css_class(l_coverage_pct) || '.png" />' || '<link rel="icon" type="image/png" href="' ||
a_assets_path || 'favicon_' || coverage_css_class(l_coverage_pct) || '.png" />' || '</head>' ||
Expand Down Expand Up @@ -339,7 +339,7 @@ function get_details_file_content(a_object_id varchar2, a_unit ut_object_name, a
l_unit := a_coverage_data.objects.next(l_unit);
end loop;

l_file_part := '</div></div></body></html>';
l_file_part := '</div></div></div></body></html>';

ut_utils.append_to_clob(l_result, l_file_part);
return l_result;
Expand Down

0 comments on commit 4ff273d

Please sign in to comment.