Skip to content

Commit

Permalink
update integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblack committed Dec 20, 2023
1 parent f89a902 commit 70b5963
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ services:
- ELASTICSEARCH_URL=http://elasticsearch.integration:9200
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=topsecret
command: "-f /configs/opensearch_example.yaml"
command: "-f /inputs/opensearch_example.yaml"
volumes:
- ./configs:/configs:Z
- ./inputs:/inputs:Z
depends_on:
elasticsearch-integration:
condition: service_healthy
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/fixtures/empty_data.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
url: OPENSEARCH_URL
username: OPENSEARCH_USERNAME
password: OPENSEARCH_PASSWORD
index: empty-data
data: {}
default_index: empty-data
metadata: {}
bulk_upload_list:
- operation:
index: {}
data: {}
36 changes: 26 additions & 10 deletions tests/integration/fixtures/nested_data.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
url: OPENSEARCH_URL
username: OPENSEARCH_USERNAME
password: OPENSEARCH_PASSWORD
index: nested-data
data: {
"keyNo3": "Mambo No 3",
"nestedKey": {
"deeper-nested-1": {
"deeper-nested-key": 1,
"another-key-deeply-nested": "here I am"
},
"deeper-nested-2": "some value"
},
default_index: nested-data
metadata: {
"mKeyNo1": "squirrel",
"mKeyNo2": {
"Translations": [
- "Eichhörnchen"
- "ardilla"
- "écureuil"
- "scoiattolo"
]
}
}
bulk_upload_list:
- operation:
index:
_index: nested-data
_id: abc123def
data: {
"keyNo3": "Mambo No 3",
"nestedKey": {
"deeper-nested-1": {
"deeper-nested-key": 1,
"another-key-deeply-nested": "here I am"
},
"deeper-nested-2": "some value"
},
}
21 changes: 17 additions & 4 deletions tests/integration/fixtures/simple_data.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
url: OPENSEARCH_URL
username: OPENSEARCH_USERNAME
password: OPENSEARCH_PASSWORD
index: simple-data
data: {
"keyNo1": "xXx",
"keyNo2": "Mambo No 5",
default_index: simple-data
metadata: {
"mKeyNo1": "squirrel",
"mKeyNo2": "Eichhörnchen",
}
bulk_upload_list:
- operation:
index: {}
data: {
"keyNo1": "xXx",
"keyNo2": "Mambo No 5",
}
- operation:
create: {}
data: {
"keyNo1": "yYy",
"keyNo2": "Mambo No 6",
}
8 changes: 8 additions & 0 deletions tests/integration/test_arcaflow_plugin_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def test_simple_data(self) -> None:
expectedData = {
"keyNo1": "xXx",
"keyNo2": "Mambo No 5",
"mKeyNo1": "squirrel",
"mKeyNo2": "Eichhörnchen",
}
self.assertStoredData(expectedData, "simple-data")

Expand All @@ -75,6 +77,12 @@ def test_nested_data(self) -> None:
},
"deeper-nested-2": "some value",
},
"mKeyNo1": "squirrel",
"mKeyNo2": {
"Translations": [
-"Eichhörnchen" - "ardilla" - "écureuil" - "scoiattolo"
]
},
}

self.assertStoredData(expectedData, "nested-data")
Expand Down

0 comments on commit 70b5963

Please sign in to comment.