Is branching tests the only option for system with multiple versions?
Marcee last edited by
Our system under test have schema that differs between system versions 1.0 and 2.0: new entities have been added, some have columns added. We used Hibernate to generate Java entities for both schema versions. Then, depending on which version we are testing, we are switching the classpath to those Java entities. This way we can use run the same test cases and use the same DB assertions in both 1.0 testing and 2.0. This approach resolves the problem at runtime. However, at compilation time, we got a problem: for entities that are specific only for schema 1.0, tests/assertions for schema 2.0 fail to compile; and vice versa for entities that are common and same for both schema, there is no problem. Is branching our test cases and test framework in SVN the only approach to this problem? The same way devs branches the system? That will be put additional effort on us to maintain each branch.
Store your test code in the same repository as the production code. That way they are always in sync, and you avoid the version-matching headaches.