@@ -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 |
@@ -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> | |||
@@ -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 { | |||
} |
@@ -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 |
@@ -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"); |
@@ -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 |
@@ -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 |
@@ -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); |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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"; |
@@ -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; |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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"; |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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"); | |||
}); | |||
} | |||
} |
@@ -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 { | |||
/** |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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"; |
@@ -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 |
@@ -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"; |
@@ -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 |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |