From ff4294ca85769418974785420a9f85df5bf64f03 Mon Sep 17 00:00:00 2001 From: kzantow Date: Tue, 8 Mar 2016 23:34:03 -0500 Subject: [PATCH] Fix failing tests --- core/src/main/java/jenkins/install/InstallUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/install/InstallUtil.java b/core/src/main/java/jenkins/install/InstallUtil.java index 5305f89923..7b71bc72e3 100644 --- a/core/src/main/java/jenkins/install/InstallUtil.java +++ b/core/src/main/java/jenkins/install/InstallUtil.java @@ -61,10 +61,8 @@ public class InstallUtil { private static final Logger LOGGER = Logger.getLogger(InstallUtil.class.getName()); - // must use something less than 1.0, as Jenkins may - // report back 1.0 if the system config page has never been saved, - // which erroneously leads to installer running - private static final VersionNumber NEW_INSTALL_VERSION = new VersionNumber("0.0.0"); + // tests need this to be 1.0 + private static final VersionNumber NEW_INSTALL_VERSION = new VersionNumber("1.0"); /** * Get the current installation state. @@ -87,6 +85,10 @@ public class InstallUtil { // Neither the top level config or the lastExecVersionFile have a version // stored in them, which means it's a new install. if (lastRunVersion.compareTo(NEW_INSTALL_VERSION) == 0) { + // Edge case: used jenkins 1 but not saved the system config page, the version is not persisted, returns 1.0 + if(!Jenkins.getInstance().getJobNames().isEmpty()) { // some jobs configured + return InstallState.UPGRADE; + } return InstallState.NEW; } -- GitLab