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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. testCompile 'org.sonarsource.orchestrator:sonar-orchestrator'
  43. testCompile project(':server:sonar-qa-util')
  44. testCompile project(':sonar-ws')
  45. // required version 23.0 for selenide
  46. testCompile 'com.google.guava:guava:23.0'
  47. testCompile 'junit:junit'
  48. testCompile 'org.assertj:assertj-core'
  49. testCompile 'org.assertj:assertj-guava'
  50. testCompile 'com.googlecode.json-simple:json-simple'
  51. testCompile 'org.skyscreamer:jsonassert:1.2.0'
  52. testCompile 'com.squareup.okhttp3:mockwebserver'
  53. testCompile 'org.subethamail:subethasmtp'
  54. testCompile "org.eclipse.jetty:jetty-server:${jettyVersion}"
  55. testCompile "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
  56. testCompile "org.eclipse.jetty:jetty-proxy:${jettyVersion}"
  57. testCompile "org.jboss.byteman:byteman-submit:${bytemanVersion}"
  58. testCompile 'com.microsoft.sqlserver:mssql-jdbc'
  59. testCompile 'mysql:mysql-connector-java'
  60. testCompile 'org.postgresql:postgresql'
  61. testCompile 'com.oracle.jdbc:ojdbc8'
  62. includeInTestResources "org.jboss.byteman:byteman:${bytemanVersion}"
  63. }
  64. sonarqube {
  65. skipProject = true
  66. }
  67. //UT are excluding in order for ITs to only run when needed
  68. test{
  69. exclude '*'
  70. }
  71. task integrationTest(type: Test) {
  72. description = 'Runs integration tests'
  73. for (plugin in pluginsForITs) {
  74. dependsOn project(plugin).assemble
  75. }
  76. jacoco.enabled = false
  77. systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
  78. systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey')
  79. systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories')
  80. if (project.hasProperty('cix')) {
  81. systemProperty 'sonar.runtimeVersion', version
  82. }
  83. def category = System.getProperty('category')
  84. filter {
  85. switch (category) {
  86. case 'Lite':
  87. includeTestsMatching 'org.sonarqube.tests.lite.*Suite'
  88. break
  89. case 'Category1':
  90. includeTestsMatching 'org.sonarqube.tests.Category1Suite'
  91. includeTestsMatching 'org.sonarqube.tests.authorization.*Suite'
  92. includeTestsMatching 'org.sonarqube.tests.measure.*Suite'
  93. includeTestsMatching 'org.sonarqube.tests.qualityGate.*Suite'
  94. includeTestsMatching 'org.sonarqube.tests.source.*Suite'
  95. break
  96. case 'Category2':
  97. includeTestsMatching 'org.sonarqube.tests.issue.*Suite'
  98. includeTestsMatching 'org.sonarqube.tests.test.*Suite'
  99. includeTestsMatching 'org.sonarqube.tests.qualityModel.*Suite'
  100. break
  101. case 'Category3':
  102. includeTestsMatching 'org.sonarqube.tests.Category3Suite'
  103. includeTestsMatching 'org.sonarqube.tests.component.*Suite'
  104. includeTestsMatching 'org.sonarqube.tests.project.*Suite'
  105. break
  106. case 'Category4':
  107. includeTestsMatching 'org.sonarqube.tests.Category4Suite'
  108. includeTestsMatching 'org.sonarqube.tests.duplication.*Suite'
  109. includeTestsMatching 'org.sonarqube.tests.user.*Suite'
  110. includeTestsMatching 'org.sonarqube.tests.webhook.*Suite'
  111. break
  112. case 'Category5':
  113. includeTestsMatching 'org.sonarqube.tests.Category5Suite'
  114. break
  115. case 'Category6':
  116. includeTestsMatching 'org.sonarqube.tests.Category6Suite'
  117. includeTestsMatching 'org.sonarqube.tests.organization.*Suite'
  118. break
  119. case 'Plugins':
  120. includeTestsMatching 'org.sonarqube.tests.plugins.PluginsSuite'
  121. break
  122. case 'Upgrade':
  123. includeTestsMatching 'org.sonarqube.tests.upgrade.UpgradeSuite'
  124. break
  125. case 'ServerPerformance':
  126. includeTestsMatching 'org.sonarqube.tests.performance.server.ServerPerformanceSuite'
  127. break
  128. }
  129. }
  130. }
  131. processTestResources() {
  132. into('/') {
  133. from configurations.includeInTestResources
  134. // TODO cache not invalidated when pattern changes?
  135. rename '(.*)-' + bytemanVersion + '.jar', '$1.jar'
  136. }
  137. }