forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes-integration-test.sh
executable file
·86 lines (73 loc) · 1.62 KB
/
es-integration-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
set -euxf -o pipefail
usage() {
echo $"Usage: $0 <es_version>"
exit 1
}
check_arg() {
if [ ! $# -eq 1 ]; then
echo "ERROR: need exactly one argument"
usage
fi
}
setup_es() {
local tag=$1
local image=docker.elastic.co/elasticsearch/elasticsearch
local params=(
--rm
--detach
--publish 9200:9200
--env "http.host=0.0.0.0"
--env "transport.host=127.0.0.1"
--env "xpack.security.enabled=false"
--env "xpack.monitoring.enabled=false"
)
local cid=$(docker run ${params[@]} ${image}:${tag})
echo ${cid}
}
setup_query() {
local arch=$(go env GOARCH)
local params=(
--es.tls.enabled=false
--es.version=7
--es.server-urls=http://127.0.0.1:9200
--query.bearer-token-propagation=true
)
SPAN_STORAGE_TYPE=elasticsearch ./cmd/query/query-linux-${arch} ${params[@]}
}
teardown_es() {
local cid=$1
docker kill ${cid}
}
teardown_query() {
local pid=$1
kill -9 ${pid}
}
build_query() {
make build-crossdock-ui-placeholder
GOOS=linux make build-query
}
run_integration_test() {
local es_version=$1
local cid=$(setup_es ${es_version})
STORAGE=elasticsearch make storage-integration-test
make index-cleaner-integration-test
make index-rollover-integration-test
teardown_es ${cid}
}
run_token_propagation_test() {
build_query
make test-compile-es-scripts
setup_query &
local pid=$!
make token-propagation-integration-test
teardown_query ${pid}
}
main() {
check_arg "$@"
echo "Executing integration test for elasticsearch $1"
run_integration_test "$1"
echo "Executing token propagation test"
run_token_propagation_test
}
main "$@"