Elasticsearch: Remove insertion of test data in helm tests
This removes the insertion of test dummy data and the following query for it from the Elasticsearch helm tests. Upon upgrades, it's possible for Elasticsearch to refuse the direct insertion of data due to shard reallocation and due to full bulk endpoint queues. These refusals should not be seen as test failures Change-Id: Id53d53a7aa2b58e64932d50ca3e7a4fb1141bb3a
This commit is contained in:
parent
87263a6e3c
commit
05e57f4e37
@ -38,45 +38,6 @@ function create_test_index () {
|
||||
fi
|
||||
}
|
||||
|
||||
function insert_data_into_test_index () {
|
||||
insert_result=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
||||
-XPUT "${ELASTICSEARCH_ENDPOINT}/test_index/sample_type/123/_create?pretty" -H 'Content-Type: application/json' -d'
|
||||
{
|
||||
"name" : "Elasticsearch",
|
||||
"message" : "Test data text entry"
|
||||
}
|
||||
' | python -c "import sys, json; print json.load(sys.stdin)['result']")
|
||||
if [ "$insert_result" == "created" ]; then
|
||||
sleep 20
|
||||
echo "PASS: Test data inserted into test index!";
|
||||
else
|
||||
echo "FAIL: Test data not inserted into test index!";
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function check_hits_on_test_data () {
|
||||
total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
||||
"${ELASTICSEARCH_ENDPOINT}/_search?pretty" -H 'Content-Type: application/json' -d'
|
||||
{
|
||||
"query" : {
|
||||
"bool": {
|
||||
"must": [
|
||||
{ "match": { "name": "Elasticsearch" }},
|
||||
{ "match": { "message": "Test data text entry" }}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
' | python -c "import sys, json; print json.load(sys.stdin)['hits']['total']")
|
||||
if [ "$total_hits" -gt 0 ]; then
|
||||
echo "PASS: Successful hits on test data query!"
|
||||
else
|
||||
echo "FAIL: No hits on query for test data! Exiting";
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function check_snapshot_repositories () {
|
||||
{{ range $repository := .Values.conf.elasticsearch.snapshots.repositories }}
|
||||
repository={{$repository.name}}
|
||||
@ -99,8 +60,6 @@ function remove_test_index () {
|
||||
|
||||
remove_test_index || true
|
||||
create_test_index
|
||||
insert_data_into_test_index
|
||||
check_hits_on_test_data
|
||||
{{ if .Values.conf.elasticsearch.snapshots.enabled }}
|
||||
check_snapshot_repositories
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user