reportportal / agent-java-junit

Report Portal agent for JUnit 4
Apache License 2.0
11 stars 17 forks source link

Maven test execution fails if specifying test suite #7

Closed talmoshe closed 5 years ago

talmoshe commented 6 years ago

I'm using the example in https://github.com/reportportal/example-java-junit

when running the below it's working fine C:\Users\talm\git\example-java-junit\v4>mvn test

Also the below works fine: C:\Users\talm\git\example-java-junit\v4>mvn -Dtest=TestIssue4 test

This execution fails: C:\Users\talm\git\example-java-junit\v4>mvn -Dtest=SimpleTestSuite1 test

[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.epam.rp.tests.SimpleTestSuite1
2018-06-17 14:14:06,265 [main] ERROR com.epam.reportportal.junit.ParallelRunningHandler - Unable start test suite: 'null'
com.epam.reportportal.exception.ReportPortalClientException: Report Portal returned error
Status code: 400
Status message: Bad Request
Error Message: Incorrect Request. [Field 'name' shouldn't be null.]
Error Type: INCORRECT_REQUEST
Stack Trace:
at com.epam.reportportal.service.ReportPortalErrorHandler.handleClientError(ReportPortalErrorHandler.java:47)
at com.epam.reportportal.restclient.endpoint.DefaultErrorHandler.handle(DefaultErrorHandler.java:73)
evjlobanova commented 6 years ago

@avarabyeu Andrei, please take a look on this issue?

talmoshe commented 6 years ago

@avarabyeu did you reproduce the issue? Do you need any other info?

Malahovskys commented 6 years ago

Full stack trace:

2018-07-10 15:25:23,699 [main] ERROR com.epam.reportportal.junit.ParallelRunningHandler - Unable start test suite: 'null'
com.epam.reportportal.exception.ReportPortalClientException: Report Portal returned error
Status code: 400
Status message: Bad Request
Error Message: Incorrect Request. [Field 'name' shouldn't be null.] 
Error Type: INCORRECT_REQUEST
Stack Trace: 
    at com.epam.reportportal.service.ReportPortalErrorHandler.handleClientError(ReportPortalErrorHandler.java:47)
    at com.epam.reportportal.restclient.endpoint.DefaultErrorHandler.handle(DefaultErrorHandler.java:73)
    at com.epam.reportportal.restclient.endpoint.DefaultErrorHandler.handle(DefaultErrorHandler.java:40)
    at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.executeInternal(HttpClientRestEndpoint.java:341)
    at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.post(HttpClientRestEndpoint.java:106)
    at com.epam.reportportal.service.ReportPortalService.startTestItem(ReportPortalService.java:246)
    at com.epam.reportportal.service.ReportPortalService.startRootTestItem(ReportPortalService.java:226)
    at com.epam.reportportal.junit.ParallelRunningHandler.startSuiteIfRequired(ParallelRunningHandler.java:186)
    at com.epam.reportportal.junit.ReportPortalListener.testStarted(ReportPortalListener.java:58)
    at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
    at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
    at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
    at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
    at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
    at com.epam.reportportal.junit.CustomJUnitRunner.runChild(CustomJUnitRunner.java:86)
    at com.epam.reportportal.junit.CustomJUnitRunner.runChild(CustomJUnitRunner.java:43)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at com.epam.rp.tests.MyCustomJUnitRunner.run(MyCustomJUnitRunner.java:58)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
2018-07-10 15:25:23,792 [main] ERROR com.epam.reportportal.junit.ParallelRunningHandler - Unable start test: 'com.epam.rp.tests.TestIssue4'
com.epam.reportportal.exception.ReportPortalClientException: Report Portal returned error
Status code: 404
Status message: Not Found
Error Message: Launch '' not found. Did you use correct Launch ID?
Error Type: LAUNCH_NOT_FOUND
Stack Trace: 
    at com.epam.reportportal.service.ReportPortalErrorHandler.handleClientError(ReportPortalErrorHandler.java:47)
    at com.epam.reportportal.restclient.endpoint.DefaultErrorHandler.handle(DefaultErrorHandler.java:73)
    at com.epam.reportportal.restclient.endpoint.DefaultErrorHandler.handle(DefaultErrorHandler.java:40)
    at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.executeInternal(HttpClientRestEndpoint.java:341)
    at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.post(HttpClientRestEndpoint.java:106)
    at com.epam.reportportal.service.ReportPortalService.startTestItem(ReportPortalService.java:246)
    at com.epam.reportportal.junit.ParallelRunningHandler.starTestIfRequired(ParallelRunningHandler.java:248)
    at com.epam.reportportal.junit.ReportPortalListener.testStarted(ReportPortalListener.java:59)
    at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
    at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
    at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
    at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
    at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
    at com.epam.reportportal.junit.CustomJUnitRunner.runChild(CustomJUnitRunner.java:86)
    at com.epam.reportportal.junit.CustomJUnitRunner.runChild(CustomJUnitRunner.java:43)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at com.epam.rp.tests.MyCustomJUnitRunner.run(MyCustomJUnitRunner.java:58)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
talmoshe commented 6 years ago

@avarabyeu any chance you can have a look at the issue?

DzmitryHumianiuk commented 6 years ago

@sbabcoc is it addressed by your recent PR? https://github.com/reportportal/agent-java-junit/pull/8

DzmitryHumianiuk commented 6 years ago

@pbortnik can you take a look shortly

sbabcoc commented 6 years ago

@DzmitryHumianiuk The updates in PR #8 should resolve this issue. The integration steps are different, documented in the updated README.

talmoshe commented 6 years ago

@sbabcoc @DzmitryHumianiuk @avarabyeu Any update on the fix?

sbabcoc commented 6 years ago

Yes, there's a v4 branch of this project that contains a new agent based on the JUnit Foundation library. @DzmitryHumianiuk Has a new artifact been published from this branch?

DzmitryHumianiuk commented 6 years ago

@avarabyeu can make it. But he is on vacation right now.

@talmoshe could you try it by downloading the full v4 branch?

sbabcoc commented 6 years ago

Be sure to follow the configuration steps in the README. In order to generate the notifications it adds, the JUnit Foundation library needs to add hooks to a few JUnit classes, which requires the use of a Java agent. I documented the process for Maven and Gradle projects, but I know that there are other Java project build tools out there.

talmoshe commented 6 years ago

I confirm that the v4 branch is working as expected in terms of executing a suite of classes

sbabcoc commented 5 years ago

Can this issue be closed?

DzmitryHumianiuk commented 5 years ago

I expect review by @akoltochihin to be completed.

by if v4 branch resolves this issue, then it can be close