cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

dT 6.2 Testrun creation via REST not working

thomas_falkenb1
Participant

Hi,

using dT 6.2.0.1238 the creation of testruns via REST doesn't seem to work:

I get a valid response back but the testrun can't be found via GET and the testautomation dashlets don't show anything when sending the appropriate header with the tests.

I tried creating testruns via SoapUI, via Postman and eventually via http://<dtServer>:8020/api-docs/index.html#!/management/createTestRun using XML and JSON.The result is always the same. 

Sample POST:

POST http://<dtServer>:8020/rest/management/profiles/CI/testruns HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
accept: application/json
Content-Length: 125
Host: <dtServer>:8020
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Authorization: Basic YWRtaW46YWRtaW4=

{
    "category": "webapi",
    "platform": "linux_x64",
    "versionBuild": "3.2.8",
    "versionRevision": "802518"     
}

Response
{"testRun": {
   "category": "webapi",
   "href": "http://<dtServer>:8020/rest/management/profiles/CI/testruns/381c9959-98c6-4897-8eaf-558cf6263c57",
   "id": "381c9959-98c6-4897-8eaf-558cf6263c57",
   "numDegraded": 0,
   "numFailed": 0,
   "numImproved": 0,
   "numInvalidated": 0,
   "numPassed": 0,
   "numVolatile": 0,
   "platform": "linux_x64",
   "systemProfile": "CI",
   "versionBuild": "3.2.8",
   "versionRevision": "802518"
}}

Notice the missing creationTime key in the response as described here https://community.dynatrace.com/community/display/DOCDT62/REST+Interfaces+for+Test+Automation

A GET to http://<dtServer>:8020/rest/management/profiles/CI/testruns.json/ returns no testruns:

{"message":"No test metadata was set or no testrun occurred between 1970-01-01T01:00:00 (timestamp: 0) and 2015-07-02T17:26:04 (timestamp: 1435850764109) with additional parameters: null","testRuns":[]}

Any help would be appreciated.

Thanks
Thomas

 

 

 

17 REPLIES 17

thomas_falkenb1
Participant

Update: Similar behavior in dT 6.1, only difference is that "creationTime" is returned.
I'm using a Test Center license and I don't find any errors in the dT Server logs.

florent_duchate
Dynatrace Pro
Dynatrace Pro

Hi  Thomas

I have installed 6.2 and tried to replicate your scenario. It is working fine for me.

All the required steps are documented here:

Integrate Web API Performance Monitoring in SoapUI

I could see my test in the test automation dashlet and the rest call worked too.

I wonder if you are missing the testrunid header in your test harness as it must be there for this to work.

Regards

 

Flo

Hi Flo,

thank you for trying to replicate. I followed all the steps in the documentation and verified the headers are in place. In order to narrow the issue down, I dropped SoapUI and just tried a POSTs and a GETs to see if testruns are stored in dT at all and that already doesn't seem to work for me.

If you do a POST and a subsequent GET on ../testruns do you get a result back? This is already failing for me so I don't think it is related to the test harness.

Regards
Thomas

thomas_falkenb1
Participant

In REST Interfaces for Test Automation I just found this:

A test run is listed if at least one test (method) is executed in the specified timeframe

So my approach to find the issue doesn't work. Will check again to send tests with Soap UI with the X-dynaTrace header containing TR.

That's correct, currently /testruns endpoint responds to GET request with a list of test runs that had at least a single test execution. It may not be too intuitive (taking REST guidelines into the account), so we'll be working to change that (probably in the next release). The plan is to make /testruns respond with all registered test runs and allow easy filtering if client wants to receive only those that had test executions.

Best regards,
Wiktor Bachnik

florent_duchate
Dynatrace Pro
Dynatrace Pro

Hi

yes, that's what I was going to suggest. You must run tests to see something. The way the system works is by tagging purepaths/requests but if there aren't any then you won't see anything on the dashlet.

I ran a quick test without soapui and it worked fine. I called the POST testruns directly with chrome, extracted manually the id. I then ran fiddler in breakpoint mode and I called my web service. Fiddler held the request. I then added a X-Dynatrace header with the testrunid and pressed play. I could see the test fine in the dashlet. See screenshot. The first test was executed via soapUI and the second manually via the browser.

I hope this helps.

 

Flo

thomas_falkenb1
Participant

Still not working (sad)

I see there is a different behavior when I provide NA+TR in the header or TN (+TR/RC, doesn't matter).
This header "X-dynaTrace: NA=TestEnrollMember ;TR=a05b88b0-0270-4dd1-873c-59925141adea" gives me at least a tagged request in dynaTrace and I get dynatrace headers back in the response:

X-dynaTrace: PT=549;PA=1983121591;SP=CI;PS=-2113336576
dynaTrace: PT=549;PA=1983121591;SP=CI;PS=-2113336576

When providing this header: "X-dynaTrace: TN=TestEnrollMember;TR=83f037d6-c74c-4e03-b74b-55b4e1cf0b29"

I don't get any dynaTrace header in the response at all. Same behavior when I just send this header: "X-dynaTrace: TN=TestEnrollMember"

In all cases I get the correct PurePaths. In the Servlet Details TN=TestEnrollMember shows up under "HTTP Tag: " In Web Request Details and not under Request Headers, same with the NA+TR headers. So the header is being sent correctly in all cases.

Nothing shows up in Test Results / Test Overview dashlets.

thomas_falkenb1
Participant

I just used a System Profile I created from scratch to make sure no sensor setting can be the culprit. Still same behavior.
Could it have anything to do with my license? In a Development Edition I saw there was some option for CI in the system profile settings. I do not see this with my Test Center license.

florent_duchate
Dynatrace Pro
Dynatrace Pro

first let me answer your previous post. The x-Dynatrace header you see in the response is used for internal purposes and you can ignore it. If you are really curious it is what we use to link the various application tiers together so it has nothing to do with the execution of tests.

So it now looks like you are seeing purepaths and that they are tagged properly but you cannot see anything in the test automation dashlet. This feature should only be available with the test centre edition so which license are you using right now?

 

I am using a Test Center Edition.

 

Hi Flo,

Not entirely relevant to this problem, however: the X-Dynatrace header is not only for internal purposes.

It allows us to tag web requests with test names, virtual users, geographical regions etc.

Integrations with LoadRunner and jMeter for example use this (on top of the above mentioned integration using a test-run id) in the "Tagged Web Requests" dashlet.

More information: https://community.dynatrace.com/community/display/DOCDT62/Integration+with+Web+Load+Testing+and+Moni....

KR,
Kristo 

thomas_falkenb1
Participant

Just realized I even get this when I provide NA+TR (not when I provide TN) in servlet details:

Still nothing in Test Automation Dashlet.

florent_duchate
Dynatrace Pro
Dynatrace Pro

some dashlets can freeze and not show the right data after a while. Could you try to close it down and re-open it in a new dashboard? Change the time window to 1 hour as it defaults to 30 days.

Tried all of that before, no difference. Also restarted client.
Also the default is 30 minutes for me for some reason.

florent_duchate
Dynatrace Pro
Dynatrace Pro

it is defaulting to 30 minutes because you have already a dashboard with those settings and they are inherited. It would default to 30 days if you where to open the test results dashlet in its own dashboard.

I'm sorry but I can't replicate your issue here. I even created the same dashboard as you have and it is fine for me.It really looks as if the license isn't working properly and blocks the feature.

I think you might want to raise a support ticket for this.

 

thomas_falkenb1
Participant

Ok, thanks.

I have created SUPDT-10676 already some hours ago.

thomas_falkenb1
Participant

The issue was resolved by connecting to an performance warehouse (Oracle DB) - I assumed the Server used the embedded warehouse but this was not the case.

IMHO the POST should fail if no perf warehouse is connected.