I'm currently managing a large JIRA instance that has a large number of groovy scripts to enforce particular business process etc. Every time a change is made myself and others have to spend a large amount of time manually testing changes and it's leading to alot of human error (easy to miss edge cases etc).
Some of the scripts also need to be bulletproof because business effectively would stop if they broke, so I need a robust, consistent way to confirm they do what they're supposed to and that changes don't have unintended consequences.
I was wondering if it's possible to build unit, functional & regression tests for groovy scripts that run inside the Script Runner & Behaviours plugins? Not sure if it really makes any difference but the scripts are a mix of scripted event listeners, post functions and field validators, with a small amount of data being pulled from an external database.
Agree with Bob although not necessarily about the mechanism. Personally, I have a maven dev profile that includes junit and spock, and it will search out unit tests so they can be run from within jira. I've tried many approaches including mocking, and the SDKs own integration test runner, and imho this is by far the fastest for development as it doesn't require any plugin compilation and upload.
These also include tests that do as Bob suggest, create issue, move through workflow etc. Where possible I test without that baggage though.
I might look into making this available if it might be helpful. The reason why I haven't is because including junit, spock, geb and webdriver makes the plugin much chunkier.
But you could just write a groovy script that drives an issue through the workflow, and test the expected outcomes at each point, being sure to test the edge cases you're talking about. You'd then run this from the admin console after making changes. Not ideal but better than nothing.
It is much easier to run integration tests on a test instance (or at least test projects) than worring about the insides of various plugins etc... You want to ensure the business process works no matter whether it is a plugin or configuration issue. For instance, creating issues and moving them through the work flow. GINT - Groovy Integration Test Framework is ideal for that. I have thousands of tests done this way for my plugins and a few hundred of those are for JIRA workflow testing. For workflow testing, at example would be: Create an issue with various field values, progress it through a workflow step, and retrieve the issue to verify it has the correct values using the built-in automatic comparisons. Repeat through other workflow steps. It is a bit of an investment in time to implement some good tests that check the things you care about in your environment, but, once that is in place, it makes life a lot easier for configuration changes and upgrades.
Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot