0

In our company, we have large ear files to which developer groups contribute jars. This is a many-to-many relation, where each ear has 30-50 jars and some of the jars are within 10 or more ear files.

We are thinking about introducing more automatic testing to move in the direction of CI. Integration tests usually happen on the ear level, not for individual jars.

So my dilemma is as follows: When a developer checks in code, the CI server builds and unit-tests his jar. Then, there would be the need for integration tests. How should I handle this?

  • I could build the jar as SNAPSHOT and then trigger a SNAPSHOT build for the ear(s) as well. This is nice and easy, but SNAPSHOT builds are really only for development and should not be promoted to a release stage.

  • I could construct a minimal test ear for each group of jars. If a jar is built, the test ear dependency list is updated with the newest version number and then built. These tests would be meaningful, but they would not test the "real" ears, just test ears.

  • I could automatically update dependencies in the real ears, which could confuse people.

Any ideas?

  • Do you use any build automation tools (Maven, Gradle, etc.)? In your case you should test based on released jars except the one you're changing at the moment. After your test pass successfuly you can release your component (jar and whole ear) and the process can continue for other team/s. It is also easier to test locally because you know with what components (jars) you're testing. – Tomasz Maciejewski Mar 22 '17 at 9:38
  • @kadiii We use Maven. Actually, I don't understand your approach: If somebody changes a jar, we need to test if that change breaks anything. For a reasonable integration test, we need a whole set of jars (or the ear which contains them). – J. Fabian Meier Mar 22 '17 at 9:50
  • Let's assume you have 3 jars within your ear. After releasing A, B and C - A-1.0.0, B-1.0.0, C-1.0.0. Then you implement changes in A-1.0.1-SNAPSHOT. You commit your changes and your CI tool builds ear from A-1.0.1-SNAPSHOT, B-1.0.0, C-1.0.0. If the tests pass you release A and have now A-1.0.1. – Tomasz Maciejewski Mar 22 '17 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.