Toad World® Forums

Running test from command line, but can't get results. What to do?


#1

I’m trying to integerate QCT into our automated continuous integration build. For this, it is critical to run tests from the command line and report any failures.

To my dismay, when tests fail, the QCT.exe not only fails to report the details, but also merrily returns exitCode=0 (!!?) My next thought was to follow /Run with a command to /Export with test results included (/tr=Y). But this utterly failed! Not were no results included, but also a source snaphot that I explicitly excluded (/ps=N) was included.

QCT is beginning to look like a terrible mistake. Is there a way out?

Regards,
Kerry


#2

Kerry,

We are just putting the finishing touches on version 2, which among other things provides much more detailed feedback via status codes from the EXE. The incorrect inclusion of source should also be fixed.

Regards,
Steven


#3

Hi Kerry

Have a look at my blog post on using Code Tester with Continuous Integration:

http://www.toadworld.com/BLOGS/tabid/67/EntryId/493/Continuous-Integration.aspx

Hope this helps.

Cheers

Finn


#4

Hi, Finn

Thanks for your helpful reply. The API looks like the way to go.


#5

Finn,

I’m having trouble with your run_test_definition procedure. Any suggestions?

It fails to compile, complaining about the type argument to ROUND:

round((l_results(i).end_on - l_results(i).start_on) * 86400)

The type of l_results is defined to be qu_result_xp.last_run_results_api_nt. But I can find no definition for that type. It doesn’t appear to be defined in my installation of QCT 1.9.1.505.


#6

These two fieds are timestamps. No need to ROUND – you can just subtract them and multiply by 60 to get seconds. In ugly fashion, ignoring the niceties of time formatting, I changed lines 185-187 in my copy to:

    -- '(' || round((l_results(i).end_on - l_results(i).start_on) * 86400,2) ||
         '(' || TO_CHAR((l_results(i).end_on - l_results(i).start_on)*60,'hh24:mi:ss:ff3' )  ||
              's) '

This shows the start and end and total seconds consumed. Perhaps some kind soul can provide nicer formatting of the seconds, recalling that they may exceed a day or days in some degenerate case.

Cheers.


#7

Sorry, the datatype changed from DATE to TIMESTAMP in CT 1.9 and I wrote the blog article for 1.8.x so you can change

‘(’ || round((l_results(i).end_on - l_results(i).start_on) * 86400) || 's) ’

to

‘(’ || to_char(extract(second from(l_results(i).end_on - l_results(i).start_on)), ‘fm999g999g990d00’) || 's) ’

I’ll update the blog post with a comment.

Hope this helps.

Cheers


#8

Even BETTER!


#9

OK, this works, BUT, if you have two test definitions for one package, then there are two entries in QU_HARNESS for the same package. When QCTO_CI attempts to process these using the package name, it gets > 1 row back and pukes. You can see for example in this data crap pile that ERRPKG is there twice, because it has two test definitions. The procedure has to be changed to process 1:N test definitions per package, OR, put all your tests in one Test Definition. To accomplish the latter, I exported the offending test, deleted them, then reimported and merged them into a single test definition for the package. Lots of work but solved.

UNIVERSAL_ID PROGRAM_NAME TEST_NAME
{C12F6BB0-6190-46CB-A0D1-A5AB35287841} IMPLICIT Test For IMPLICIT
{7C62CEE9-BBE2-4F12-8453-FEAB63EB4754} ERRPKG Tests For ERRPKG
{B3EB5C0D-9720-4FB5-A4BF-985617A3F97F} ERRPKG Test definition for PSYNCH_UTILITY.ERRPKG
{89C287AE-05C7-4475-9CAA-CAFFC0768443} MAIN_SYNCH_PKG Tests for MAIN_SYNCH
{D1B703EE-9285-45AE-B312-ABEC61F62B04} UTILITY_PKG Tests For UTILITY_PKG


#10

select t.UNIVERSAL_ID, t.PROGRAM_NAME, t.TEST_NAME from questcodetester2.QU_HARNESS t
WHERE NAME <> ‘IMPLICIT’
order by PROGRAM_NAME;


#11

Excellent point, once again my code is caught out by new CT 1.9 behavior so I’ll have a look and post new code within the next few days.

Cheers