Skip to content

Commit

Permalink
tests for query and schemas with subtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Bilal committed Jan 3, 2025
1 parent 80ac4f2 commit 529a598
Show file tree
Hide file tree
Showing 7 changed files with 1,057 additions and 1 deletion.
3 changes: 3 additions & 0 deletions connector/fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var tests = []test{
{
name: "books",
},
{
name: "books_2",
},
}

func TestSchema(t *testing.T) {
Expand Down
6 changes: 5 additions & 1 deletion connector/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ var tests = []test{
group: "payments",
name: "simple_terms_clause",
},
{
group: "customers",
name: "sort_by_subtype",
},
}

func TestPrepareElasticsearchQuery(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Run(tt.group + "." + tt.name, func(t *testing.T) {
ctx := context.Background()
ctx = context.WithValue(ctx, "postProcessor", &types.PostProcessor{})
initTest(t, &tt)
Expand Down
38 changes: 38 additions & 0 deletions testdata/unit_tests/fields_tests/books_2/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"indices": {
"my_book_index": {
"mappings": {
"properties": {
"author": {
"type": "keyword"
},
"description": {
"type": "text"
},
"genre": {
"type": "keyword"
},
"pages": {
"type": "integer"
},
"published_date": {
"format": "yyyy-MM-dd",
"type": "date"
},
"rating": {
"type": "float"
},
"title": {
"fields": {
"keywordSubField": {
"type": "keyword"
}
},
"type": "text"
}
}
}
}
},
"queries": {}
}
Loading

0 comments on commit 529a598

Please sign in to comment.