Support

Expand all | Collapse all

Query to get Test Run status

  • 1.  Query to get Test Run status

    Posted 07-07-2017 09:54
    Hello Geeks

    Can any one help to correct below query, I require total number of test cases executed in a test cycle with number of passes and failed test  cases.

    select tcycle.id TST_CYC_ID, tcycle.name TST_CYC_NAME, trunstat.name TRUN_STAT
    ,count(doc.id) TESTRUN_STAT_COUNT
    from document doc
    inner join testrunset trun ON doc.testRunSetId = trun.id
    inner join (select id, name from document where entitytype = 'TestCycle' and testPlanId = ? and active = 'T') tcycle
    on tcycle.id = trun.testCycleId
    left outer join testrunstatus trunstat on doc.testRunStatusId = trunstat.id
    where doc.active = 'T'
    group by tcycle.id, tcycle.name,trunstat.name
    union all
    select tcycle.id, tcycle.name,trs.name,0
    from testrunstatus trs,
    (select id, name from document where entitytype = 'TestCycle' and testPlanId = ? and active = 'T') tcycle
    where trs.name not in (select trunstat.name TRUN_STAT
    from document doc
    inner join testrunset trun ON doc.testRunSetId = trun.id
    inner join (select id, name from document where entitytype = 'TestCycle' and testPlanId = ? and active = 'T') tcycle
    on tcycle.id = trun.testCycleId
    left outer join testrunstatus trunstat on doc.testRunStatusId = trunstat.id
    where doc.active = 'T')

    Thanks
    Sharan

    ------------------------------
    sharan Patil
    Sensata Technologies (Schrader)
    ------------------------------


  • 2.  RE: Query to get Test Run status

    Posted 07-10-2017 05:07
    I am getting following error, while i tried to  debug
    org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report. at org.eclipse.birt.report.engine.api.impl.DatasetPreviewTask.doRun(DatasetPreviewTask.java:318) at org.eclipse.birt.report.engine.api.impl.DatasetPreviewTask.runDataset(DatasetPreviewTask.java:280) at org.eclipse.birt.report.engine.api.impl.DatasetPreviewTask.execute(DatasetPreviewTask.java:91) at org.eclipse.birt.report.designer.data.ui.dataset.DataSetPreviewer.preview(DataSetPreviewer.java:68) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$5.run(ResultSetPreviewPage.java:366) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)Caused by: org.eclipse.birt.report.data.adapter.api.AdapterException: An exception occurred during processing. Please see the following message for details:Failed to prepare the query execution for the data set: tesResultCannot get the result set metadata.    org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.SQL error #1:No value specified for parameter 1 ;    java.sql.SQLException: No value specified for parameter 1 at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:657) at org.eclipse.birt.report.engine.api.impl.DatasetPreviewTask.extractQuery(DatasetPreviewTask.java:349) at org.eclipse.birt.report.engine.api.impl.DatasetPreviewTask.doRun(DatasetPreviewTask.java:309) ... 5 moreCaused by: org.eclipse.birt.data.engine.core.DataException: Failed to prepare the query execution for the data set: tesResultCannot get the result set metadata.    org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.SQL error #1:No value specified for parameter 1 ;    java.sql.SQLException: No value specified for parameter 1 at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:350) at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:178) at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:637) ... 7 moreCaused by: org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot get the result set metadata.    org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.SQL error #1:No value specified for parameter 1 ;    java.sql.SQLException: No value specified for parameter 1 at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:52) at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108) at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:84) at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getRuntimeMetaData(PreparedStatement.java:414) at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getProjectedColumns(PreparedStatement.java:377) at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.addColumnHint(PreparedStatement.java:994) at org.eclipse.birt.data.engine.executor.DataSourceQuery.addColumnHints(DataSourceQuery.java:732) at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepareColumns(DataSourceQuery.java:408) at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:345) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:517) at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:346) ... 12 moreCaused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.SQL error #1:No value specified for parameter 1 ;    java.sql.SQLException: No value specified for parameter 1 at org.eclipse.birt.report.data.oda.jdbc.Statement.executeQuery(Statement.java:481) at org.eclipse.birt.report.data.oda.jdbc.Statement.getMetaUsingDefaultPolicy(Statement.java:388) at org.eclipse.birt.report.data.oda.jdbc.Statement.getMetaData(Statement.java:330) at org.eclipse.birt.report.data.oda.jdbc.bidi.BidiStatement.getMetaData(BidiStatement.java:56) at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.doGetMetaData(OdaQuery.java:423) at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.getMetaData(OdaQuery.java:390) at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getRuntimeMetaData(PreparedStatement.java:407) ... 19 moreCaused by: java.sql.SQLException: No value specified for parameter 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928) at com.mysql.jdbc.PreparedStatement.checkAllParametersSet(PreparedStatement.java:2487) at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2462) at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2386) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2186) at org.eclipse.birt.report.data.oda.jdbc.Statement.executeQuery(Statement.java:477)

    ------------------------------
    sharan Patil
    Sensata Technologies (Schrader)
    ------------------------------



  • 3.  RE: Query to get Test Run status

    Posted 07-11-2017 01:27
    Hello Sharan,

    Here's my stab at this. I was a bit confused at part of your question since you are asking for the status of test runs in a test cycle but in your query, you have the test plan ID as the parameter. Let me know how this goes.

    select dtc.name as 'Cycle Name', dtr.testRunStatus as 'Test Run Status', count(dtr.testRunStatus) as 'Amount of Runs' from document dtr
    inner join testrunset tr on tr.id = dtr.testRunSetId
    inner join document dtc on dtc.id = tr.testCycleId
    inner join document dtp on dtp.id = dtc.testPlanId
    where dtr.entitytype = 'TestRun' and dtr.active = 'T' and dtc.entitytype = 'TestCycle' and dtc.active = 'T' and dtp.entitytype = 'TestPlan' and dtp.archived = 'F' and (dtr.testRunStatus='PASSED' or dtr.testRunStatus='FAILED') and dtc.id = ? group by dtr.testRunStatus;

    ------------------------------
    Justin Phang
    Jama Software
    Portland OR
    ------------------------------