question

Joe H. avatar image
0 Likes"
Joe H. asked ·

Jenkins integration not working as expected - No testrun found for specified build

Customer is using Jenkins to run Gradle scripts, which run their Java Unit Tests.

Gradle is invoking the dynatrace testRun REST interface using a CURL request to get the TestID, then passing the TestID into the injected JVM using the optionTestRunIdJava agent parameter.

But when Jenkins attempts to pull metrics out of dT for the specified TestID, it always complains "No testrun found for build id xx".

Here is the results of the REST interface call:

testRun: { category: "performance", href: "http://10.184.136.140:8020/rest/management/profiles/cloudperformance/testruns/0f203769-41ab-4bd4-9335-5026af9a1c46", id: "0f203769-41ab-4bd4-9335-5026af9a1c46", numDegraded: 0, numFailed: 0, numImproved: 0, numInvalidated: 0, numPassed: 0, numVolatile: 0, platform: "linux_x64", systemProfile: "cloudperformance", versionBuild: "120", versionRevision: "120" }

Here is the log output showing the Agent being invoked with the TestID as well as the Jenkins attempts to pull out the resulting data.

2015-11-14 01:21:05 [31f34813] info [native] Options string .............. name=unittest_cloudperformance,collector=10.184.136.140,optionTestRunIdJava=0f203769-41ab-4bd4-9335-5026af9a1c46

Connection successful, getting testruninfo for this build (120) Fetching XML Report from server For debugging: XML report from dynaTrace Server: <?xml version="1.0" encoding="utf-8"?> <dashboardreport name="UnitPipeline" version="6.2.3.1048" reportdate="2015-11-14T01:21:39.237Z" description=""> <source name="cloudperformance" filtersummary="last 1 hour"></source> <data></data> </dashboardreport> No testrun found for build id 120

If we inspect the TestAutomation dashlet, we see test data. Any ideas on why Jenkins isn't finding any data?

continuous deliverytest automation
· 1
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Are you using our Jenkins Plugin to pull back the data? Or do you just call the REST interface to pull these metrics on your own?

0 Likes 0 · ·
Joe H. avatar image
0 Likes"
Joe H. answered ·

Problem resolved. Customer had put the Test Overview dashlet on their Dashboard used by Jenkins, not the Test Results dashlet.

· 1 · Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Thanks. The current version of the Jenkins plugins actually pulls the data from the Test Results Dashlet instead of using the new REST API for retrieving TestRun Result. The engineering team is however working on updating it - so - in the future we will directly go to the REST INterface instead of querying the result of a dashboard

0 Likes 0 · ·
Dennis M. avatar image
0 Likes"
Dennis M. answered ·

Hi,

maybe it helps someone... We did not see test results actually because we were missing the "Java Test" Sensor on the Agent Group for the "Jenkins"-Agent... After placing it, we were able to see test results ;-) @Joseph M. Hoffman

Best regards, Dennis

· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Sonja C. avatar image
0 Likes"
Sonja C. answered ·

Hi Sathish,

if you open the dashboard that Jenkins is trying to access in a web browser with the same user & pwd - are you able to see the test results? You can access the list of dashboards on your server at the following address: https://server:8021/rest/html/management/dashboard...

Are you getting any additional log output in Jenkins?

The Jenkins plug-in still use our legacy way of retrieving test results by using our rest api to export dashboards. However we are currently working on a new version of the Jenkins plug-in which will use the Test Automation API to retrieve the data - and therefore be more reliable.

Let me know if you would be interested to try an early access of the new Jenkins plug-in.

Sonja

· 5 · Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Yes I am able to access via legacy rest api that dashboard but it does not have any value to testruninfo attribute.

However I am able see testruninfo attribute values when i try access by using new rest api.

I was thinking of modifying plugin to use new rest api instead of legacy one. Its good to hear from you. Yes please provide new jenkins plug-in so that I can validate it.

0 Likes 0 · ·

yes that is true - the testruninfo is not delivered as part of the legacy URL. Maybe I misunderstood your problem ;)

I will contact you per e-mail directly later this week to discuss the beta testing of the new plug-in.

0 Likes 0 · ·

Sure Let me know. Thanks

0 Likes 0 · ·

Hello,

I am also experiencing same phenomenon.

I'm using Dynatrace 6.3.

I 'm also interested in new Jenkins plug-in.

Let me know please if it is ready.

Thanks.

0 Likes 0 · ·

the new plug-in is available as a public beta, official release is planed for end of this month. All information about the public beta can be found here: https://answers.dynatrace.com/idea/142151/jenkins-plug-in-update-feedback-wanted.html

0 Likes 0 · ·
Sathish S. avatar image
0 Likes"
Sathish S. answered ·

I use HTTP protocol in Jenkins to connect dynatrace server. Attached is the screenshot below


y1i1y.png (39.8 KiB)
· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Joe H. avatar image
0 Likes"
Joe H. answered ·

I'm curious how your Dynatrace plugin is configured in Jenkins. Be sure to use Http not https.

· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Sathish S. avatar image
0 Likes"
Sathish S. answered ·

I was looking at the plugin and found out it is looking for build version by using "xpath //testruninfo[@versionbuild=" but unfortunately i could not find that attribute.

source code method:

Here is a xml version of the dashboard where I don't find testruninfo attribute. I am not sure is it something changed in 6.3 version ?


bq7zx.png (22.7 KiB)
33qng.png (198.2 KiB)
· 2 · Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Sathish,

You're right, that block of XML should not be empty. I would verify in your Jenkins scripts that you are properly passing Build information to Dynatrace.

https://community.dynatrace.com/community/display/...

Sorry but I am going on holiday so unable to continue working this thread. I will ping one of my colleagues to see if he can assist. I think you're close. As you can see there were several pieces missing, i think we've resolved most of them. Hopefully this is the last piece.

0 Likes 0 · ·

Yes I am sure I pass build id to the dynatrace and in fact I see that information in the automation overview dashlet. Jenkins output log where you see build id.

I tried to access to get test run id's by using rest API (api-docs) and it returns testrun information.

Look at below output of rest API

We see build information is available in the dynatrace but some reason it not showing up in the dashboard when you try to access it by using old rest API /rest/management/reports/create)

0 Likes 0 · ·
3smpx.png (145.1 KiB)
uozfu.png (44.3 KiB)
Sathish S. avatar image
0 Likes"
Sathish S. answered ·

I unchecked that option and restarted dynatrace server but still the same issue occurring.

Attached is the screenshot of services setting


7it4d.png (57.2 KiB)
· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Joe H. avatar image
0 Likes"
Joe H. answered ·

Sathish,

The dashboard looks good.

I see you are using v6.3. I believe your issue is that v6.3 forces REST communication to happen in HTTPS mode, but Jenkins does not like the default certificates. You can install your own certificates, however an easier solution is to disable HTTPS requirement for REST.

To do this, edit the dT Server Settings -> Services -> Management ->

Uncheck the box "Accept Authentication data only with HTTPS".

· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Sathish S. avatar image
0 Likes"
Sathish S. answered ·

Attached is the dashboard which contain test results dashlet


fw7eu.png (63.8 KiB)
· Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Sathish S. avatar image
0 Likes"
Sathish S. answered ·

I tried the test results dashboard as well but outcome remain same.

· 1 · Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Please post a picture of your Dashboard that Jenkins is configured to access.

0 Likes 0 · ·