Skip to content

Commit 27654ab

Browse files
authoredFeb 13, 2019
[CI] Reorganize rake tasks and set up client and rest_api testing in Jenkins (#603)
* [CI] Reorganize rake tasks and set up client and rest_api testing in Jenkins * [CI] Run unit and integrations on Jenkins * [CI] Account for possible bug with TemplateUpgradeService * [CI] Rest api yaml tests passing on es-7.0.0-alpha2
1 parent 07235fb commit 27654ab

File tree

27 files changed

+381
-232
lines changed

27 files changed

+381
-232
lines changed
 

‎.ci/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
ARG RUBY_TEST_VERSION=2.5
1+
ARG RUBY_TEST_VERSION=2.6.1
22
FROM ruby:${RUBY_TEST_VERSION}
33

4-
ARG TEST_SUITE=unit
4+
ARG TEST_SUITE=client
55
ENV TEST_SUITE=${TEST_SUITE}
66

77

‎.ci/docker-compose.yml ‎.ci/docker-compose/client.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: '3.2'
22
services:
33
client:
4-
image: docker.elastic.co/clients/elasticsearch-ruby:${RUBY_TEST_VERSION:-7.0.0-alpha2}
4+
image: docker.elastic.co/clients/elasticsearch-ruby:${RUBY_TEST_VERSION:-2.6.1}
55
build:
6-
context: ..
6+
context: ../../
77
dockerfile: .ci/Dockerfile
88
args:
99
RUBY_TEST_VERSION: ${RUBY_TEST_VERSION:-2.6.1}
10-
ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION:-6.5.0}
11-
TEST_SUITE: ${TEST_SUITE:-unit}
10+
ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION:-7.0.0-alpha2}
11+
TEST_SUITE: ${TEST_SUITE:-client}
1212
environment:
1313
- "TEST_ES_SERVER=http://elasticsearch:9200"
1414
volumes:
@@ -26,8 +26,8 @@ services:
2626
- "repositories.url.allowed_urls=http://*"
2727
- node.attr.testattr=test
2828
- bootstrap.memory_lock=false
29-
- "discovery.zen.minimum_master_nodes=2"
30-
- "discovery.zen.ping.unicast.hosts=elasticsearch"
29+
- "discovery.type=single-node"
30+
#- "discovery.zen.ping.unicast.hosts=elasticsearch"
3131
ulimits:
3232
memlock:
3333
soft: -1
@@ -39,7 +39,7 @@ services:
3939
networks:
4040
- esnet
4141
deploy:
42-
replicas: 2
42+
replicas: 1
4343
networks:
4444
esnet:
4545
volumes:

‎.ci/docker-compose/rest_api.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: '3.2'
2+
services:
3+
client:
4+
image: docker.elastic.co/clients/elasticsearch-ruby:${RUBY_TEST_VERSION:-2.6.1}
5+
build:
6+
context: ../../
7+
dockerfile: .ci/Dockerfile
8+
args:
9+
RUBY_TEST_VERSION: ${RUBY_TEST_VERSION:-2.6.1}
10+
ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION:-7.0.0-alpha2}
11+
TEST_SUITE: ${TEST_SUITE:-client}
12+
environment:
13+
- "TEST_ES_SERVER=http://elasticsearch:9200"
14+
volumes:
15+
- esvol:/tmp
16+
networks:
17+
- esnet
18+
depends_on:
19+
- elasticsearch
20+
elasticsearch:
21+
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-alpha2}
22+
environment:
23+
- cluster.name=docker-cluster
24+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
25+
- path.repo=/tmp
26+
- "repositories.url.allowed_urls=http://*"
27+
- node.attr.testattr=test
28+
- bootstrap.memory_lock=false
29+
- "discovery.type=single-node"
30+
#- "discovery.zen.ping.unicast.hosts=elasticsearch"
31+
ulimits:
32+
memlock:
33+
soft: -1
34+
hard: -1
35+
volumes:
36+
- esvol:/tmp
37+
ports:
38+
- 9200
39+
networks:
40+
- esnet
41+
deploy:
42+
replicas: 1
43+
networks:
44+
esnet:
45+
volumes:
46+
esvol:

‎.ci/run-tests

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ export TEST_SUITE=${TEST_SUITE}
1717

1818
function clean_docker_compose() {
1919
# clean up the docker-compose environment
20-
docker-compose -f .ci/docker-compose.yml down --volumes --remove-orphans
20+
docker-compose -f .ci/docker-compose/${TEST_SUITE}.yml down --volumes --remove-orphans
2121
}
2222

2323
# build the client to ensure the proper version variables are used
24-
docker-compose -f .ci/docker-compose.yml --compatibility build client
24+
docker-compose -f .ci/docker-compose/${TEST_SUITE}.yml --compatibility build client
2525
build_exit_code=$?
2626
if [[ $build_exit_code != 0 ]]; then
2727
echo "The client container failed to build."
2828
clean_docker_compose
2929
exit $build_exit_code
3030
fi
3131

32-
docker-compose -f .ci/docker-compose.yml --compatibility run client
32+
docker-compose -f .ci/docker-compose/${TEST_SUITE}.yml --compatibility run client
3333
test_exit_code=$?
3434

3535
clean_docker_compose

‎.ci/test-matrix.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUBY_TEST_VERSION:
77
- 2.4.5
88

99
TEST_SUITE:
10-
- unit
11-
- integration
10+
- rest_api
11+
- client
1212

1313
exclude: ~

‎.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ branches:
1616
- 2.x
1717
- travis
1818

19+
env:
20+
global:
21+
- TEST_ES_SERVER=http://localhost:9250
22+
1923
matrix:
2024
include:
2125

@@ -39,7 +43,7 @@ matrix:
3943
# Integration tests
4044
- rvm: 2.6.1
4145
jdk: oraclejdk8
42-
env: QUIET=y ELASTICSEARCH_HOSTS=localhost:9250,localhost:9251 TEST_SUITE=integration
46+
env: QUIET=y TEST_SUITE=integration
4347

4448
allow_failures:
4549
- rvm: ruby-head

0 commit comments

Comments
 (0)