Skip to content

Commit

Permalink
Add ES8 tests, add test data for breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
hoenn committed Apr 2, 2024
1 parent 40a2451 commit d3e80c1
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 3 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions integration_data/v6/documents.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
20 changes: 20 additions & 0 deletions integration_data/v7/documents.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test", "_type" : "testdoc" } }
{ "stat" : "test_data", "value": "foo" }
20 changes: 20 additions & 0 deletions integration_data/v8/documents.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test"} }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
{ "index" : { "_index" : "integration_test" } }
{ "stat" : "test_data", "value": "foo" }
82 changes: 82 additions & 0 deletions integration_data/v8/elasticsearch-cluster-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: '3'

services:
elasticsearch-v8:
build:
context: .
dockerfile: elasticsearch.dockerfile
image: vulcanizer-elasticsearch:v8
container_name: vulcanizer-elasticsearch-v8
environment:
- cluster.name=vulcanizer-elasticsearch-v8
- node.name=vulcanizer-elasticsearch-v8
- bootstrap.memory_lock=true
- "path.repo=/backups"
- "discovery.seed_hosts=vulcanizer-elasticsearch-v8,vulcanizer-elasticsearch-v8-2"
- "cluster.initial_master_nodes=vulcanizer-elasticsearch-v8,vulcanizer-elasticsearch-v8-2"
- "ES_JAVA_OPTS=-Xms512M -Xmx512M"
- xpack.security.enabled=false
- xpack.profiling.enabled=false
- xpack.ml.enabled=false
- xpack.graph.enabled=false
- xpack.watcher.enabled=false
- ingest.geoip.downloader.enabled=false
- indices.lifecycle.history_index_enabled=false
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
ports:
- 49200:9200
networks:
- vulcanizer-esnet
volumes:
- vulcanizer-backup-volume:/backups

elasticsearch-v8-2:
build:
context: .
dockerfile: elasticsearch.dockerfile
image: vulcanizer-elasticsearch:v8
depends_on:
- "elasticsearch-v8"
container_name: vulcanizer-elasticsearch-v8-2
environment:
- cluster.name=vulcanizer-elasticsearch-v8
- bootstrap.memory_lock=true
- node.name=vulcanizer-elasticsearch-v8-2
- "path.repo=/backups"
- "discovery.seed_hosts=vulcanizer-elasticsearch-v8,vulcanizer-elasticsearch-v8-2"
- "cluster.initial_master_nodes=vulcanizer-elasticsearch-v8,vulcanizer-elasticsearch-v8-2"
- "ES_JAVA_OPTS=-Xms512M -Xmx512M"
- xpack.security.enabled=false
- xpack.profiling.enabled=false
- xpack.ml.enabled=false
- xpack.graph.enabled=false
- xpack.watcher.enabled=false
- ingest.geoip.downloader.enabled=false
- indices.lifecycle.history_index_enabled=false
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
networks:
- vulcanizer-esnet
volumes:
- vulcanizer-backup-volume:/backups

networks:
vulcanizer-esnet:

volumes:
vulcanizer-backup-volume:
7 changes: 7 additions & 0 deletions integration_data/v8/elasticsearch.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:8.13.0

USER root

RUN mkdir /backups && chown elasticsearch:elasticsearch /backups

USER elasticsearch
4 changes: 3 additions & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//go:build integration
// +build integration

package vulcanizer_test

import (
"github.com/github/vulcanizer"
"testing"
"time"

"github.com/github/vulcanizer"
)

func TestNodes(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions script/integration-test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ fi
# Run regular unit tests first
./script/test

elasticsearch_versions=(v5 v6 v7)
# These match integration_data/ sub-folder names
elasticsearch_versions=(v5 v6 v7 v8)

for v in "${elasticsearch_versions[@]}"
do
Expand All @@ -44,7 +45,7 @@ do
}
}'
echo "Filling in data to integration_test index"
curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:49200/_bulk --data-binary "@../documents.dat"; echo
curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:49200/_bulk --data-binary "@documents.dat"; echo
echo "Creating snapshot repository backup-repo"
curl -H "Content-Type: application/json" -XPUT localhost:49200/_snapshot/backup-repo -d '{ "type": "fs", "settings": { "location": "/backups" } }'
echo "Making snapshot snapshot_1 in repository backup-repo"
Expand Down

0 comments on commit d3e80c1

Please sign in to comment.