summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-02 17:49:10 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-08 21:15:37 +0100
commit16264d1be3af1f8b5709a1811c4b4e58bc22762e (patch)
tree3c28735bd0e80dbcae7e1e899b0a6eb7e76cfc92
parente2bf4b506020297b7bda20d320bf4b61a4315825 (diff)
downloadsonarqube-16264d1be3af1f8b5709a1811c4b4e58bc22762e.tar.gz
sonarqube-16264d1be3af1f8b5709a1811c4b4e58bc22762e.zip
Enable upgrade tests on QA env
-rw-r--r--.cix.yml3
-rwxr-xr-xcix.sh5
-rwxr-xr-xrun-upgrade-tests.sh20
-rw-r--r--tests/upgrade/pom.xml62
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/MssqlConfig.java16
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationCall.java16
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationResponse.java16
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusCall.java16
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusResponse.java16
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/UpgradeTest.java27
-rw-r--r--tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/WsCallAndWait.java16
11 files changed, 195 insertions, 18 deletions
diff --git a/.cix.yml b/.cix.yml
index 2bf11e3f42a..7dfd294f2e2 100644
--- a/.cix.yml
+++ b/.cix.yml
@@ -15,6 +15,7 @@ RUN_ACTIVITY:
- run-db-integration-tests-mssql2014-Category3
- run-db-integration-tests-mssql2014-Category4
- run-db-integration-tests-mssql2014-Category5
+ - run-upgrade-tests-mssql2014
- run-it-released-plugins
- run-perf-tests
@@ -41,6 +42,8 @@ exclude:
SLAVE_TYPE: performance
- RUN_ACTIVITY: run-db-integration-tests-mssql2014-Category5
SLAVE_TYPE: performance
+ - RUN_ACTIVITY: run-upgrade-tests-mssql2014
+ SLAVE_TYPE: performance
- RUN_ACTIVITY: run-it-released-plugins
SLAVE_TYPE: performance
- RUN_ACTIVITY: run-perf-tests
diff --git a/cix.sh b/cix.sh
index 2a2993e308c..4dc1e6d598b 100755
--- a/cix.sh
+++ b/cix.sh
@@ -32,6 +32,11 @@ case "$RUN_ACTIVITY" in
./run-perf-tests.sh
;;
+ run-upgrade-tests-*)
+ DB_ENGINE=`echo $RUN_ACTIVITY | sed "s/run-upgrade-tests-//g"`
+ ./run-upgrade-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties"
+ ;;
+
*)
echo "unknown RUN_ACTIVITY = $RUN_ACTIVITY"
exit 1
diff --git a/run-upgrade-tests.sh b/run-upgrade-tests.sh
new file mode 100755
index 00000000000..517f52960f4
--- /dev/null
+++ b/run-upgrade-tests.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Run upgrade tests. SonarQube must be already built in order to
+# make the ZIP file available for tests.
+
+# Arguments:
+# 1. the path to Orchestrator properties file. If empty, then default values are used. Example: "file:///Users/me/orchestrator.properties"
+#
+# Example:
+# ./run-upgrade-tests.sh "Category1" "file:///Users/me/orchestrator-mysql56.properties"
+
+set -euo pipefail
+
+ORCHESTRATOR_CONFIG_URL=$1
+shift 1
+
+cd tests/upgrade
+mvn verify \
+ -Pwith-db-drivers \
+ -Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL \
+ -B -e -V $*
diff --git a/tests/upgrade/pom.xml b/tests/upgrade/pom.xml
index 9386310196e..e83be7677a4 100644
--- a/tests/upgrade/pom.xml
+++ b/tests/upgrade/pom.xml
@@ -26,6 +26,12 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.codehaus.sonar</groupId>
+ <artifactId>sonar-update-center-common</artifactId>
+ <version>1.12.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -35,11 +41,57 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc6</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>-Dsonar.runtimeVersion=${project.version} -Dmaven.localRepository=${settings.localRepository}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>with-db-drivers</id>
+ <activation>
+ <property>
+ <name>with-db-drivers</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc6</artifactId>
+ </dependency>
+ <dependency>
+ <!-- used to start previous versions of SQ on MSSQL -->
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.microsoft.sqljdbc</groupId>
+ <artifactId>sqljdbc41</artifactId>
+ <version>4.1</version>
+ <scope>system</scope>
+ <systemPath>${project.basedir}/../../sonar-application/src/main/assembly/lib/jdbc/mssql/sqljdbc41.jar
+ </systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/MssqlConfig.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/MssqlConfig.java
index ee4f01e540b..1db2e1ee8b2 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/MssqlConfig.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/MssqlConfig.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationCall.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationCall.java
index d7253c39826..5be9c81b9ad 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationCall.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationCall.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationResponse.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationResponse.java
index 09a5e0b0167..8d3f5e63663 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationResponse.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerMigrationResponse.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusCall.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusCall.java
index bb33e92aa1d..174f97df7ea 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusCall.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusCall.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusResponse.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusResponse.java
index a8ea563ea6e..c53397edb14 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusResponse.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/ServerStatusResponse.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/UpgradeTest.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/UpgradeTest.java
index 6401fa15cbb..78108ddc1a4 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/UpgradeTest.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/UpgradeTest.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;
@@ -37,16 +51,11 @@ public class UpgradeTest {
}
@Test
- public void test_upgrade_from_lts() {
+ public void test_upgrade_from_4_5_lts() {
testDatabaseUpgrade(Version.create("4.5.1"));
}
@Test
- public void test_upgrade_from_5_0() {
- testDatabaseUpgrade(Version.create("5.0.1"));
- }
-
- @Test
public void test_upgrade_from_5_2() {
testDatabaseUpgrade(Version.create("5.2"));
}
@@ -83,6 +92,10 @@ public class UpgradeTest {
private void browseWebapp() {
testUrl("/");
+ testUrl("/api/issues/search");
+ testUrl("/api/components/tree");
+ testUrl("/api/measures/component_tree?baseComponentKey=org.apache.struts%3Astruts-core");
+ testUrl("/api/qualityprofiles/search");
testUrl("/issues/index");
testUrl("/dashboard/index/org.apache.struts:struts-parent");
testUrl("/issues/search");
diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/WsCallAndWait.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/WsCallAndWait.java
index 5ae61f1815d..d4ea4bf91dd 100644
--- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/WsCallAndWait.java
+++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/WsCallAndWait.java
@@ -1,7 +1,21 @@
/*
+ * SonarQube
* Copyright (C) 2009-2016 SonarSource SA
- * All rights reserved
* mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarsource.sonarqube.upgrade;