reportportal / agent-Python-RobotFramework

Robot Framework integration for Report Portal
Apache License 2.0
59 stars 33 forks source link

Variable RP_LAUNCH_UUID is required for execution #152

Closed oferdan closed 2 years ago

oferdan commented 2 years ago

Describe the bug Variable should be optional but is required (even without Pabot) --variable RP_LAUNCH_UUID:""

Steps to Reproduce Execute test with required variables: robot -d results --listener robotframework_reportportal.listener --variable RP_UUID:"xYxYxYxYxYxYxYxYxY" --variable RP_ENDPOINT:"http://localhost:8080" --variable RP_LAUNCH:"dev_test" --variable RP_PROJECT:"default_personal" -t"Test decision" tests/dev_test.robot

Expected behavior Listener is sending results to the Report Portal

Actual behavior Getting error from Robot Framework:

[ ERROR ] Calling method 'start_suite' of listener 'robotframework_reportportal.listener' failed: TypeError: type object got multiple values for keyword argument 'mode' [ WARN ] start_test_item - invalid response: {'errorCode': 4001, 'message': "Incorrect Request. [Field 'launchUuid' should not be null.] "} [ WARN ] Attempt to start item for non-existent parent item [ WARN ] start_test_item - invalid response: {'errorCode': 4001, 'message': "Incorrect Request. [Field 'launchUuid' should not be null.] "} [ WARN ] Attempt to finish non-existent item [ WARN ] Attempt to finish non-existent item [ WARN ] Attempt to start item for non-existent parent item [ WARN ] start_test_item - invalid response: {'errorCode': 4001, 'message': "Incorrect Request. [Field 'launchUuid' should not be null.] "} .... [ ERROR ] Calling method 'end_suite' of listener 'robotframework_reportportal.listener' failed: IndexError: pop from empty list

Error in Docker:

reportportal-api-1 | 2022-09-26 09:27:39.267 ERROR 1 --- [cTaskExecutor-1] c.e.t.r.w.rabbit.AsyncReportingListener : exception : com.epam.ta.reportportal.exception.ReportPortalException, message : Launch '1' not found. Did you use correct Launch ID?, cause : reportportal-api-1 | 2022-09-26 09:27:39.268 WARN 1 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed. reportportal-api-1 | reportportal-api-1 | org.springframework.amqp.rabbit.support.ListenerExecutionFailedException: Listener threw exception reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:1693) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1639) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1509) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1486) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:1477) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1421) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:963) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:913) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:81) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.mainLoop(SimpleMessageListenerContainer.java:1284) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1190) reportportal-api-1 | at java.base/java.lang.Thread.run(Thread.java:829) reportportal-api-1 | Caused by: org.springframework.amqp.AmqpRejectAndDontRequeueException: null reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onMessage(AsyncReportingListener.java:186) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1635) reportportal-api-1 | ... 10 common frames omitted reportportal-api-1 | Caused by: com.epam.ta.reportportal.exception.ReportPortalException: Launch '1' not found. Did you use correct Launch ID? reportportal-api-1 | at com.epam.ta.reportportal.core.launch.impl.FinishLaunchHandlerImpl.lambda$finishLaunch$0(FinishLaunchHandlerImpl.java:72) reportportal-api-1 | at java.base/java.util.Optional.orElseThrow(Optional.java:408) reportportal-api-1 | at com.epam.ta.reportportal.core.launch.impl.FinishLaunchHandlerImpl.finishLaunch(FinishLaunchHandlerImpl.java:72) reportportal-api-1 | at com.epam.ta.reportportal.core.launch.impl.FinishLaunchHandlerImpl$$FastClassBySpringCGLIB$$ec54b939.invoke() reportportal-api-1 | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) reportportal-api-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) reportportal-api-1 | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) reportportal-api-1 | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) reportportal-api-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) reportportal-api-1 | at com.epam.ta.reportportal.core.launch.impl.FinishLaunchHandlerImpl$$EnhancerBySpringCGLIB$$95fb5c0f.finishLaunch() reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onFinishLaunch(AsyncReportingListener.java:198) reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onMessage(AsyncReportingListener.java:140) reportportal-api-1 | ... 11 common frames omitted reportportal-api-1 |

Package versions Python 3.7.3 Report Portal: Build: 5.7.2 robotframework 5.0.1 robotframework-reportportal 5.3.0 reportportal-client 5.2.4

Additional context If I add RP_LAUNCH_UUID then it is not printing any error, but Report Portal doesn't know about this UUID --variable RP_LAUNCH_UUID:"1"

Error in Docker:

reportportal-api-1 | 2022-09-26 09:25:38.507 DEBUG 1 --- [cTaskExecutor-1] c.e.t.r.w.rabbit.AsyncReportingListener : exception : com.epam.ta.reportportal.exception.ReportPortalException, message : Test Item '93091c64-11db-4309-ac94-ab135aea5847' not found. Did you use correct Test Item ID?, cause : reportportal-api-1 | 2022-09-26 09:25:38.507 WARN 1 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed. reportportal-api-1 | reportportal-api-1 | org.springframework.amqp.rabbit.support.ListenerExecutionFailedException: Listener threw exception reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:1693) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1639) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1509) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1486) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:1477) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1421) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:963) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:913) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:81) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.mainLoop(SimpleMessageListenerContainer.java:1284) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1190) reportportal-api-1 | at java.base/java.lang.Thread.run(Thread.java:829) reportportal-api-1 | Caused by: org.springframework.amqp.AmqpRejectAndDontRequeueException: null reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onMessage(AsyncReportingListener.java:186) reportportal-api-1 | at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1635) reportportal-api-1 | ... 10 common frames omitted reportportal-api-1 | Caused by: com.epam.ta.reportportal.exception.ReportPortalException: Test Item '93091c64-11db-4309-ac94-ab135aea5847' not found. Did you use correct Test Item ID? reportportal-api-1 | at com.epam.ta.reportportal.core.item.impl.FinishTestItemHandlerImpl.lambda$finishTestItem$1(FinishTestItemHandlerImpl.java:143) reportportal-api-1 | at java.base/java.util.Optional.orElseThrow(Optional.java:408) reportportal-api-1 | at com.epam.ta.reportportal.core.item.impl.FinishTestItemHandlerImpl.lambda$finishTestItem$2(FinishTestItemHandlerImpl.java:143) reportportal-api-1 | at java.base/java.util.Optional.orElseGet(Optional.java:369) reportportal-api-1 | at com.epam.ta.reportportal.core.item.impl.FinishTestItemHandlerImpl.finishTestItem(FinishTestItemHandlerImpl.java:141) reportportal-api-1 | at com.epam.ta.reportportal.core.item.impl.FinishTestItemHandlerImpl$$FastClassBySpringCGLIB$$a8a02107.invoke() reportportal-api-1 | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) reportportal-api-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) reportportal-api-1 | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) reportportal-api-1 | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) reportportal-api-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) reportportal-api-1 | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) reportportal-api-1 | at com.epam.ta.reportportal.core.item.impl.FinishTestItemHandlerImpl$$EnhancerBySpringCGLIB$$acdde439.finishTestItem() reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onFinishItem(AsyncReportingListener.java:213) reportportal-api-1 | at com.epam.ta.reportportal.ws.rabbit.AsyncReportingListener.onMessage(AsyncReportingListener.java:155) reportportal-api-1 | ... 11 common frames omitted reportportal-api-1 |
oferdan commented 2 years ago

Reference: https://github.com/reportportal/agent-Python-RobotFramework/issues/113 https://github.com/reportportal/agent-Python-RobotFramework/issues/115#issuecomment-849722490

egorse commented 2 years ago

I am using next but as well can not get launch registered

robot \
    --listener robotframework_reportportal.listener \
    --variable RP_UUID:"db06db83-07d4-4103-b115-c7ff7c93701e" \
    --variable RP_ENDPOINT:"http://127.0.0.1:8080" \
    --variable RP_LAUNCH:"launch-$(now.sh)" \
    --variable RP_LAUNCH_UUID:"$(uuid)" \
    --variable RP_PROJECT:"default_personal" \
    .
egorse commented 2 years ago

Current workarround seems pip install robotframework-reportportal==5.2.2, then you need no launch uuid and launch gets registered

HardNorth commented 2 years ago

Hmm, looks like this issue https://github.com/reportportal/client-Python/issues/195 affects people wider than I expected.

Then I release new Client version 5.2.5, this should fix the issue.

Thank you!