Let us say we need to get all the PTF test scripts and needs to find out which has been and what is the status, instead of going over each and every script (or) asking each tester for the status, better way is to get it from the database. Using PeopleSoft meta table to get those details will reduce the test leads effort in consolidate the execution status.
Below SQL, which I have prepared will get the last execution status for a test script. This query consider only main test scripts, let us say if there is a shell test script A, which calls two other test script. Below SQL will consider only the main shell script test case only, because as part of testing a requirement, one test script will be used. Also to avoid duplicate count.
SELECT a.PTTST_PARENTFOLDER, a.PTTST_NAME, a.DESCR,a.PTTST_TYPE, a.PTTST_USE_ERROR, a.LASTUPDDTTM, b.pttst_log_id, b.PTTST_LOG_CAPTION, b.pttst_log_result,
case b.pttst_log_result when 100 then 'None' when 110 then 'Pass' when 115 then 'Warning' when 120 then 'Fail' when 121 then 'Fatal Error' end test_result
FROM PSPTTSTDEFN A left outer join PSPTTSTLOG_LIST b on b.PTTST_NAME = a.PTTST_NAME and b.PTTST_LOG_DELETED <> 'Y' AND B.PTTST_LOG_ID IN (
SELECT MAX(B1.PTTST_LOG_ID) FROM PSPTTSTLOG_LIST B1 WHERE B1.PTTST_NAME=B.PTTST_NAME AND B1.PTTST_LOG_DELETED <> 'Y' )
WHERE A.PTTST_NAME IN (
SELECT a.PTTST_NAME FROM PSPTTSTDEFN A WHERE a.pttst_type ='H'
union all
SELECT A.PTTST_NAME FROM PSPTTSTDEFN A WHERE a.pttst_type ='S' AND A.PTTST_NAME NOT IN ( SELECT B.PTTST_CMD_OBJ_ID FROM PSPTTSTDEFN A, PSPTTSTCOMMAND B
WHERE a.pttst_type ='H' AND B.pttst_cmd_obj_type ='35000' AND B.PTTST_NAME = A.PTTST_NAME and B.PTTST_CMD_STATUS ='A' ))
order by 1,2;
case b.pttst_log_result when 100 then 'None' when 110 then 'Pass' when 115 then 'Warning' when 120 then 'Fail' when 121 then 'Fatal Error' end test_result
FROM PSPTTSTDEFN A left outer join PSPTTSTLOG_LIST b on b.PTTST_NAME = a.PTTST_NAME and b.PTTST_LOG_DELETED <> 'Y' AND B.PTTST_LOG_ID IN (
SELECT MAX(B1.PTTST_LOG_ID) FROM PSPTTSTLOG_LIST B1 WHERE B1.PTTST_NAME=B.PTTST_NAME AND B1.PTTST_LOG_DELETED <> 'Y' )
WHERE A.PTTST_NAME IN (
SELECT a.PTTST_NAME FROM PSPTTSTDEFN A WHERE a.pttst_type ='H'
union all
SELECT A.PTTST_NAME FROM PSPTTSTDEFN A WHERE a.pttst_type ='S' AND A.PTTST_NAME NOT IN ( SELECT B.PTTST_CMD_OBJ_ID FROM PSPTTSTDEFN A, PSPTTSTCOMMAND B
WHERE a.pttst_type ='H' AND B.pttst_cmd_obj_type ='35000' AND B.PTTST_NAME = A.PTTST_NAME and B.PTTST_CMD_STATUS ='A' ))
order by 1,2;
Comments