Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best/proper way to test ActiveObjectsUpgradeTask classes?

Ricardo Herrera March 16, 2023

Hello community, our plugin uses some ActiveObjectsUpgradeTask classes to migrate our data from one version of the connector to the next one.

We would like to have some automated tests to ensure they will run as expected when the plugin is upgraded as recommended in this official document. This document, however, misses specifying a recommended way, technique, or API for doing so.

Isn't there anything similar to the integration tests that can help to accomplish this?

Otherwise, what would be the preferable way of doing it, considering we would like to cover all supported DB engines by Jira?

1 answer

1 accepted

0 votes
Answer accepted
Aron Gombas _Midori_
Community Champion
March 17, 2023

We were in the same situation many years ago, and we tested it manually. You can enforce a migration by:

  1. stopping Jira
  2. setting the schema version to the "old version" in the database
  3. starting Jira

Upgrade tasks are "debuggable" like any other piece of code. We also wrote some basic  tests with mocked dependencies and also added consistency checks. For example, we compared the data in the source with the data in the target and threw an exception if they didn't match.

It worked well, ,but it was a long time ago.

Ricardo Herrera March 17, 2023

Thanks, @Aron Gombas _Midori_ !

Suggest an answer

Log in or Sign up to answer