Skip to content

Commit

Permalink
Merge pull request #4326 from vespa-engine/toregge/switch-to-json-for…
Browse files Browse the repository at this point in the history
…-expected-result-file

Switch to JSON for expected result file.
  • Loading branch information
geirst authored Jan 28, 2025
2 parents f338755 + 305d207 commit 75200df
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 23 deletions.
6 changes: 3 additions & 3 deletions tests/search/parent_child/grouping_sorting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def run_imported_attributes_can_be_used_for_grouping(sub_test_dir)
deploy_and_start
feed_baseline

assert_grouping('all(group(my_campaign_name) each(output(sum(my_budget))))', 'group_on_parent_name.xml')
assert_grouping('all(group(my_campaign_name) each(output(sum(my_budget))))', 'group_on_parent_name')
end

def assert_grouping(grouping_query, file_name)
assert_xml_result_with_timeout(2.0, "/search/?hits=0&query=sddocname:ad&select=#{grouping_query}",
get_test_path(file_name))
assert_result("/search/?hits=0&query=sddocname:ad&select=#{grouping_query}",
get_test_path("#{file_name}.json"))
end

def assert_sorting(sort_spec, hits, file_name)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"root": {
"id": "toplevel",
"relevance": 1.0,
"fields": {
"totalCount": 5
},
"coverage": {
"coverage": 100,
"documents": 5,
"full": true,
"nodes": 1,
"results": 1,
"resultsFull": 1
},
"children": [
{
"id": "group:root:0",
"relevance": 1.0,
"continuation": {
"this": ""
},
"children": [
{
"id": "grouplist:my_campaign_name",
"relevance": 1.0,
"label": "my_campaign_name",
"children": [
{
"id": "group:string:plumbus",
"relevance": 21.0,
"value": "plumbus",
"fields": {
"sum(my_budget)": 20
}
},
{
"id": "group:string:gazorpazorpfield",
"relevance": 13.0,
"value": "gazorpazorpfield",
"fields": {
"sum(my_budget)": 20
}
},
{
"id": "group:string:morty",
"relevance": 10.0,
"value": "morty",
"fields": {
"sum(my_budget)": 10
}
}
]
}
]
}
]
}
}

This file was deleted.

0 comments on commit 75200df

Please sign in to comment.