diff options
76 files changed, 138 insertions, 220 deletions
diff --git a/.travis.yml b/.travis.yml index 921480a0f93..508a145b9c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,8 @@ script: ./travis.sh env: - TARGET=CI - - TARGET=IT IT_CATEGORY=Category1 - - TARGET=IT IT_CATEGORY=Category2 - - TARGET=IT IT_CATEGORY=Category3 - - TARGET=IT IT_CATEGORY=Category4 - - TARGET=IT IT_CATEGORY=Category5 - TARGET=WEB - matrix: fast_finish: true @@ -21,8 +15,8 @@ cache: directories: - $HOME/.m2/repository - $HOME/.sonar - - 'server/sonar-web/node' - - 'server/sonar-web/node_modules' + - server/sonar-web/node + - server/sonar-web/node_modules before_cache: # remove all the artifacts (JAR, ZIP) that are installed in local repo because of mvn deploy diff --git a/it/it-tests/pom.xml b/it/it-tests/pom.xml index e6b6095d980..c70e2d7d1b8 100644 --- a/it/it-tests/pom.xml +++ b/it/it-tests/pom.xml @@ -14,7 +14,6 @@ <properties> <category>*</category> <skipIts>false</skipIts> - <excludeJunitGroups></excludeJunitGroups> </properties> <dependencies> @@ -122,7 +121,6 @@ <includes> <include>*/${category}Suite.java</include> </includes> - <excludedGroups>${excludeJunitGroups}</excludedGroups> </configuration> </plugin> </plugins> @@ -199,19 +197,6 @@ </dependency> </dependencies> </profile> - <profile> - <!-- SonarSource internal use --> - <id>exclude-qa-tests</id> - <activation> - <property> - <name>exclude-qa-tests</name> - </property> - </activation> - <properties> - <excludeJunitGroups>util.QaOnly</excludeJunitGroups> - </properties> - </profile> - </profiles> diff --git a/it/it-tests/src/test/java/util/QaOnly.java b/it/it-tests/src/test/java/it/LiteSuite.java index 679df934839..f91b1df4334 100644 --- a/it/it-tests/src/test/java/util/QaOnly.java +++ b/it/it-tests/src/test/java/it/LiteSuite.java @@ -17,7 +17,16 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package util; +package it; + +import it.lite.LiteTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LiteTest.class +}) +public class LiteSuite { -public interface QaOnly { } diff --git a/it/it-tests/src/test/java/it/administration/UsersPageTest.java b/it/it-tests/src/test/java/it/administration/UsersPageTest.java index 098c69f7acc..54b5e60b3cc 100644 --- a/it/it-tests/src/test/java/it/administration/UsersPageTest.java +++ b/it/it-tests/src/test/java/it/administration/UsersPageTest.java @@ -24,11 +24,8 @@ import com.sonar.orchestrator.selenium.Selenese; import it.Category1Suite; import org.junit.ClassRule; import org.junit.Test; -import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; -@Category(QaOnly.class) public class UsersPageTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/analysis/BatchTest.java b/it/it-tests/src/test/java/it/analysis/BatchTest.java index 006fdca305b..d92f0c9b20e 100644 --- a/it/it-tests/src/test/java/it/analysis/BatchTest.java +++ b/it/it-tests/src/test/java/it/analysis/BatchTest.java @@ -43,7 +43,6 @@ import org.sonar.wsclient.services.PropertyUpdateQuery; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; @@ -68,7 +67,6 @@ public class BatchTest { * SONAR-3718 */ @Test - @Category(QaOnly.class) public void should_scan_branch_with_forward_slash() { scan("shared/xoo-multi-modules-sample"); scan("shared/xoo-multi-modules-sample", "sonar.branch", "branch/0.x"); @@ -151,7 +149,6 @@ public class BatchTest { * SONAR-3024 */ @Test - @Category(QaOnly.class) public void should_support_source_files_with_same_deprecated_key() { orchestrator.getServer().provisionProject("com.sonarsource.it.projects.batch:duplicate-source", "exclusions"); orchestrator.getServer().associateProjectToQualityProfile("com.sonarsource.it.projects.batch:duplicate-source", "xoo", "one-issue-per-line"); @@ -248,7 +245,6 @@ public class BatchTest { * SONAR-4211 Test Sonar Runner when server requires authentication */ @Test - @Category(QaOnly.class) public void sonar_runner_with_secured_server() { try { orchestrator.getServer().provisionProject("sample", "xoo-sample"); @@ -317,7 +313,6 @@ public class BatchTest { * SONAR-4239 */ @Test - @Category(QaOnly.class) public void should_display_project_url_after_analysis() throws IOException { orchestrator.getServer().provisionProject("com.sonarsource.it.samples:multi-modules-sample", "Sonar :: Integration Tests :: Multi-modules Sample"); orchestrator.getServer().associateProjectToQualityProfile("com.sonarsource.it.samples:multi-modules-sample", "xoo", "one-issue-per-line"); @@ -345,7 +340,6 @@ public class BatchTest { * SONAR-4188, SONAR-5178, SONAR-5915 */ @Test - @Category(QaOnly.class) public void should_display_explicit_message_when_invalid_project_key_or_branch() { orchestrator.getServer().provisionProject("sample", "xoo-sample"); orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line"); @@ -391,7 +385,6 @@ public class BatchTest { * SONAR-4751 */ @Test - @Category(QaOnly.class) public void file_extensions_are_case_insensitive() throws Exception { orchestrator.getServer().provisionProject("case-sensitive-file-extensions", "Case Sensitive"); orchestrator.getServer().associateProjectToQualityProfile("case-sensitive-file-extensions", "xoo", "one-issue-per-line"); @@ -406,7 +399,6 @@ public class BatchTest { * SONAR-4876 */ @Test - @Category(QaOnly.class) public void custom_module_key() { orchestrator.getServer().provisionProject("com.sonarsource.it.samples:multi-modules-sample", "Sonar :: Integration Tests :: Multi-modules Sample"); orchestrator.getServer().associateProjectToQualityProfile("com.sonarsource.it.samples:multi-modules-sample", "xoo", "one-issue-per-line"); diff --git a/it/it-tests/src/test/java/it/analysis/ExtensionLifecycleTest.java b/it/it-tests/src/test/java/it/analysis/ExtensionLifecycleTest.java index 81acd37d046..8ca4ded1db1 100644 --- a/it/it-tests/src/test/java/it/analysis/ExtensionLifecycleTest.java +++ b/it/it-tests/src/test/java/it/analysis/ExtensionLifecycleTest.java @@ -27,9 +27,7 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import util.ItUtils; -import util.QaOnly; -@Category(QaOnly.class) public class ExtensionLifecycleTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/analysis/LinksTest.java b/it/it-tests/src/test/java/it/analysis/LinksTest.java index adcd89ce550..b5e1b919e24 100644 --- a/it/it-tests/src/test/java/it/analysis/LinksTest.java +++ b/it/it-tests/src/test/java/it/analysis/LinksTest.java @@ -34,11 +34,9 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class LinksTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/analysis/MavenTest.java b/it/it-tests/src/test/java/it/analysis/MavenTest.java index 3f8b7475ba8..0f13ce919de 100644 --- a/it/it-tests/src/test/java/it/analysis/MavenTest.java +++ b/it/it-tests/src/test/java/it/analysis/MavenTest.java @@ -33,7 +33,6 @@ import org.sonar.wsclient.Sonar; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; @@ -48,7 +47,6 @@ public class MavenTest { } @Test - @Category(QaOnly.class) public void shouldSupportJarWithoutSources() { MavenBuild build = MavenBuild.create(ItUtils.projectPom("maven/project-with-module-without-sources")) .setCleanSonarGoals(); @@ -66,7 +64,6 @@ public class MavenTest { * See SONAR-594 */ @Test - @Category(QaOnly.class) public void shouldSupportJeeProjects() { MavenBuild build = MavenBuild.create(ItUtils.projectPom("maven/jee")) .setGoals("clean install", "sonar:sonar"); @@ -83,7 +80,6 @@ public class MavenTest { * See SONAR-222 */ @Test - @Category(QaOnly.class) public void shouldSupportMavenExtensions() { MavenBuild build = MavenBuild.create(ItUtils.projectPom("maven/maven-extensions")) .setCleanSonarGoals(); @@ -159,7 +155,6 @@ public class MavenTest { * See SONAR-3843 */ @Test - @Category(QaOnly.class) public void should_support_shade_with_dependency_reduced_pom_with_clean_install_sonar_goals() { MavenBuild build = MavenBuild.create(ItUtils.projectPom("maven/shade-with-dependency-reduced-pom")) .setProperty("sonar.dynamicAnalysis", "false") @@ -237,7 +232,6 @@ public class MavenTest { * The property sonar.sources has a typo -> fail, like in sonar-runner */ @Test - @Category(QaOnly.class) public void fail_if_bad_value_of_sonar_sources_property() { MavenBuild build = MavenBuild.create(ItUtils.projectPom("maven/maven-bad-sources-property")).setGoals("sonar:sonar"); BuildResult result = orchestrator.executeBuildQuietly(build); diff --git a/it/it-tests/src/test/java/it/analysis/ProjectBuilderTest.java b/it/it-tests/src/test/java/it/analysis/ProjectBuilderTest.java index 08c5790e508..6e1f3970a62 100644 --- a/it/it-tests/src/test/java/it/analysis/ProjectBuilderTest.java +++ b/it/it-tests/src/test/java/it/analysis/ProjectBuilderTest.java @@ -28,7 +28,6 @@ import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; @@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat; * * @since 2.9 */ -@Category(QaOnly.class) public class ProjectBuilderTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/analysis/SettingsEncryptionTest.java b/it/it-tests/src/test/java/it/analysis/SettingsEncryptionTest.java index f994212ec7e..71b9e388fe5 100644 --- a/it/it-tests/src/test/java/it/analysis/SettingsEncryptionTest.java +++ b/it/it-tests/src/test/java/it/analysis/SettingsEncryptionTest.java @@ -30,11 +30,9 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class SettingsEncryptionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java index 3e01abff757..d58ce40fea0 100644 --- a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java @@ -30,13 +30,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.permission.AddUserWsRequest; import org.sonarqube.ws.client.permission.PermissionsService; -import util.QaOnly; import util.user.UserRule; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.runProjectAnalysis; -@Category(QaOnly.class) public class DashboardSharingPermissionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/authorisation/ExecuteAnalysisPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/ExecuteAnalysisPermissionTest.java index 92cc2e473cc..978de136edf 100644 --- a/it/it-tests/src/test/java/it/authorisation/ExecuteAnalysisPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/ExecuteAnalysisPermissionTest.java @@ -33,7 +33,6 @@ import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.permission.AddGroupWsRequest; import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest; import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -43,7 +42,6 @@ import static util.ItUtils.runProjectAnalysis; /** * SONAR-4397 */ -@Category(QaOnly.class) public class ExecuteAnalysisPermissionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/authorisation/IssuePermissionTest.java b/it/it-tests/src/test/java/it/authorisation/IssuePermissionTest.java index 87b1631a657..105f16a5672 100644 --- a/it/it-tests/src/test/java/it/authorisation/IssuePermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/IssuePermissionTest.java @@ -37,14 +37,12 @@ import org.sonar.wsclient.user.UserParameters; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.permission.AddUserWsRequest; import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; -import util.QaOnly; import static junit.framework.TestCase.fail; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class IssuePermissionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/authorisation/PermissionSearchTest.java b/it/it-tests/src/test/java/it/authorisation/PermissionSearchTest.java index 7f9fb8c7b61..86216e5eae6 100644 --- a/it/it-tests/src/test/java/it/authorisation/PermissionSearchTest.java +++ b/it/it-tests/src/test/java/it/authorisation/PermissionSearchTest.java @@ -46,14 +46,12 @@ import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequ import org.sonarqube.ws.client.permission.RemoveUserFromTemplateWsRequest; import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest; import org.sonarqube.ws.client.permission.UsersWsRequest; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class PermissionSearchTest { @ClassRule public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; diff --git a/it/it-tests/src/test/java/it/authorisation/PermissionTemplatesPageTest.java b/it/it-tests/src/test/java/it/authorisation/PermissionTemplatesPageTest.java index f924fd307c3..5402c9a4940 100644 --- a/it/it-tests/src/test/java/it/authorisation/PermissionTemplatesPageTest.java +++ b/it/it-tests/src/test/java/it/authorisation/PermissionTemplatesPageTest.java @@ -25,10 +25,8 @@ import it.Category1Suite; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; -@Category(QaOnly.class) public class PermissionTemplatesPageTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/authorisation/ProvisioningPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/ProvisioningPermissionTest.java index 8666a1c09a6..706c37b99eb 100644 --- a/it/it-tests/src/test/java/it/authorisation/ProvisioningPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/ProvisioningPermissionTest.java @@ -38,14 +38,12 @@ import org.sonarqube.ws.client.permission.AddUserWsRequest; import org.sonarqube.ws.client.permission.PermissionsService; import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; import org.sonarqube.ws.client.permission.RemoveUserWsRequest; -import util.QaOnly; import util.selenium.SeleneseTest; import util.user.UserRule; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; -@Category(QaOnly.class) public class ProvisioningPermissionTest { @Rule diff --git a/it/it-tests/src/test/java/it/authorisation/QualityProfileAdminPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/QualityProfileAdminPermissionTest.java index 754a7b45359..e97520da443 100644 --- a/it/it-tests/src/test/java/it/authorisation/QualityProfileAdminPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/QualityProfileAdminPermissionTest.java @@ -29,7 +29,6 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.permission.AddUserWsRequest; import org.sonarqube.ws.client.permission.PermissionsService; -import util.QaOnly; import util.user.UserRule; import static util.ItUtils.newAdminWsClient; @@ -38,7 +37,6 @@ import static util.ItUtils.runProjectAnalysis; /** * SONAR-4210 */ -@Category(QaOnly.class) public class QualityProfileAdminPermissionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/ce/CeWsTest.java b/it/it-tests/src/test/java/it/ce/CeWsTest.java index 717d0f2b725..994206391a7 100644 --- a/it/it-tests/src/test/java/it/ce/CeWsTest.java +++ b/it/it-tests/src/test/java/it/ce/CeWsTest.java @@ -31,13 +31,11 @@ import org.sonarqube.ws.WsCe; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.ce.ActivityWsRequest; import util.ItUtils; -import util.QaOnly; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class CeWsTest { @ClassRule public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR; diff --git a/it/it-tests/src/test/java/it/component/ProjectSearchTest.java b/it/it-tests/src/test/java/it/component/ProjectSearchTest.java index 204952655d0..acd80e7a7ba 100644 --- a/it/it-tests/src/test/java/it/component/ProjectSearchTest.java +++ b/it/it-tests/src/test/java/it/component/ProjectSearchTest.java @@ -33,12 +33,10 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class ProjectSearchTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java b/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java index 2bfb96b6007..41b4ec08306 100644 --- a/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java +++ b/it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java @@ -26,11 +26,9 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import static util.ItUtils.runProjectAnalysis; -@Category(QaOnly.class) public class DashboardTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/componentSearch/AllProjectsTest.java b/it/it-tests/src/test/java/it/componentSearch/AllProjectsTest.java index 0eed7d04647..2baed5658b0 100644 --- a/it/it-tests/src/test/java/it/componentSearch/AllProjectsTest.java +++ b/it/it-tests/src/test/java/it/componentSearch/AllProjectsTest.java @@ -27,12 +27,10 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class AllProjectsTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/customMeasure/CustomMeasuresTest.java b/it/it-tests/src/test/java/it/customMeasure/CustomMeasuresTest.java index 907290ce25d..4da48da5810 100644 --- a/it/it-tests/src/test/java/it/customMeasure/CustomMeasuresTest.java +++ b/it/it-tests/src/test/java/it/customMeasure/CustomMeasuresTest.java @@ -31,12 +31,10 @@ import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.Measure; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class CustomMeasuresTest { private static final String PROJECT_KEY = "sample"; diff --git a/it/it-tests/src/test/java/it/duplication/CrossModuleDuplicationsTest.java b/it/it-tests/src/test/java/it/duplication/CrossModuleDuplicationsTest.java index 30ecf4ee641..d5909383fc8 100644 --- a/it/it-tests/src/test/java/it/duplication/CrossModuleDuplicationsTest.java +++ b/it/it-tests/src/test/java/it/duplication/CrossModuleDuplicationsTest.java @@ -38,11 +38,9 @@ import util.ItUtils; import java.io.File; import java.io.IOException; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class CrossModuleDuplicationsTest { private static final String PROJECT_KEY = "cross-module"; private static final String PROJECT_DIR = "duplications/" + PROJECT_KEY; diff --git a/it/it-tests/src/test/java/it/duplication/CrossProjectDuplicationsOnRemoveFileTest.java b/it/it-tests/src/test/java/it/duplication/CrossProjectDuplicationsOnRemoveFileTest.java index 118715d4cfb..6ce4fbda7b9 100644 --- a/it/it-tests/src/test/java/it/duplication/CrossProjectDuplicationsOnRemoveFileTest.java +++ b/it/it-tests/src/test/java/it/duplication/CrossProjectDuplicationsOnRemoveFileTest.java @@ -29,14 +29,12 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.ResourceQuery; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; import static util.ItUtils.runProjectAnalysis; -@Category(QaOnly.class) public class CrossProjectDuplicationsOnRemoveFileTest { static final String ORIGIN_PROJECT = "origin-project"; diff --git a/it/it-tests/src/test/java/it/http/HttpHeadersTest.java b/it/it-tests/src/test/java/it/http/HttpHeadersTest.java index d578717da30..3e32d21b418 100644 --- a/it/it-tests/src/test/java/it/http/HttpHeadersTest.java +++ b/it/it-tests/src/test/java/it/http/HttpHeadersTest.java @@ -31,11 +31,9 @@ import java.io.IOException; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class HttpHeadersTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/i18n/I18nTest.java b/it/it-tests/src/test/java/it/i18n/I18nTest.java index 837968b443f..5cd16ca59f8 100644 --- a/it/it-tests/src/test/java/it/i18n/I18nTest.java +++ b/it/it-tests/src/test/java/it/i18n/I18nTest.java @@ -28,12 +28,10 @@ import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class I18nTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/issue/CommonRulesTest.java b/it/it-tests/src/test/java/it/issue/CommonRulesTest.java index 194db53d7cd..531b1658943 100644 --- a/it/it-tests/src/test/java/it/issue/CommonRulesTest.java +++ b/it/it-tests/src/test/java/it/issue/CommonRulesTest.java @@ -27,14 +27,12 @@ import org.junit.experimental.categories.Category; import org.sonarqube.ws.Issues.Issue; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.issue.SearchWsRequest; -import util.QaOnly; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.runProjectAnalysis; -@Category(QaOnly.class) public class CommonRulesTest extends AbstractIssueTest { public static final String FILE_KEY = "common-rules-project:src/Sample.xoo"; diff --git a/it/it-tests/src/test/java/it/issue/CustomRulesTest.java b/it/it-tests/src/test/java/it/issue/CustomRulesTest.java index 25258b1107c..5b9ffd53ba4 100644 --- a/it/it-tests/src/test/java/it/issue/CustomRulesTest.java +++ b/it/it-tests/src/test/java/it/issue/CustomRulesTest.java @@ -27,11 +27,9 @@ import org.junit.experimental.categories.Category; import org.sonar.wsclient.issue.Issue; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class CustomRulesTest extends AbstractIssueTest { @Rule diff --git a/it/it-tests/src/test/java/it/issue/IssueActionTest.java b/it/it-tests/src/test/java/it/issue/IssueActionTest.java index 05e44a1f377..14175ba2e15 100644 --- a/it/it-tests/src/test/java/it/issue/IssueActionTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueActionTest.java @@ -32,13 +32,11 @@ import org.sonar.wsclient.issue.IssueQuery; import org.sonar.wsclient.issue.Issues; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static util.ItUtils.verifyHttpException; -@Category(QaOnly.class) public class IssueActionTest extends AbstractIssueTest { @Rule diff --git a/it/it-tests/src/test/java/it/issue/IssueBulkChangeTest.java b/it/it-tests/src/test/java/it/issue/IssueBulkChangeTest.java index b3188669728..192e4f88581 100644 --- a/it/it-tests/src/test/java/it/issue/IssueBulkChangeTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueBulkChangeTest.java @@ -32,14 +32,12 @@ import org.sonar.wsclient.issue.BulkChangeQuery; import org.sonar.wsclient.issue.Issue; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; /** * SONAR-4421 */ -@Category(QaOnly.class) public class IssueBulkChangeTest extends AbstractIssueTest { private static final int BULK_EDITED_ISSUE_COUNT = 3; diff --git a/it/it-tests/src/test/java/it/issue/IssueChangelogTest.java b/it/it-tests/src/test/java/it/issue/IssueChangelogTest.java index f0c14f42fbc..42b476632fe 100644 --- a/it/it-tests/src/test/java/it/issue/IssueChangelogTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueChangelogTest.java @@ -29,11 +29,9 @@ import org.sonar.wsclient.issue.IssueChange; import org.sonar.wsclient.issue.IssueChangeDiff; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class IssueChangelogTest extends AbstractIssueTest { @Rule diff --git a/it/it-tests/src/test/java/it/issue/IssueFilterExtensionTest.java b/it/it-tests/src/test/java/it/issue/IssueFilterExtensionTest.java index d856063881c..58c66945f64 100644 --- a/it/it-tests/src/test/java/it/issue/IssueFilterExtensionTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueFilterExtensionTest.java @@ -30,14 +30,12 @@ import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; /** * Tests the extension point IssueFilter */ -@Category(QaOnly.class) public class IssueFilterExtensionTest extends AbstractIssueTest { @Rule diff --git a/it/it-tests/src/test/java/it/issue/IssueFilterOnCommonRulesTest.java b/it/it-tests/src/test/java/it/issue/IssueFilterOnCommonRulesTest.java index da74881e21e..09daec019ce 100644 --- a/it/it-tests/src/test/java/it/issue/IssueFilterOnCommonRulesTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueFilterOnCommonRulesTest.java @@ -28,7 +28,6 @@ import org.junit.experimental.categories.Category; import org.sonarqube.ws.Issues; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.issue.SearchWsRequest; -import util.QaOnly; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; @@ -36,7 +35,6 @@ import static util.ItUtils.newAdminWsClient; import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.setServerProperties; -@Category(QaOnly.class) public class IssueFilterOnCommonRulesTest extends AbstractIssueTest { private static WsClient adminWsClient; diff --git a/it/it-tests/src/test/java/it/issue/IssueFilterTest.java b/it/it-tests/src/test/java/it/issue/IssueFilterTest.java index 61eea7bcd89..5e9a0f06f0e 100644 --- a/it/it-tests/src/test/java/it/issue/IssueFilterTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueFilterTest.java @@ -25,13 +25,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.setServerProperties; -@Category(QaOnly.class) public class IssueFilterTest extends AbstractIssueTest { private static final String PROJECT_KEY = "com.sonarsource.it.samples:multi-modules-exclusions"; diff --git a/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java b/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java index e6b2dcce31f..834c837b228 100644 --- a/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java @@ -27,7 +27,6 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; -import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.issue.BulkChangeQuery; @@ -37,8 +36,6 @@ import org.sonar.wsclient.issue.IssueQuery; import org.sonar.wsclient.issue.Issues; import org.subethamail.wiser.Wiser; import org.subethamail.wiser.WiserMessage; -import util.NetworkUtils; -import util.QaOnly; import util.selenium.SeleneseTest; import util.user.UserRule; @@ -46,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class IssueNotificationsTest extends AbstractIssueTest { private final static String PROJECT_KEY = "sample"; diff --git a/it/it-tests/src/test/java/it/issue/IssuePurgeTest.java b/it/it-tests/src/test/java/it/issue/IssuePurgeTest.java index 2dd92f72995..71f594c160f 100644 --- a/it/it-tests/src/test/java/it/issue/IssuePurgeTest.java +++ b/it/it-tests/src/test/java/it/issue/IssuePurgeTest.java @@ -29,11 +29,9 @@ import org.sonar.wsclient.issue.IssueQuery; import org.sonar.wsclient.issue.Issues; import util.ProjectAnalysis; import util.ProjectAnalysisRule; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class IssuePurgeTest extends AbstractIssueTest { @Rule diff --git a/it/it-tests/src/test/java/it/issue/IssuesPageTest.java b/it/it-tests/src/test/java/it/issue/IssuesPageTest.java index b44df9ce131..5869553c56d 100644 --- a/it/it-tests/src/test/java/it/issue/IssuesPageTest.java +++ b/it/it-tests/src/test/java/it/issue/IssuesPageTest.java @@ -24,11 +24,8 @@ import com.sonar.orchestrator.selenium.Selenese; import it.Category2Suite; import org.junit.ClassRule; import org.junit.Test; -import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; -@Category(QaOnly.class) public class IssuesPageTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/lite/LiteTest.java b/it/it-tests/src/test/java/it/lite/LiteTest.java new file mode 100644 index 00000000000..f013e3a5c95 --- /dev/null +++ b/it/it-tests/src/test/java/it/lite/LiteTest.java @@ -0,0 +1,101 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * 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 it.lite; + +import com.sonar.orchestrator.Orchestrator; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonarqube.ws.Issues; +import org.sonarqube.ws.WsComponents; +import org.sonarqube.ws.WsMeasures; +import org.sonarqube.ws.client.WsClient; +import org.sonarqube.ws.client.component.TreeWsRequest; +import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.measure.ComponentTreeWsRequest; +import org.sonarqube.ws.client.measure.ComponentWsRequest; +import util.ItUtils; + +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.runProjectAnalysis; +import static util.ItUtils.xooPlugin; + +public class LiteTest { + + private static final String PROJECT_KEY = "com.sonarsource.it.samples:multi-modules-sample"; + + @ClassRule + public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + .addPlugin(xooPlugin()) + .build(); + + private static WsClient wsClient; + + @BeforeClass + public static void setUp() { + runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample"); + wsClient = ItUtils.newWsClient(ORCHESTRATOR); + } + + @Test + public void call_issues_ws() { + // all issues + Issues.SearchWsResponse response = wsClient.issues().search(new SearchWsRequest()); + assertThat(response.getIssuesCount()).isGreaterThan(0); + + // project issues + response = wsClient.issues().search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY))); + assertThat(response.getIssuesCount()).isGreaterThan(0); + } + + @Test + public void call_components_ws() { + // files in project + WsComponents.TreeWsResponse tree = wsClient.components().tree(new TreeWsRequest() + .setBaseComponentKey(PROJECT_KEY) + .setQualifiers(singletonList("FIL"))); + assertThat(tree.getComponentsCount()).isEqualTo(4); + tree.getComponentsList().forEach(c -> { + assertThat(c.getQualifier()).isEqualTo("FIL"); + assertThat(c.getName()).endsWith(".xoo"); + }); + } + + @Test + public void call_measures_ws() { + // project measures + WsMeasures.ComponentWsResponse component = wsClient.measures().component(new ComponentWsRequest() + .setComponentKey(PROJECT_KEY) + .setMetricKeys(asList("lines", "ncloc", "files"))); + assertThat(component.getComponent().getMeasuresCount()).isEqualTo(3); + + // file measures + WsMeasures.ComponentTreeWsResponse tree = wsClient.measures().componentTree(new ComponentTreeWsRequest() + .setBaseComponentKey(PROJECT_KEY) + .setQualifiers(singletonList("FIL")) + .setMetricKeys(asList("lines", "ncloc"))); + assertThat(tree.getComponentsCount()).isEqualTo(4); + tree.getComponentsList().forEach(c -> { + assertThat(c.getMeasuresList()).extracting(m -> m.getMetric()).containsOnly("lines", "ncloc"); + }); + } +} diff --git a/it/it-tests/src/test/java/it/measure/DecimalScaleMetricTest.java b/it/it-tests/src/test/java/it/measure/DecimalScaleMetricTest.java index d77c6877987..9af34a15179 100644 --- a/it/it-tests/src/test/java/it/measure/DecimalScaleMetricTest.java +++ b/it/it-tests/src/test/java/it/measure/DecimalScaleMetricTest.java @@ -27,14 +27,12 @@ import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; /** * SONAR-6939 */ -@Category(QaOnly.class) public class DecimalScaleMetricTest { /** diff --git a/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java b/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java index 25406fc47ea..aa58f9a57c4 100644 --- a/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java +++ b/it/it-tests/src/test/java/it/measure/ProjectWidgetsTest.java @@ -27,14 +27,11 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.ResourceQuery; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class ProjectWidgetsTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java b/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java index 014b6dbd6a4..701405abc1f 100644 --- a/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java +++ b/it/it-tests/src/test/java/it/measureFilter/MeasureFiltersTest.java @@ -32,13 +32,11 @@ import org.sonar.wsclient.SonarClient; import org.sonar.wsclient.user.UserParameters; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.permission.AddUserWsRequest; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class MeasureFiltersTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java b/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java index 066028fc82b..d68680f26f1 100644 --- a/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java +++ b/it/it-tests/src/test/java/it/measureHistory/HistoryUiTest.java @@ -28,12 +28,10 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class HistoryUiTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/measureHistory/SincePreviousVersionHistoryTest.java b/it/it-tests/src/test/java/it/measureHistory/SincePreviousVersionHistoryTest.java index 5f504a1fcaf..307a9ba5b0a 100644 --- a/it/it-tests/src/test/java/it/measureHistory/SincePreviousVersionHistoryTest.java +++ b/it/it-tests/src/test/java/it/measureHistory/SincePreviousVersionHistoryTest.java @@ -36,13 +36,11 @@ import org.sonar.wsclient.services.Measure; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class SincePreviousVersionHistoryTest { private static final String PROJECT = "com.sonarsource.it.samples:multi-modules-sample"; diff --git a/it/it-tests/src/test/java/it/measureHistory/SinceXDaysHistoryTest.java b/it/it-tests/src/test/java/it/measureHistory/SinceXDaysHistoryTest.java index eedd98fe8a5..ee5f8a2c9da 100644 --- a/it/it-tests/src/test/java/it/measureHistory/SinceXDaysHistoryTest.java +++ b/it/it-tests/src/test/java/it/measureHistory/SinceXDaysHistoryTest.java @@ -36,13 +36,11 @@ import org.sonar.wsclient.services.Measure; import org.sonar.wsclient.services.Resource; import org.sonar.wsclient.services.ResourceQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class SinceXDaysHistoryTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/measureHistory/TimeMachineTest.java b/it/it-tests/src/test/java/it/measureHistory/TimeMachineTest.java index f2d803ebdcd..1c7938791b7 100644 --- a/it/it-tests/src/test/java/it/measureHistory/TimeMachineTest.java +++ b/it/it-tests/src/test/java/it/measureHistory/TimeMachineTest.java @@ -36,13 +36,11 @@ import org.sonar.wsclient.services.TimeMachine; import org.sonar.wsclient.services.TimeMachineCell; import org.sonar.wsclient.services.TimeMachineQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class TimeMachineTest { private static final String PROJECT = "sample"; diff --git a/it/it-tests/src/test/java/it/projectAdministration/BulkDeletionTest.java b/it/it-tests/src/test/java/it/projectAdministration/BulkDeletionTest.java index cbc06eccdfa..ec2fe057350 100644 --- a/it/it-tests/src/test/java/it/projectAdministration/BulkDeletionTest.java +++ b/it/it-tests/src/test/java/it/projectAdministration/BulkDeletionTest.java @@ -27,12 +27,10 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class BulkDeletionTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java b/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java index d542196840d..2d2f71ea825 100644 --- a/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java +++ b/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java @@ -38,13 +38,11 @@ import org.sonar.wsclient.base.HttpException; import org.sonar.wsclient.services.PropertyQuery; import org.sonar.wsclient.services.ResourceQuery; import org.sonar.wsclient.user.UserParameters; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class ProjectAdministrationTest { private static final String DELETE_WS_ENDPOINT = "api/projects/bulk_delete"; diff --git a/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java b/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java index accb2962162..d2b2768942f 100644 --- a/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java +++ b/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java @@ -26,12 +26,10 @@ import it.Category1Suite; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class ProjectPermissionsTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/projectComparison/ProjectComparisonTest.java b/it/it-tests/src/test/java/it/projectComparison/ProjectComparisonTest.java index ac0987a94d4..8462db5a090 100644 --- a/it/it-tests/src/test/java/it/projectComparison/ProjectComparisonTest.java +++ b/it/it-tests/src/test/java/it/projectComparison/ProjectComparisonTest.java @@ -28,12 +28,10 @@ import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class ProjectComparisonTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/projectEvent/EventTest.java b/it/it-tests/src/test/java/it/projectEvent/EventTest.java index 554b69f50ef..54327a01b5a 100644 --- a/it/it-tests/src/test/java/it/projectEvent/EventTest.java +++ b/it/it-tests/src/test/java/it/projectEvent/EventTest.java @@ -36,13 +36,11 @@ import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsConnector; import org.sonarqube.ws.client.WsResponse; import util.ItUtils; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class EventTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java b/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java index e8e91e7e9ad..325d70afa26 100644 --- a/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java +++ b/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java @@ -42,14 +42,12 @@ import org.sonar.wsclient.services.ResourceQuery; import org.subethamail.wiser.Wiser; import org.subethamail.wiser.WiserMessage; import util.ItUtils; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class QualityGateNotificationTest { private static long DEFAULT_QUALITY_GATE; diff --git a/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java b/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java index 8bf30e4e9e3..79533e7b29e 100644 --- a/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java +++ b/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java @@ -36,13 +36,11 @@ import org.sonar.wsclient.qualitygate.QualityGateClient; import org.sonar.wsclient.qualitygate.QualityGateCondition; import org.sonar.wsclient.qualitygate.UpdateCondition; import util.ItUtils; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class QualityGateUiTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/qualityModel/DebtConfigurationRule.java b/it/it-tests/src/test/java/it/qualityModel/DebtConfigurationRule.java index 8fb4a12a84a..cce5f8faf68 100644 --- a/it/it-tests/src/test/java/it/qualityModel/DebtConfigurationRule.java +++ b/it/it-tests/src/test/java/it/qualityModel/DebtConfigurationRule.java @@ -25,7 +25,6 @@ import com.sonar.orchestrator.Orchestrator; import java.util.Set; import org.junit.experimental.categories.Category; import org.junit.rules.ExternalResource; -import util.QaOnly; import static com.google.common.base.Preconditions.checkState; import static util.ItUtils.setServerProperty; @@ -33,7 +32,6 @@ import static util.ItUtils.setServerProperty; /** * This rule should be used when dealing with technical debt properties, in order to always be sure that the properties are correctly reset between each tests. */ -@Category(QaOnly.class) public class DebtConfigurationRule extends ExternalResource { private static final String HOURS_IN_DAY_PROPERTY = "sonar.technicalDebt.hoursInDay"; diff --git a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java index ef92d86270f..3a1cde710d2 100644 --- a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java +++ b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java @@ -34,7 +34,6 @@ import org.sonar.wsclient.issue.IssueChange; import org.sonar.wsclient.issue.IssueChangeDiff; import org.sonar.wsclient.issue.IssueClient; import org.sonar.wsclient.issue.IssueQuery; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; @@ -42,7 +41,6 @@ import static util.ItUtils.projectDir; /** * SONAR-4834 */ -@Category(QaOnly.class) public class TechnicalDebtInIssueChangelogTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java index 00dc2354bf2..c866e608110 100644 --- a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java +++ b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java @@ -29,7 +29,6 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import java.text.SimpleDateFormat; @@ -37,7 +36,6 @@ import java.util.Date; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class TechnicalDebtWidgetTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/qualityProfile/QualityProfilesPageTest.java b/it/it-tests/src/test/java/it/qualityProfile/QualityProfilesPageTest.java index 8a74c2ba8fa..d9ffc805ad6 100644 --- a/it/it-tests/src/test/java/it/qualityProfile/QualityProfilesPageTest.java +++ b/it/it-tests/src/test/java/it/qualityProfile/QualityProfilesPageTest.java @@ -27,13 +27,11 @@ import org.junit.*; import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class QualityProfilesPageTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/serverSystem/RestartTest.java b/it/it-tests/src/test/java/it/serverSystem/RestartTest.java index 506bd86d122..f1a2058c582 100644 --- a/it/it-tests/src/test/java/it/serverSystem/RestartTest.java +++ b/it/it-tests/src/test/java/it/serverSystem/RestartTest.java @@ -32,7 +32,6 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -42,7 +41,6 @@ import static util.ItUtils.newWsClient; /** * This class starts a new orchestrator on each test case */ -@Category(QaOnly.class) public class RestartTest { Orchestrator orchestrator; diff --git a/it/it-tests/src/test/java/it/serverSystem/ServerSystemRestartingOrchestrator.java b/it/it-tests/src/test/java/it/serverSystem/ServerSystemRestartingOrchestrator.java index 088f782834b..ef91d1d7298 100644 --- a/it/it-tests/src/test/java/it/serverSystem/ServerSystemRestartingOrchestrator.java +++ b/it/it-tests/src/test/java/it/serverSystem/ServerSystemRestartingOrchestrator.java @@ -26,12 +26,10 @@ import org.apache.commons.io.FileUtils; import org.junit.After; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.wsclient.services.Server; import org.sonar.wsclient.services.ServerQuery; import util.ItUtils; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -39,7 +37,6 @@ import static org.junit.Assert.fail; /** * This class start a new orchestrator on each test case */ -@Category(QaOnly.class) public class ServerSystemRestartingOrchestrator { Orchestrator orchestrator; diff --git a/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java b/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java index 24fd65151a6..59ed2a5b6fd 100644 --- a/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java +++ b/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java @@ -45,14 +45,12 @@ import org.sonar.wsclient.services.ServerQuery; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; import util.ItUtils; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static util.ItUtils.newAdminWsClient; -@Category(QaOnly.class) public class ServerSystemTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/settings/PropertySetsTest.java b/it/it-tests/src/test/java/it/settings/PropertySetsTest.java index 00f4311f40e..ff7ad1621f1 100644 --- a/it/it-tests/src/test/java/it/settings/PropertySetsTest.java +++ b/it/it-tests/src/test/java/it/settings/PropertySetsTest.java @@ -27,12 +27,10 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.PropertyQuery; import org.sonar.wsclient.services.PropertyUpdateQuery; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class PropertySetsTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/settings/SettingsTestRestartingOrchestrator.java b/it/it-tests/src/test/java/it/settings/SettingsTestRestartingOrchestrator.java index 4472da3a92a..9eb829d272d 100644 --- a/it/it-tests/src/test/java/it/settings/SettingsTestRestartingOrchestrator.java +++ b/it/it-tests/src/test/java/it/settings/SettingsTestRestartingOrchestrator.java @@ -28,7 +28,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.pluginArtifact; @@ -38,7 +37,6 @@ import static util.ItUtils.xooPlugin; /** * This class start a new orchestrator on each test case */ -@Category(QaOnly.class) public class SettingsTestRestartingOrchestrator { Orchestrator orchestrator; diff --git a/it/it-tests/src/test/java/it/settings/SubCategoriesTest.java b/it/it-tests/src/test/java/it/settings/SubCategoriesTest.java index 73378604579..4d24549f144 100644 --- a/it/it-tests/src/test/java/it/settings/SubCategoriesTest.java +++ b/it/it-tests/src/test/java/it/settings/SubCategoriesTest.java @@ -27,13 +27,11 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.PropertyQuery; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class SubCategoriesTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java b/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java index 8d21f85ee39..3f1bbec3030 100644 --- a/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java +++ b/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java @@ -26,12 +26,10 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.runProjectAnalysis; -@Category(QaOnly.class) public class EncodingTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/test/CoverageTrackingTest.java b/it/it-tests/src/test/java/it/test/CoverageTrackingTest.java index c6ebc56b30b..a70ba31ca13 100644 --- a/it/it-tests/src/test/java/it/test/CoverageTrackingTest.java +++ b/it/it-tests/src/test/java/it/test/CoverageTrackingTest.java @@ -30,11 +30,9 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.skyscreamer.jsonassert.JSONAssert; -import util.QaOnly; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class CoverageTrackingTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/ui/UiTest.java b/it/it-tests/src/test/java/it/ui/UiTest.java index 66a90fbc6d6..7e3a84526be 100644 --- a/it/it-tests/src/test/java/it/ui/UiTest.java +++ b/it/it-tests/src/test/java/it/ui/UiTest.java @@ -25,10 +25,8 @@ import it.Category4Suite; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; -@Category(QaOnly.class) public class UiTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/uiExtension/UiExtensionsTest.java b/it/it-tests/src/test/java/it/uiExtension/UiExtensionsTest.java index 629578be964..a98d6370fef 100644 --- a/it/it-tests/src/test/java/it/uiExtension/UiExtensionsTest.java +++ b/it/it-tests/src/test/java/it/uiExtension/UiExtensionsTest.java @@ -31,12 +31,10 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; -@Category(QaOnly.class) public class UiExtensionsTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/updateCenter/UpdateCenterTest.java b/it/it-tests/src/test/java/it/updateCenter/UpdateCenterTest.java index 9f6e3d0b2fa..1fea840524b 100644 --- a/it/it-tests/src/test/java/it/updateCenter/UpdateCenterTest.java +++ b/it/it-tests/src/test/java/it/updateCenter/UpdateCenterTest.java @@ -23,24 +23,19 @@ import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.selenium.Selenese; import java.util.List; import org.apache.commons.lang.StringUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.wsclient.services.Plugin; import org.sonar.wsclient.services.UpdateCenterQuery; -import util.QaOnly; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.pluginArtifact; -import static util.ItUtils.xooPlugin; /** * This class start its own orchestrator */ -@Category(QaOnly.class) public class UpdateCenterTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java b/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java index 0c30d4471b6..46570b22908 100644 --- a/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java +++ b/it/it-tests/src/test/java/it/user/BaseIdentityProviderTest.java @@ -34,7 +34,6 @@ import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import util.user.UserRule; import util.user.Users; @@ -48,7 +47,6 @@ import static util.ItUtils.setServerProperty; * - creating new user using email already used * - display multiple identity provider plugins (probably in another class) */ -@Category(QaOnly.class) public class BaseIdentityProviderTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/FavouriteTest.java b/it/it-tests/src/test/java/it/user/FavouriteTest.java index a97d6aad437..24e54a34890 100644 --- a/it/it-tests/src/test/java/it/user/FavouriteTest.java +++ b/it/it-tests/src/test/java/it/user/FavouriteTest.java @@ -34,7 +34,6 @@ import org.sonar.wsclient.services.Favourite; import org.sonar.wsclient.services.FavouriteCreateQuery; import org.sonar.wsclient.services.FavouriteDeleteQuery; import org.sonar.wsclient.services.FavouriteQuery; -import util.QaOnly; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,6 @@ import static util.ItUtils.projectDir; /** * TODO This test should not require an analysis, only provisioning the project should be enough */ -@Category(QaOnly.class) public class FavouriteTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java b/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java index f0b9c074d4d..eee806f7f1c 100644 --- a/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java +++ b/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java @@ -25,18 +25,15 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.newWsClient; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class ForceAuthenticationTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java index 8026250318b..1eba924cc6b 100644 --- a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java +++ b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java @@ -47,7 +47,6 @@ import org.sonarqube.ws.client.usertoken.GenerateWsRequest; import org.sonarqube.ws.client.usertoken.RevokeWsRequest; import org.sonarqube.ws.client.usertoken.SearchWsRequest; import org.sonarqube.ws.client.usertoken.UserTokensService; -import util.QaOnly; import util.selenium.SeleneseTest; import util.user.UserRule; @@ -57,7 +56,6 @@ import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; import static util.ItUtils.setServerProperty; -@Category(QaOnly.class) public class LocalAuthenticationTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/MyAccountPageTest.java b/it/it-tests/src/test/java/it/user/MyAccountPageTest.java index d532af28a8f..9e60c2a9385 100644 --- a/it/it-tests/src/test/java/it/user/MyAccountPageTest.java +++ b/it/it-tests/src/test/java/it/user/MyAccountPageTest.java @@ -27,13 +27,11 @@ import org.junit.*; import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; -import util.QaOnly; import util.selenium.SeleneseTest; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; -@Category(QaOnly.class) public class MyAccountPageTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java b/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java index c7645ef00b0..d129bcc03fb 100644 --- a/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java +++ b/it/it-tests/src/test/java/it/user/OAuth2IdentityProviderTest.java @@ -34,7 +34,6 @@ import org.junit.experimental.categories.Category; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import util.user.UserRule; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,6 @@ import static util.ItUtils.setServerProperty; /** * There's only tests specific to OAuth2 in this class */ -@Category(QaOnly.class) public class OAuth2IdentityProviderTest { @ClassRule diff --git a/it/it-tests/src/test/java/it/user/RailsExternalAuthenticationTest.java b/it/it-tests/src/test/java/it/user/RailsExternalAuthenticationTest.java index 048eb41037f..bab9a8fe135 100644 --- a/it/it-tests/src/test/java/it/user/RailsExternalAuthenticationTest.java +++ b/it/it-tests/src/test/java/it/user/RailsExternalAuthenticationTest.java @@ -54,7 +54,6 @@ import org.sonarqube.ws.client.HttpConnector; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsClientFactories; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import util.selenium.SeleneseTest; /** @@ -62,7 +61,6 @@ import util.selenium.SeleneseTest; * * It starts its own server as it's using a different authentication system */ -@Category(QaOnly.class) public class RailsExternalAuthenticationTest { @Rule diff --git a/it/it-tests/src/test/java/it/ws/WsLocalCallTest.java b/it/it-tests/src/test/java/it/ws/WsLocalCallTest.java index 3ec61f0ff3e..a149cafe093 100644 --- a/it/it-tests/src/test/java/it/ws/WsLocalCallTest.java +++ b/it/it-tests/src/test/java/it/ws/WsLocalCallTest.java @@ -29,14 +29,12 @@ import org.sonarqube.ws.client.HttpConnector; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsClientFactories; import org.sonarqube.ws.client.WsResponse; -import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; /** * Tests the ability for a web service to call another web services. */ -@Category(QaOnly.class) public class WsLocalCallTest { @ClassRule diff --git a/travis.sh b/travis.sh index 01655ab5080..5e038bf43aa 100755 --- a/travis.sh +++ b/travis.sh @@ -10,32 +10,30 @@ function configureTravis { configureTravis . installJDK8 -function strongEcho { - echo "" - echo "================ $1 =================" -} - case "$TARGET" in CI) - if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build and deploy' + export MAVEN_OPTS="-Xmx1G -Xms128m" + INITIAL_VERSION=`maven_expression "project.version"` + + if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo 'Analyse and trigger QA of master branch' # Do not deploy a SNAPSHOT version but the release version related to this build set_maven_build_version $TRAVIS_BUILD_NUMBER - # analysis is currently executed by SonarSource internal infrastructure - mvn deploy \ - -Pdeploy-sonarsource \ - -B -e -V - - elif [[ "${TRAVIS_BRANCH}" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build and deploy' + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ + -Dsonar.host.url=$SONAR_HOST_URL \ + -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.projectVersion=$INITIAL_VERSION \ + -B -e -V - # get current version from pom - CURRENT_VERSION=`maven_expression "project.version"` + elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo 'release branch: trigger QA, no analysis' - if [[ $CURRENT_VERSION =~ "-SNAPSHOT" ]]; then + if [[ $INITIAL_VERSION =~ "-SNAPSHOT" ]]; then echo "======= Found SNAPSHOT version =======" # Do not deploy a SNAPSHOT version but the release version related to this build set_maven_build_version $TRAVIS_BUILD_NUMBER @@ -43,21 +41,19 @@ CI) echo "======= Found RELEASE version =======" fi - # analysis is currently executed by SonarSource internal infrastructure mvn deploy \ -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ -B -e -V - - elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then - strongEcho 'Build and analyze pull request, no deploy' + echo 'Internal pull request: trigger QA and analysis' - # No need for Maven phase "install" as the generated JAR file does not need to be installed - # in Maven local repository. Phase "verify" is enough. + set_maven_build_version $TRAVIS_BUILD_NUMBER - export MAVEN_OPTS="-Xmx1G -Xms128m" - mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \ + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ -Dsonar.analysis.mode=issues \ -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ @@ -67,15 +63,16 @@ CI) -B -e -V else - strongEcho 'Build, no analysis, no deploy' + echo 'Feature branch or external pull request: no QA, no analysis' # No need for Maven phase "install" as the generated JAR file does not need to be installed # in Maven local repository. Phase "verify" is enough. - mvn verify \ -Dmaven.test.redirectTestOutputToFile=false \ -B -e -V fi + + ./run-integration-tests.sh "Lite" "" ;; WEB) @@ -85,12 +82,6 @@ WEB) cd server/sonar-web && npm install && npm test ;; -IT) - start_xvfb - mvn install -DskipTests=true -Dsource.skip=true -Denforcer.skip=true -B -e -V - ./run-integration-tests.sh "$IT_CATEGORY" "" -Dmaven.test.redirectTestOutputToFile=false -Dexclude-qa-tests=true - ;; - *) echo "Unexpected TARGET value: $TARGET" exit 1 |