@Test
public void test_upgrade_from_5_2() {
- testDatabaseUpgrade(Version.create("5.2"));
+ testDatabaseUpgrade(Version.create("5.2"), "3.14");
}
- private void testDatabaseUpgrade(Version fromVersion) {
- startServer(fromVersion, false);
- private void testDatabaseUpgrade(Version fromVersion, String javaVersion, BeforeUpgrade... tasks) {
++ private void testDatabaseUpgrade(Version fromVersion, String javaVersion) {
+ startServer(fromVersion, javaVersion, false);
scanProject();
int files = countFiles(PROJECT_KEY);
assertThat(files).isGreaterThan(0);
- for (BeforeUpgrade task : tasks) {
- task.execute();
- }
-
stopServer();
// latest version
- startServer(Version.create(Orchestrator.builderEnv().getSonarVersion()), true);
+ startServer(Version.create(Orchestrator.builderEnv().getSonarVersion()), "LATEST_RELEASE", true);
checkSystemStatus(ServerStatusResponse.Status.DB_MIGRATION_NEEDED);
+ checkUrlsBeforeUpgrade();
+
upgradeDatabase();
checkSystemStatus(ServerStatusResponse.Status.UP);
+ checkUrlsAfterUpgrade();
assertThat(countFiles(PROJECT_KEY)).isEqualTo(files);
scanProject();