utPLSQL / utPLSQL

Testing Framework for PL/SQL
https://www.utplsql.org/
Apache License 2.0
558 stars 185 forks source link

The coverage report is not displayed in the browser #645

Closed ansvistunov closed 6 years ago

ansvistunov commented 6 years ago

I made a coverage report for my code, using ut_coverage_html_reporter (). The report was generated, but when I try to open it in the browser, it is not displayed, and the Chrome console shows an error in the Javascript code:

Uncaught TypeError: Can not read property 'length' of undefined      at Array.m.aTypes (application.js: 1143)      at Z (application.js: 1211)      at x (application.js: 1160)      at HTMLTableElement. (application.js: 1247)      at Function.each (application.js: 17)      at init.each (application.js: 17)      at init.j.fn.dataTable (application.js: 1237)      at HTMLDocument. (application.js: 1587)      at Object.resolveWith (application.js: 17)      at Function.ready (application.js: 17)

pesse commented 6 years ago

Hi @ansvistunov, can you give us some details?

jgebal commented 6 years ago

Also. Did you generate the report on Jenkins or locally?

ansvistunov commented 6 years ago
  1. select ut.version() from dual; v3.0.4.1372

2.3. I use this command in sqlplus: exec ut.run(ut_coverage_html_reporter(), a_coverage_schemes=>ut_varchar2_list('test_cases','cardio','cardio_mobile','cardio_queue')); and spool out to file

lwasylow commented 6 years ago

can you attach a generated html file ? or can you generate an empty one with no results that doesnt work if the info are sensitive and attach?

jgebal commented 6 years ago

I suspect you might have issues with linesize/pagesize or similar. I suggest using utPLSQL-cli rather than generating coverage from SQLplus.

ansvistunov commented 6 years ago

I performed the generation according to the scheme in which the test_cases are placed and excluded the schemas in which the productive code is placed. I'm not sure that this is correct, because the generated file will not have references to the code being tested. But the error has remained the same. Resulting file: https://drive.google.com/open?id=1kZ8_nDbftt-LpB-C0IsNvFuXJpMxwvbr

pesse commented 6 years ago

Here you can get the utPLSQL-cli, documentation can be found here

You would run it like that: utplsql run user/pw@connectstring:port/service -f=ut_coverage_html -o=coverage.html

lwasylow commented 6 years ago

Try set some sqlplus settings before execution example set echo off set verify off set trimspool on set feedback off set linesize 32767 set pagesize 0 set long 200000000 set longchunksize 1000000 set serveroutput on size unlimited format truncated set arraysize 50

looking at the file it looks like issue with spooling and pagesize/linesize as mention by @jgebal Arraysize is not for display but usefull.

ansvistunov commented 6 years ago

Thank you!!! Indeed, the problem was that the lines were truncated - I looked through the structure of html, but did not notice it: (((

lwasylow commented 6 years ago

No problem. Happy it working for you. I will close it off.