0

I am trying to create a run through REST api, but because there are so many testcycls, the internal JDBC fails...

PUT http://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/runs

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Entity Type="run">
<Fields>
<Field Name="test-config-id"><Value>8901</Value></Field>
<Field Name="cycle-id"><Value>123</Value></Field>
<Field Name="test-id"><Value>4567</Value></Field>
<Field Name="testcycl-id"><Value>55638</Value></Field>
<Field Name="build-revision"><Value>1</Value></Field>
<Field Name="name"><Value>MyRun</Value></Field>
<Field Name="owner"><Value>johnsmith</Value></Field>
<Field Name="status"><Value>Passed</Value></Field>
<Field Name="subtype-id"><Value>hp.qc.run.external-test</Value></Field>
<Field Name="duration"><Value>5</Value></Field>
<Field Name="execution-date"><Value>2016-09-23</Value></Field>
<Field Name="execution-time"><Value>08:01:07</Value></Field>
<Field Name="status"><Value>Passed</Value></Field>
</Fields>
</Entity>

and the error is

"Id": "qccore.general-error", "Title": "Unexpected failure in getValuePostProcess", "ExceptionProperties": null, "StackTrace": "java.sql.SQLException: [Mercury][Oracle JDBC Driver][Oracle]ORA-01795: maximum number of expressions in a list is 1000\n\nFailed SQL: /* ~~QC */ SELECT TSC_NAME , TC_TESTCYCL_ID, TC_TEST_INSTANCE, TS_NAME FROM TESTCYCL INNER JOIN TEST_CONFIGS ON TC_TEST_CONFIG_ID = TSC_ID INNER JOIN TEST ON TC_TEST_ID = TS_TEST_ID WHERE TC_TESTCYCL_ID IN (1,2,3...54802)

Will there be any ways to get around this?

Add tags

PowerLove
  • 303
  • 8
  • 25
  • Please post the block of code which does it. Posting just the endpoint and sample payload will not help much – Barney Jan 31 '19 at 00:47
  • No, I doubt that will help, it is the REST API provided by the HP ALM. Like I said that's an internal JDBC error where it results from sending a simple curl command with payload. But after wrestling with the API, I have found a solution. If people are having similar problems. Read the answer below – PowerLove Jan 31 '19 at 02:17

1 Answers1

0

So I dont think the way I was trying to do was the correct way to do this, because what I was trying to do was create a new Run object with status.

I thought that was okay, but thinking about it for a few hours, it doesn't make sense because Manual ALM test run follows...

Starting a Run -> runs test cases defined -> Puts run status as In Progress -> After finishing all the tests defined, it updates the status to whatever the test results are

So what you should do is

For each test,

PUT http://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/test-instance/TESTID and pass the payload with status "IN PROGRESS"

That request will create runs with Run Name "Fast_Run_RUNDATE"

After test is finished, update the same Run with the status

http://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/runs/RUNID with updated payload with execution status

PowerLove
  • 303
  • 8
  • 25