build.gradle 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. apply plugin: 'elasticsearch.standalone-rest-test'
  2. apply plugin: 'elasticsearch.rest-test'
  3. dependencies {
  4. testCompile project(path: xpackModule('core'), configuration: 'runtime')
  5. testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
  6. }
  7. String outputDir = "${buildDir}/generated-resources/${project.name}"
  8. task copyXPackPluginProps(type: Copy) {
  9. from project(xpackModule('core')).file('src/main/plugin-metadata')
  10. from project(xpackModule('core')).tasks.pluginProperties
  11. into outputDir
  12. }
  13. project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
  14. integTestRunner {
  15. systemProperty 'tests.security.manager', 'false'
  16. }
  17. integTestCluster {
  18. setting 'xpack.security.enabled', 'true'
  19. setting 'xpack.ml.enabled', 'false'
  20. setting 'xpack.license.self_generated.type', 'trial'
  21. setupCommand 'setupDummyUser',
  22. 'bin/elasticsearch-users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
  23. setupCommand 'setupTransportClientUser',
  24. 'bin/elasticsearch-users', 'useradd', 'transport', '-p', 'x-pack-test-password', '-r', 'transport_client'
  25. waitCondition = { node, ant ->
  26. File tmpFile = new File(node.cwd, 'wait.success')
  27. ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
  28. dest: tmpFile.toString(),
  29. username: 'test_user',
  30. password: 'x-pack-test-password',
  31. ignoreerrors: true,
  32. retries: 10)
  33. return tmpFile.exists()
  34. }
  35. }