serenity-bdd / serenity-jira

14 stars 27 forks source link

Only the last Jira Issue is updated when running multiple feature files #79

Closed patrickmarchitto closed 6 years ago

patrickmarchitto commented 6 years ago

When running multiple Cucumber feature files with CucumberWithSerenity and maven clean verify only the feature which was executed lastly is updated with comment and transition. At the beginning of the log files I can see for each feature:

2888 DEBUG n.s.plugins.jira.JiraUpdater: JIRA LISTENER STATUS
2889 DEBUG n.s.plugins.jira.JiraUpdater: JIRA URL: https://jira.xxx.com 
2889 DEBUG n.s.plugins.jira.JiraUpdater: REPORT URL: https://jenkins.xxx.com
2890 DEBUG n.s.plugins.jira.JiraUpdater: WORKFLOW ACTIVE: true 
2890 DEBUG n.s.p.jira.zephyr.ZephyrUpdater: ZEPHYR ACTIVE: false

After each test has been executed the log file says

695588 DEBUG n.s.plugins.jira.JiraUpdater: WORKFLOW TRANSITIONS: [FAILURE:[Test Ready:[Test Failed]], ERROR:[Test Ready:[Test Failed]], COMPROMISED:[Test Ready:[Test Failed]], SKIPPED:[Test Ready:[Test Failed]], PENDING:[Test Ready:[Test Failed]], UNDEFINED:[Test Ready:[Test Failed]], SUCCESS:[Assigned - ready to start:[Start Work], In Review:[Pull Request accepted], In Progress:[Resolve issue], Open:[Assign]]]

which are the transisition specified in my workflow.groovy file. But only for the last feature I can see:

11849315 INFO  n.s.plugins.jira.JiraUpdater: Updating JIRA issue: XXX-123
11849315 INFO  n.s.plugins.jira.JiraUpdater: JIRA server: Connection to JIRA instance at https://jira.xxx.com with user user.name
11849315 INFO  n.s.plugins.jira.JiraUpdater: Updating comments for issue XXX-123
11849315 INFO  n.s.plugins.jira.JiraUpdater: WIKI Rendering activated: true
11850693 INFO  n.s.plugins.jira.JiraUpdater: Updating status for issue XXX-123 with test result FAILURE
11851871 INFO  n.s.plugins.jira.JiraUpdater: Issue XXX-123 currently has status 'Test Ready'
11851871 INFO  n.s.plugins.jira.JiraUpdater: Found transitions [Test failed] for issue XXX-123

The status of XXX-123 is changed correctly and the comment also works. All requirements are loaded and linked correctly in the generated report, so I don't know why auto-workflow and comment is not working for all other features. If other information is needed, please let me know.

wakaleo commented 6 years ago

From memory it could be the way the JIRA plugin handles churn (if an issue is included in many failing tests, it only updates it once to avoid network traffic - the JIRA API is very slow). Your best bet would be to look at the code in the plugin (it's quite a small module) and seeing if you need to tweak something to make it work better for your use case.

patrickmarchitto commented 6 years ago

We found a way to get this working. We are using the fork option of Surefire to execute our tests in parallel and with the cucumber-jvm-parallel-plugin every feature file gets its own TestRunner. This way, all issues for each feature gets updated correctly. I could not find the cause of our primal problem in the code but thank you for you answer. This issue can be closed from my side.

garyliwc commented 6 years ago

Hi, I got the same issue, which is only updating the last Jira issue when executing multiple feature files. Can someone please help share a bit more on the handling? Thanks.