You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.<init>(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.<init>(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>
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
haha, I got it, so you manually update tags in features in order to upload them into one test execution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, i agree your point cucumber lacks when it compared other types of reports.
I am also facing same. Whenever I want to change test execution i have to pass to my feature file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.