Hi all,
Been having great difficulty in trying to get browser tests to show up in Jenkins (via Jenkins plug-in).
When my tests are run, I can see the tests appear under UI-driven tests in the Test Automation dashlet. But after the build is completed in Jenkins, the dynaTrace plugin for Jenkins is unable to retrieve the tests. I don't seem to have this problem when I inject agents normally through the start-up arguments on the JUnit JVM.
Below is a screenshot of a test as reported in the Test Automation dashlet:
I know the test result data is there because I can see it from the dynaTrace server through the REST services, here's a screenshot of that:
The result would be the same each time and I get this at the end of my build:
Recording test results Build step 'Publish JUnit test result report' changed build result to UNSTABLE Sleeping for the configured delay of 20sec Verify connection to dynaTrace Server REST interface ... Connection successful, getting testruninfo for this build (2014-07-02_23-05-39) Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39 Waiting for 10 more seconds to get test run info ID from dynaTrace... 0 try out of 5 Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39 Waiting for 10 more seconds to get test run info ID from dynaTrace... 1 try out of 5 Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39 Waiting for 10 more seconds to get test run info ID from dynaTrace... 2 try out of 5 Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39 Waiting for 10 more seconds to get test run info ID from dynaTrace... 3 try out of 5 Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39 Waiting for 10 more seconds to get test run info ID from dynaTrace... 4 try out of 5 Fetching XML Report from server No testrun found for build id 2014-07-02_23-05-39
I then tried making an HTTP PUT call before running the dynaTrace goal with the following parameters:
http://btln000932.corp.ads:8020/rest/management/profiles/DV101/setmetadata?versionmajor=1&versionminor=2&versionrevision=%BUILD_NUMBER%&versionbuild=%BUILD_ID%&testname=TOM&category=uidriven
This allowed for the "additional information" to get placed in the captured test measures (where before it wasn't when it was referenced in the pom.xml).
However, what ends up happening is I get a NullPointerException when Jenkins tries to retrieve the test results.
Build step 'Publish JUnit test result report' changed build result to UNSTABLE
Sleeping for the configured delay of 20sec
Verify connection to dynaTrace Server REST interface ...
Connection successful, getting testruninfo for this build (2014-06-12_01-37-42)
Fetching XML Report from server
Got testruninfoid t10afea6c-c644-4e2e-b318-738696b926fc, continue with fetching measurements from dynaTrace Server...
parsing XML report
ERROR: Publisher com.dynatrace.jenkins.dashboard.TestAutomationRecorder aborted due to exception
java.lang.NullPointerException
at com.dynatrace.jenkins.dashboard.rest.XmlDashboardParser.parse(XmlDashboardParser.java:60)
at com.dynatrace.jenkins.dashboard.TestAutomationDataCollector.createReportFromBuild(TestAutomationDataCollector.java:54)
at com.dynatrace.jenkins.dashboard.TestAutomationRecorder.perform(TestAutomationRecorder.java:238)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724)
at hudson.model.Run.execute(Run.java:1617)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Wolfgang seems to think that it might be because the "unit" field in the XML report is empty (usually it is something like num, ms, etc.). But if I look at any of the browser test based metrics, most of them don't return back a unit (not sure if this is something wrong with my configuration, or the way it is set up). So that's why I want to see if anyone else out there has the same problem that I am having.
Thanks,
Kevin.
Build step 'Publish JUnit test result report' changed build result to UNSTABLE
Sleeping for the configured delay of 20sec
Verify connection to dynaTrace Server REST interface ...
Connection successful, getting testruninfo for this build (2014-06-12_01-37-42)
Fetching XML Report from server
Got testruninfoid t10afea6c-c644-4e2e-b318-738696b926fc, continue with fetching measurements from dynaTrace Server...
parsing XML report
ERROR: Publisher com.dynatrace.jenkins.dashboard.TestAutomationRecorder aborted due to exception
java.lang.NullPointerException
at com.dynatrace.jenkins.dashboard.rest.XmlDashboardParser.parse(XmlDashboardParser.java:60)
at com.dynatrace.jenkins.dashboard.TestAutomationDataCollector.createReportFromBuild(TestAutomationDataCollector.java:54)
at com.dynatrace.jenkins.dashboard.TestAutomationRecorder.perform(TestAutomationRecorder.java:238)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724)
at hudson.model.Run.execute(Run.java:1617)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Answer by Kevin N. ·
Guess I've stumped the forum community with this one?
We've discussed it via email, but for the reference - an updated version that handles this error gracefully is available on the plugin download page
JANUARY 15, 3:00 PM GMT / 10:00 AM ET