Skip to content

Commit

Permalink
Move migrate before a restore, because of shard being destroyed by re…
Browse files Browse the repository at this point in the history
…store
  • Loading branch information
rolljee committed Jan 24, 2024
1 parent 668b21f commit 0da35ed
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions features/Elasticsearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ Feature: Elasticsearch commands
Then I should match stdout with "{"index": "%kuzzle.users", "alias": "@%kuzzle.users"}"

@mappings
Scenario: Dump and restore ES data to a dump folder using the pattern option
Given an index "nyc-open-data"
Given a collection "nyc-open-data":"yellow-taxi"
Then I create the following document:
| _id | "chuon-chuon-kim" |
| body | { "city": "hcmc", "district": 1 } |
Then I create the following document:
| _id | "the-hive-vn" |
| body | { "city": "hcmc", "district": 2 } |
Then I create the following document:
| _id | "the-hive-th" |
| body | { "city": "changmai", "district": 7 } |
Then I count 3 documents
Then I run the command "es:migrate" with:
| flag | --src | http://localhost:9200 |
| flag | --dest | ./kourou-dump |
Then I should have 3 lines in file "./kourou-dump/&nyc-open-data.yellow-taxi.json"
Then I run the command "es:migrate" with:
| flag | --src | ./kourou-dump |
| flag | --dest | http://localhost:9200 |
| flag | --reset | |
| flag | --no-interactive | |
Given an existing collection "nyc-open-data":"yellow-taxi"
Then I refresh the collection
And I count 3 documents

Scenario: Insert ES document
Given a collection "nyc-open-data":"green-taxi"
When I run the command "es:indices:insert" with:
Expand Down Expand Up @@ -62,29 +88,3 @@ Feature: Elasticsearch commands
| arg | backup | |
| arg | test-snapshot | |
Then I should match stdout with "Success"

Scenario: Dump and restore ES data to a dump folder using the pattern option
Given an index "nyc-open-data"
Given a collection "nyc-open-data":"yellow-taxi"
Then I create the following document:
| _id | "chuon-chuon-kim" |
| body | { "city": "hcmc", "district": 1 } |
Then I create the following document:
| _id | "the-hive-vn" |
| body | { "city": "hcmc", "district": 2 } |
Then I create the following document:
| _id | "the-hive-th" |
| body | { "city": "changmai", "district": 7 } |
Then I count 3 documents
Then I run the command "es:migrate" with:
| flag | --src | http://localhost:9200 |
| flag | --dest | ./kourou-dump |
Then I should have 3 lines in file "./kourou-dump/&nyc-open-data.yellow-taxi.json"
Then I run the command "es:migrate" with:
| flag | --src | ./kourou-dump |
| flag | --dest | http://localhost:9200 |
| flag | --reset | |
| flag | --no-interactive | |
Given an existing collection "nyc-open-data":"yellow-taxi"
Then I refresh the collection
And I count 3 documents

0 comments on commit 0da35ed

Please sign in to comment.