Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

results.xml sample #12

Open
sebalanfranco opened this issue Oct 31, 2016 · 9 comments
Open

results.xml sample #12

sebalanfranco opened this issue Oct 31, 2016 · 9 comments

Comments

@sebalanfranco
Copy link

sebalanfranco commented Oct 31, 2016

I´m getting the following error when I try to upload results to TestRail using this plugin. Could you please just provide a sample of the results.xml accepted by the plugin so we base on it to generate ours?

Started by user anonymous
Building in workspace /Users/sebastianlanfranco/TestRail-Jenkins-plugin/testrail-jenkins-plugin/work/workspace/automation
Munging test result files.
Scanning /var/folders/gz/pd5vv6rn27n6p5cvz52hk1c40000gn/T/hudson6821838021987083694tmp
processing hudson6821838021987083694tmp
processing results.xml
ERROR: Publisher testrail.testrail.TestRailNotifier aborted due to exception
org.json.JSONException: JSONObject["title"] not found.
	at org.json.JSONObject.get(JSONObject.java:473)
	at org.json.JSONObject.getString(JSONObject.java:654)
	at testrail.testrail.TestRailClient.createCaseFromJson(TestRailClient.java:264)
	at testrail.testrail.TestRailClient.addCase(TestRailClient.java:278)
	at testrail.testrail.TestRailObjects.ExistingTestCases.addCase(ExistingTestCases.java:112)
	at testrail.testrail.TestRailNotifier.addSuite(TestRailNotifier.java:172)
	at testrail.testrail.TestRailNotifier.perform(TestRailNotifier.java:123)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
	at hudson.model.Build$BuildExecution.post2(Build.java:183)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
	at hudson.model.Run.execute(Run.java:1757)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:234)
Finished: FAILURE
@sebalanfranco
Copy link
Author

@xirsoi or @szymonh sorry to bother you guys, do you have any results.xml sample since I´m getting some errors when trying to upload mine and there is not documentation about this plugin. Thanks in advance.

@xirsoi
Copy link
Contributor

xirsoi commented Nov 15, 2016

@sebalanfranco no problem, happy to help. The xml that the plugin accepts must comply with the xUnit Schema. Here's a very simple example:

`






`

@xirsoi
Copy link
Contributor

xirsoi commented Nov 15, 2016

Not sure why that wasn't formatted correctly...

EDIT: Just want to point out that that example is ridiculously simple. In the case of a fail, block, or error you would also include a message tag, which gives the reason for the failure/block/error.

@sebalanfranco
Copy link
Author

sebalanfranco commented Nov 16, 2016

Thank you @xirsoi for your answer!
I really appreciate it. I find this plugin very helpful but I cannot get it working.

I´m still getting this error:

processing results.xml
ERROR: Publisher testrail.testrail.TestRailNotifier aborted due to exception
org.json.JSONException: JSONObject["title"] not found.
    at org.json.JSONObject.get(JSONObject.java:473)
    at org.json.JSONObject.getString(JSONObject.java:654)
    at testrail.testrail.TestRailClient.createCaseFromJson(TestRailClient.java:264)
    at testrail.testrail.TestRailClient.addCase(TestRailClient.java:278)
    at testrail.testrail.TestRailObjects.ExistingTestCases.addCase(ExistingTestCases.java:112)
    at testrail.testrail.TestRailNotifier.addSuite(TestRailNotifier.java:172)
    at testrail.testrail.TestRailNotifier.perform(TestRailNotifier.java:123)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
    at hudson.model.Run.execute(Run.java:1757)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Finished: FAILURE

@xirsoi
Copy link
Contributor

xirsoi commented Nov 16, 2016

This appears to be an error related to creating new Test Cases in TestRail based on your test results. TestRail isn't responding with the data expected. I would double check the credentials you configured the plugin with (in Jenkins' Global Settings). Make sure the user you gave has permissions to create new test cases.

@achikin
Copy link
Owner

achikin commented Nov 17, 2016

Hi guys. Sorry for not responding for a while. I'm not working with TestRail anymore, so it's hard for me to figure out the issues. If you willing to take over the pluging improvement/bugfixing - please feel free to do it.

@xirsoi
Copy link
Contributor

xirsoi commented Nov 18, 2016

I'd be willing to contribute more heavily. My company isn't using this plugin as a solution anymore, but we are still using TestRail and sending results to it, so I have some familiarity with the API.

@sebalanfranco
Copy link
Author

Thank you @xirsoi ! I'll double check my credentials on TestRail and I'll back to you if you don't mind.
No problem @achikin, thank you anyway. May I keep this issue open until I get a solution or find the root cause of my issue?

@xirsoi
Copy link
Contributor

xirsoi commented Nov 18, 2016

Make sure to also check the permissions for the TestRail user you've created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants