@@ -31,10 +31,12 @@ endif
31
31
$(eval testintegargs += "-cover" "-coverprofile=tmp/integration-client.cov" "-tags='$(testintegtags)'" "-timeout=1h")
32
32
@mkdir -p tmp
33
33
@if which gotestsum > /dev/null 2>&1 ; then \
34
+ export ELASTICSEARCH_URL='http ://elastic:elastic@localhost:9200'; \
34
35
echo " gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml --" $(testintegargs ) ; \
35
36
gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs ) " ." ; \
36
37
gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs ) " ./estransport" " ./esapi" " ./esutil" ; \
37
38
else \
39
+ export ELASTICSEARCH_URL=' http://elastic:elastic@localhost:9200' ; \
38
40
echo " go test -v" $(testintegargs ) " ." ; \
39
41
go test -v $(testintegargs ) " ./estransport" " ./esapi" " ./esutil" ; \
40
42
fi ;
@@ -72,7 +74,7 @@ ifeq ($(flavor), platinum)
72
74
}
73
75
else
74
76
$(eval testapiargs += $(PWD)/esapi/test/*_test.go)
75
- @ { \
77
+ { \
76
78
set -e ; \
77
79
trap "test -d .git && git checkout --quiet $(PWD)/esapi/test/go.mod" INT TERM EXIT; \
78
80
if which gotestsum > /dev/null 2>&1 ; then \
@@ -113,7 +115,7 @@ test-examples: ## Execute the _examples
113
115
printf " \033[2m────────────────────────────────────────────────────────────────────────────────\n" ; \
114
116
printf " \033[1m$$ f\033[0m\n" ; \
115
117
printf " \033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n" ; \
116
- (go run $$ f && true) || \
118
+ (export ELASTICSEARCH_URL=http://elastic:elastic@localhost:9200 && go run $$ f && true) || \
117
119
( \
118
120
printf " \033[31m────────────────────────────────────────────────────────────────────────────────\033[0m\n" ; \
119
121
printf " \033[31;1m⨯ ERROR\033[0m\n" ; \
286
288
$(eval detach ?= "false")
287
289
endif
288
290
291
+ $(eval elasticsearch_url = "http://elastic:elastic@es1:9200")
289
292
ifeq ($(flavor ) , platinum)
290
293
$(eval elasticsearch_url = "https://elastic:elastic@es1:9200")
291
294
$(eval xpack_env += --env "ELASTIC_PASSWORD=elastic")
@@ -315,6 +318,7 @@ endif
315
318
docker run \
316
319
--name "es$$n" \
317
320
--network elasticsearch \
321
+ --env "ELASTIC_PASSWORD=elastic" \
318
322
--env "node.name=es$$n" \
319
323
--env "cluster.name=go-elasticsearch" \
320
324
--env "cluster.initial_master_nodes=es1" \
@@ -324,7 +328,6 @@ endif
324
328
--env "node.attr.testattr=test" \
325
329
--env "path.repo=/tmp" \
326
330
--env "repositories.url.allowed_urls=http://snapshot.test*" \
327
- --env "xpack.security.enabled=false" \
328
331
--env ES_JAVA_OPTS="-Xms1g -Xmx1g" \
329
332
$(xpack_env) \
330
333
--volume `echo $(version) | tr -C "[:alnum:]" '-'`-node-$$n-data:/usr/share/elasticsearch/data \
0 commit comments