You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ext {
  2. jettyVersion = '9.3.11.v20160721'
  3. bytemanVersion = '3.0.10'
  4. }
  5. configurations {
  6. sqZip
  7. includeInTestResources
  8. }
  9. def pluginsForITs = [
  10. ':plugins:sonar-xoo-plugin',
  11. ':tests:plugins:access-secured-props-plugin',
  12. ':tests:plugins:base-auth-plugin',
  13. ':tests:plugins:batch-plugin',
  14. ':tests:plugins:extension-lifecycle-plugin',
  15. ':tests:plugins:fake-billing-plugin',
  16. ':tests:plugins:fake-governance-plugin',
  17. ':tests:plugins:foo-plugin-v1',
  18. ':tests:plugins:foo-plugin-v2',
  19. ':tests:plugins:global-property-change-plugin',
  20. ':tests:plugins:issue-filter-plugin',
  21. ':tests:plugins:l10n-fr-pack',
  22. ':tests:plugins:license-plugin',
  23. ':tests:plugins:oauth2-auth-plugin',
  24. ':tests:plugins:project-builder-plugin',
  25. ':tests:plugins:property-relocation-plugin',
  26. ':tests:plugins:property-sets-plugin',
  27. ':tests:plugins:security-plugin',
  28. ':tests:plugins:server-plugin',
  29. ':tests:plugins:settings-encryption-plugin',
  30. ':tests:plugins:settings-plugin',
  31. ':tests:plugins:sonar-fake-plugin',
  32. ':tests:plugins:sonar-subcategories-plugin',
  33. ':tests:plugins:ui-extensions-plugin',
  34. ':tests:plugins:posttask-plugin',
  35. ':tests:plugins:wait-at-platform-level4-plugin',
  36. ':tests:plugins:ws-plugin',
  37. ':tests:plugins:backdating-plugin-v1',
  38. ':tests:plugins:backdating-plugin-v2',
  39. ':tests:plugins:backdating-customplugin'
  40. ]
  41. dependencies {
  42. // please keep list ordered
  43. // required version 23.0 for selenide
  44. testCompile 'com.google.guava:guava:23.0'
  45. testCompile 'com.googlecode.json-simple:json-simple'
  46. testCompile 'com.microsoft.sqlserver:mssql-jdbc'
  47. testCompile 'com.oracle.jdbc:ojdbc8'
  48. testCompile 'com.squareup.okhttp3:mockwebserver'
  49. testCompile 'junit:junit'
  50. testCompile 'mysql:mysql-connector-java'
  51. testCompile 'org.assertj:assertj-core'
  52. testCompile 'org.assertj:assertj-guava'
  53. testCompile "org.eclipse.jetty:jetty-proxy:${jettyVersion}"
  54. testCompile "org.eclipse.jetty:jetty-server:${jettyVersion}"
  55. testCompile "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
  56. testCompile "org.jboss.byteman:byteman-submit:${bytemanVersion}"
  57. testCompile 'org.postgresql:postgresql'
  58. testCompile 'org.skyscreamer:jsonassert:1.2.0'
  59. testCompile 'org.sonarsource.orchestrator:sonar-orchestrator'
  60. testCompile 'org.subethamail:subethasmtp'
  61. testCompile project(':server:sonar-qa-util')
  62. testCompile project(':sonar-ws')
  63. includeInTestResources "org.jboss.byteman:byteman:${bytemanVersion}"
  64. }
  65. sonarqube {
  66. skipProject = true
  67. }
  68. //UT are excluding in order for ITs to only run when needed
  69. test{
  70. exclude '*'
  71. }
  72. task integrationTest(type: Test) {
  73. description = 'Runs integration tests'
  74. for (plugin in pluginsForITs) {
  75. dependsOn project(plugin).assemble
  76. }
  77. jacoco.enabled = false
  78. systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
  79. systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey')
  80. systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories')
  81. if (project.hasProperty('cix')) {
  82. systemProperty 'sonar.runtimeVersion', version
  83. }
  84. def category = System.getProperty('category')
  85. filter {
  86. switch (category) {
  87. case 'Lite':
  88. includeTestsMatching 'org.sonarqube.tests.lite.*Suite'
  89. break
  90. case 'Category1':
  91. includeTestsMatching 'org.sonarqube.tests.Category1Suite'
  92. includeTestsMatching 'org.sonarqube.tests.authorization.*Suite'
  93. includeTestsMatching 'org.sonarqube.tests.measure.*Suite'
  94. includeTestsMatching 'org.sonarqube.tests.qualityGate.*Suite'
  95. includeTestsMatching 'org.sonarqube.tests.source.*Suite'
  96. break
  97. case 'Category2':
  98. includeTestsMatching 'org.sonarqube.tests.issue.*Suite'
  99. includeTestsMatching 'org.sonarqube.tests.test.*Suite'
  100. includeTestsMatching 'org.sonarqube.tests.qualityModel.*Suite'
  101. break
  102. case 'Category3':
  103. includeTestsMatching 'org.sonarqube.tests.Category3Suite'
  104. includeTestsMatching 'org.sonarqube.tests.component.*Suite'
  105. includeTestsMatching 'org.sonarqube.tests.project.*Suite'
  106. break
  107. case 'Category4':
  108. includeTestsMatching 'org.sonarqube.tests.Category4Suite'
  109. includeTestsMatching 'org.sonarqube.tests.duplication.*Suite'
  110. includeTestsMatching 'org.sonarqube.tests.user.*Suite'
  111. includeTestsMatching 'org.sonarqube.tests.webhook.*Suite'
  112. break
  113. case 'Category5':
  114. includeTestsMatching 'org.sonarqube.tests.Category5Suite'
  115. break
  116. case 'Category6':
  117. includeTestsMatching 'org.sonarqube.tests.Category6Suite'
  118. includeTestsMatching 'org.sonarqube.tests.organization.*Suite'
  119. break
  120. case 'Plugins':
  121. includeTestsMatching 'org.sonarqube.tests.plugins.PluginsSuite'
  122. break
  123. case 'Upgrade':
  124. includeTestsMatching 'org.sonarqube.tests.upgrade.UpgradeSuite'
  125. break
  126. case 'ServerPerformance':
  127. includeTestsMatching 'org.sonarqube.tests.performance.server.ServerPerformanceSuite'
  128. break
  129. }
  130. }
  131. }
  132. processTestResources() {
  133. into('/') {
  134. from configurations.includeInTestResources
  135. // TODO cache not invalidated when pattern changes?
  136. rename '(.*)-' + bytemanVersion + '.jar', '$1.jar'
  137. }
  138. }