Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Xray import cucumber test results to existing test execution giving error Edited

Hello,

 

I've been trying to import cucumber test results to an existing test execution using the REST API provided by Xray (https://confluence.xpand-it.com/display/public/XRAY/Import+Execution+Results+-+REST#ImportExecutionResults-REST-CucumberJSONresultsMultipart)  but I am not being able. It always creates a new test execution.

Is it possible for me to add to an existing test execution?

My info json file looks likes this:

{
    "fields": {
        "project": {
            "key": "MUL"
        },
        "issuetype": {
            "id": "10302"
        }
    }
}

When I run:

curl -u username:password -F info=@execution.json -F result=@resultCucumber.json https://mydomain.com/rest/raven/1.0/import/execution/cucumber/multipart

I get the follwoing error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>500</status-code><message>com.atlassian.jira.rest.v2.issue.FieldMetaBean.&lt;init&gt;(ZLjava/lang/Boolean;Lcom/atlassian/jira/issue/fields/rest/json/JsonType;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;)V</message><stack-trace>java.lang.NoSuchMethodError: com.atlassian.jira.rest.v2.issue.FieldMetaBean.&lt;init&gt;(ZLjava/lang/Boolean;Lcom/atlassian/jira/issue/fields/rest/json/JsonType;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;)V
at com.xpandit.raven.rest.internal.jira.AbstractMetaFieldBeanBuilder.a(Unknown Source)
at com.xpandit.raven.rest.internal.jira.AbstractMetaFieldBeanBuilder.build(Unknown Source)
at com.xpandit.raven.rest.internal.jira.CreateMetaFieldBeanBuilder.build(Unknown Source)
at com.xpandit.raven.rest.internal.jira.a.a(Unknown Source)
at com.xpandit.raven.rest.internal.jira.a.a(Unknown Source)
at com.xpandit.raven.rest.internal.jira.a.a(Unknown Source)
at com.xpandit.raven.rest.internal.jira.IssueInputParametersAssembler.makeCreateAssembler(Unknown Source)
at com.xpandit.raven.service.executionresult.impl.ExecutionResultImportServiceImpl.b(Unknown Source)
at com.xpandit.raven.service.executionresult.impl.ExecutionResultImportServiceImpl.a(Unknown Source)
at com.xpandit.raven.rest.internal.c.a.b(Unknown Source)
at sun.reflect.GeneratedMethodAccessor17797.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192)
at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:83)
at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:41)
at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:110)
at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:190)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at
... More errors, I had to delete due to characters limit
</stack-trace></status>

 

1 answer

1 accepted

3 votes
Answer accepted

Hi Rafael, 

To import the Execution Results to an existing Test Execution, you have to export the original cucumber feature file from the Test Execution itself. In this way, the feature file you're exporting it does the reference by a tag to the Test Execution (Test Execution issue key) that you want to import the Execution results. So, when you execute your Tests in the CI environment, the Execution results file that is being generated will also contain the tag that does the reference to the existing Test Execution and Xray will recognize it and will import the results to that Test Execution.

Best Regards, 

Team Xray 

Hi,

 

I have similar problem as author of this issue, but I am trying to import results to specific Test Execution via Jenkins plugin. I found documentation https://confluence.xpand-it.com/display/public/XRAY/Integration+with+Jenkins and there is said that if I chose "Cucumber JSON Multipart" results type, I would have an additional field named "Import to Same Test Execution" appeared. Currently this field is not available

 

Configuration

XRay for Jira: 2.2.0

Hello, Michal,

When you want to import the cucumber test results to a specific test execution you should add the test execution key to the tags field of the cucumber feature.

You can see where to add it exactly if you create a test execution manually, add the cucumber tests there and then export the test execution to cucumber. You will see that for every ".feature" file, there will be a tag with the test execution key. This tag will be in your json afterwards and then Xray will import the results to that test execution.

Hi Rafael,

 

thanks for info, I am going to test it :)

 

Don't you think that endpoint for importing Cucumber results should support test execution key? I found that JUnit and other endpoints support it as query param or key in Test Info object, but Cucumber endpoints lacks support for it?

 

In my opinion this will be valuable feature for your customers because when I would have store my feature in VCS as root repository for all features files, then I need to update them before each run if I want to upload results to single Test Execution

 

Regaards,

Michal

Unfortunately I am not a developer of Xpand-it... I'm just a guy that also struggled with this and after trying out a lot of things I discovered this hahahaha

But I don't know, they might have had a reason to do it this way.

haha, I got it, so you manually update tags in features in order to upload them into one test execution?

I think you can do that.

Initially I wanted to always update the same test execution (so I have a CI test execution). I was fetching the test execution it self, but then I found out that if I did that, I was always fetching the same test steps even though I have changed them. The test execution creates test runs of the tests (which contains the steps) so after running the test once, it would never change again.

Now I am creating a new test execution every time I merge my code into master.  I am fetching the test plan (I have a CI test plan) and running all the tests in that test plan in all branches, but the only branch that pushes the results back to Xray is the master branch. At the end, this helps a bit to see the evolution of the project in terms of the number of tests being executed.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - Spring 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

88 views 1 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you