Quantcast

How to unit test config migration in plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to unit test config migration in plugin

Łukasz Jąder
Hi,

The class names and structure will change in ssh-plugin version 2.5, and I wanted to unit test this.

Currently the config migration (to be backward compatibile) is performed by @Override of <a class="header" href="eclipse-javadoc:%E2%98%82=ssh/C:%5C/DEV%5C/maven%5C/apache-maven-3.1.1-repository%5C/org%5C/jenkins-ci%5C/main%5C/jenkins-core%5C/1.609.3%5C/jenkins-core-1.609.3.jar%3Chudson">hudson.<a class="header" href="eclipse-javadoc:%E2%98%82=ssh/C:%5C/DEV%5C/maven%5C/apache-maven-3.1.1-repository%5C/org%5C/jenkins-ci%5C/main%5C/jenkins-core%5C/1.609.3%5C/jenkins-core-1.609.3.jar%3Chudson.model">model.<a class="header" href="eclipse-javadoc:%E2%98%82=ssh/C:%5C/DEV%5C/maven%5C/apache-maven-3.1.1-repository%5C/org%5C/jenkins-ci%5C/main%5C/jenkins-core%5C/1.609.3%5C/jenkins-core-1.609.3.jar%3Chudson.model(Descriptor.class%E2%98%83Descriptor">Descriptor.load().

My questions:
1. Is using Descriptor.load() a recommended way to do config migration (backward compatibility)? Maybe there is a better way?
2. Do you know any existing plugins which have unit tests for backward compatibility code? Having an example of such would be a great start for me.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/54f746aa-683f-409c-b0dd-ceaddf4efac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to unit test config migration in plugin

Jesse Glick-4
As noted in the wiki, typically `readResolve` is used for simple migrations.

`@LocalData` is used for testing.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0PwS44jsUf9a8B6z4YHJFc3CPA7DRgRQXmtni%3DJnXhLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...