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.6KB

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