Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Sep 9, 2021
1 parent 1c1e0e3 commit 75c331f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmd/es-index-cleaner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
es-index-cleaner-*-*
1 change: 1 addition & 0 deletions plugin/storage/es/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
esmapping-generator-*-*
2 changes: 1 addition & 1 deletion plugin/storage/integration/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func healthCheck() error {
}

func testElasticsearchStorage(t *testing.T, allTagsAsFields, archive bool) {
if os.Getenv("STORAGE") != "elasticsearch" {
if os.Getenv("STORAGE") != "elasticsearch" && os.Getenv("STORAGE") != "opensearch" {
t.Skip("Integration test against ElasticSearch skipped; set STORAGE env var to elasticsearch to run this")
}
if err := healthCheck(); err != nil {
Expand Down
13 changes: 8 additions & 5 deletions scripts/es-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ setup_opensearch() {
}

setup_query() {
local distro=$1
local os=$(go env GOOS)
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[@]}
SPAN_STORAGE_TYPE=${distro} ./cmd/query/query-${os}-${arch} ${params[@]}
}

teardown_es() {
Expand All @@ -68,7 +70,7 @@ teardown_query() {

build_query() {
make build-crossdock-ui-placeholder
GOOS=linux make build-query
make build-query
}

run_integration_test() {
Expand All @@ -83,16 +85,17 @@ run_integration_test() {
echo "Unknown distribution $distro. Valid options are opensearch or elasticsearch"
usage
fi
STORAGE=elasticsearch make storage-integration-test
STORAGE=${distro} make storage-integration-test
make index-cleaner-integration-test
make index-rollover-integration-test
teardown_es ${cid}
}

run_token_propagation_test() {
local distro=$1
build_query
make test-compile-es-scripts
setup_query &
setup_query ${distro} &
local pid=$!
make token-propagation-integration-test
teardown_query ${pid}
Expand All @@ -104,7 +107,7 @@ main() {
echo "Executing integration test for $1 $2"
run_integration_test "$1" "$2"
echo "Executing token propagation test"
run_token_propagation_test
run_token_propagation_test "$1"
}

main "$@"

0 comments on commit 75c331f

Please sign in to comment.