-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add elasticsearch sanity integration tests (#2028)
These tests verify that, given an index settings and mappings, data can be written to the index, and read from it with a query_all query. These are very simple sanity tests. We can, and should, write more complex tests that specific to each index in the future.
- Loading branch information
John Plaisted
authored
Dec 3, 2020
1 parent
5f9d967
commit 838f964
Showing
25 changed files
with
1,103 additions
and
896 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
# This "container" is a workaround to pre-create search indices | ||
FROM jwilder/dockerize:0.6.1 | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache curl jq | ||
|
||
COPY chart-index-config.json corpuser-index-config.json dashboard-index-config.json dataprocess-index-config.json dataset-index-config.json / | ||
COPY docker/elasticsearch-setup/create-indices.sh / | ||
RUN chmod 755 create-indices.sh | ||
COPY gms/impl/src/main/resources/index / | ||
|
||
CMD dockerize \ | ||
-wait http://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT \ | ||
-timeout 120s \ | ||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/chartdocument --data @chart-index-config.json && \ | ||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/corpuserinfodocument --data @corpuser-index-config.json && \ | ||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/dashboarddocument --data @dashboard-index-config.json && \ | ||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/dataprocessdocument --data @dataprocess-index-config.json && \ | ||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/datasetdocument --data @dataset-index-config.json | ||
CMD dockerize -wait http://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT -timeout 120s /create-indices.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
function create_index { | ||
jq -n \ | ||
--slurpfile settings $2 \ | ||
--slurpfile mappings $3 \ | ||
'.settings=$settings[0] | .mappings.doc=$mappings[0]' > /tmp/data | ||
|
||
curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/$1 --data @/tmp/data | ||
} | ||
|
||
create_index chartdocument chart/settings.json chart/mappings.json | ||
create_index corpuserinfodocument corp-user/settings.json corp-user/mappings.json | ||
create_index dashboarddocument dashboard/settings.json dashboard/mappings.json | ||
create_index dataprocessdocument data-process/settings.json data-process/mappings.json | ||
create_index datasetdocument dataset/settings.json dataset/mappings.json |
Oops, something went wrong.