Highlighted
Respected Contributor.
Respected Contributor.
677 views

Trouble getting result metadata via REST API

All,

I've been using the HP Performance Center Plugin for Jenkins for quite a while.  It works fine, but might be exiting sooner that it should or sooner than it used to.  I'm using it to run performance tests and the typical process the plugin follows is:

  1. Log in
  2. Start test
  3. Wait for test to finish
  4. Collate and analyze the results
  5. Log out

When it's done, I take the run ID and use the REST API to get the results metadata for the test run that just completed.  This used to work 100% of the time but now fails almost all the time.  This might have changed between PC versions 12.2x and 12.53.

The REST request looks like this:

http://myserver.mycompany.com/LoadTest/rest/domains/mydomain/projects/myproject/runs/6770/results

The output from the REST call should look like this:

<RunResults xmlns="http://www.hp.com/PC/REST/API">
	<RunResult>
		<ID>27396</ID>
		<Name>output.mdb.zip</Name>
		<Type>Output Log</Type>
		<RunID>6764</RunID>
	</RunResult>
	<RunResult>
		<ID>27397</ID>
		<Name>VuserLog.zip</Name>
		<Type>Output Log</Type>
		<RunID>6764</RunID>
	</RunResult>
	<RunResult>
		<ID>27398</ID>
		<Name>RawResults.zip</Name>
		<Type>Raw Results</Type>
		<RunID>6764</RunID>
	</RunResult>
	<RunResult>
		<ID>27399</ID>
		<Name>Reports.zip</Name>
		<Type>HTML Report</Type>
		<RunID>6764</RunID>
	</RunResult>
	<RunResult>
		<ID>27400</ID>
		<Name>HighLevelReport_6764.xls</Name>
		<Type>Rich Report</Type>
		<RunID>6764</RunID>
	</RunResult>
	<RunResult>
		<ID>27401</ID>
		<Name>Results.zip</Name>
		<Type>Analyzed Result</Type>
		<RunID>6764</RunID>
	</RunResult>
</RunResults>

However it usually looks like this:

<RunResults xmlns="http://www.hp.com/PC/REST/API">
	<RunResult>
		<ID>27372</ID>
		<Name>output.mdb.zip</Name>
		<Type>Output Log</Type>
		<RunID>6760</RunID>
	</RunResult>
</RunResults>

Or just this:

<RunResults xmlns="http://www.hp.com/PC/REST/API" />

There are no errors in the event log in PC for these runs.  In fact, if I rerun the request to get the results metadata, it works fine.

It appears that PC is somehow signalling to the Jenkins plugin that the collation and analysis is complete when in fact it isn't.  Sounds like a bug.

What can I do about this?

thanks

John

 

0 Likes
3 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: Trouble getting result metadata via REST API

Hi John,

If you are working directly from the PC REST API to get the results metadata you can monitor the run state to verify that all the results files were collated and analyzed.

You can get send a request to the specific run and when the RunState is "Finished" you can send the request to get the full list of the results file
For example based on the URL you sent, you should verify that the value of the RunState in the response from the URL below is "Finished"

http://myserver.mycompany.com/LoadTest/rest/domains/mydomain/projects/myproject/runs/6770

Regarding the Jenkins plugin, if you noticed a change in the plug that affect the behavior as you described please open defect at

https://issues.jenkins-ci.org/browse/JENKINS-42295?jql=project%20%3D%20JENKINS%20AND%20component%20%3D%20hp-application-automation-tools-plugin

On the Jenkins Issues dashboard click on the “Create” button (Top Bar) and report the issue adding any relevant information that can assist reproducing and fixing the issue, i.e. PC Server logs, screenshots, etc.

Regards,
Eyal

Highlighted
Respected Contributor.
Respected Contributor.

Re: Trouble getting result metadata via REST API

Thanks Eyal,

Using your suggestion I created a workaround by adding a step where I get the run status in a loop until I either get a "final" status like finished, failed, etc or I time out.  This works pretty good.

I think there's probably something with the logic in PcClient.waitForRunState().  I'll open a defect with some details of what I see.

thanks

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Trouble getting result metadata via REST API

https://issues.jenkins-ci.org/browse/JENKINS-42476

Yep, pretty sure this is a bug with the plugin now.  Thanks.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.