feat(dx): port all 47 search tests to YAML scenarios · gitlabhq/orbit-knowledge-graph@571eaba · GitHub
Skip to content

Commit 571eaba

Browse files
Michael UsachenkoGitLab
authored andcommitted
feat(dx): port all 47 search tests to YAML scenarios
1 parent f536df8 commit 571eaba

45 files changed

Lines changed: 1078 additions & 25 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎crates/integration-testkit/src/query_scenario/mod.rs‎

Lines changed: 75 additions & 25 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_boolean_columns_have_correct_values
2+
description: Boolean columns serialize as true/false values
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "n", "entity": "Note", "id_range": {"start": 1, "end": 10000},
9+
"columns": ["note", "confidential", "internal"],
10+
"node_ids": [3000, 3001]}],
11+
"limit": 10
12+
}
13+
14+
expect:
15+
node_count: 2
16+
nodes:
17+
Note:
18+
ids: [3000, 3001]
19+
rows:
20+
- { id: 3000, confidential: false, internal: false }
21+
- { id: 3001, confidential: true, internal: false }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_combined_filter_node_ids_order_by
2+
description: Filter, node_ids, and order_by combine correctly
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "u", "entity": "User", "id_range": {"start": 1, "end": 10000},
9+
"columns": ["username", "state"],
10+
"node_ids": [1, 2, 3, 5],
11+
"filters": {"state": "active"}}],
12+
"order_by": "-u.id",
13+
"limit": 10
14+
}
15+
16+
expect:
17+
node_count: 3
18+
nodes:
19+
User:
20+
order: [3, 2, 1]
21+
absent: [5]
22+
filters:
23+
state: active
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_datetime_columns_serialize_as_strings
2+
description: DateTime columns serialize as strings containing the date components
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "n", "entity": "Note", "id_range": {"start": 1, "end": 10000},
9+
"columns": ["note", "created_at"],
10+
"node_ids": [3000, 3001]}],
11+
"limit": 10
12+
}
13+
14+
expect:
15+
node_count: 2
16+
nodes:
17+
Note:
18+
ids: [3000, 3001]
19+
prop_present: [created_at]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_default_columns_include_full_path
2+
description: Default columns include full_path without explicit column selection
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "g", "entity": "Group", "id_range": {"start": 1, "end": 10000}}],
9+
"limit": 10
10+
}
11+
12+
expect:
13+
node_count: 5
14+
nodes:
15+
Group:
16+
prop_present: [full_path]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_definition_content_selective
2+
description: Definition content contains filter returns matching definitions
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "d", "entity": "Definition",
9+
"node_ids": [12000, 12001, 12002, 12100, 12102],
10+
"columns": ["name", "file_path", "content"],
11+
"filters": {
12+
"content": {"contains": "normalize"}
13+
}}],
14+
"limit": 10
15+
}
16+
17+
expect:
18+
node_count: 1
19+
nodes:
20+
Definition:
21+
ids: [12000]
22+
filters:
23+
content: { contains: normalize }
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_file_content_combined_with_physical
2+
description: File content virtual filter combined with physical path filter
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "f", "entity": "File",
9+
"node_ids": [13000, 13001, 13002, 13003, 13004],
10+
"columns": ["path", "project_id", "content"],
11+
"filters": {
12+
"project_id": {"eq": 1000},
13+
"path": {"starts_with": "src/"},
14+
"content": {"contains": "ClickHouse"}
15+
}}],
16+
"limit": 10
17+
}
18+
19+
expect:
20+
node_count: 1
21+
nodes:
22+
File:
23+
ids: [13001]
24+
filters:
25+
path: { starts_with: "src/" }
26+
project_id: { eq: 1000 }
27+
content: { contains: ClickHouse }
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_file_content_contains_selective
2+
description: File content contains filter returns matching files
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "f", "entity": "File",
9+
"node_ids": [13000, 13001, 13002, 13003, 13004],
10+
"columns": ["path", "project_id", "content"],
11+
"filters": {
12+
"project_id": {"eq": 1000},
13+
"content": {"contains": "ClickHouse"}
14+
}}],
15+
"order_by": "f.id",
16+
"limit": 10
17+
}
18+
19+
expect:
20+
node_count: 2
21+
nodes:
22+
File:
23+
order: [13001, 13002]
24+
filters:
25+
project_id: { eq: 1000 }
26+
content: { contains: ClickHouse }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# source: crates/integration-tests/tests/server/data_correctness/search.rs::search_file_content_ends_with
2+
description: File content ends_with filter matches suffix
3+
4+
query:
5+
json: |
6+
{
7+
"query_type": "traversal",
8+
"nodes": [{"id": "f", "entity": "File",
9+
"node_ids": [13000, 13001, 13002, 13003, 13004],
10+
"columns": ["path", "project_id", "content"],
11+
"filters": {
12+
"project_id": {"eq": 1000},
13+
"content": {"ends_with": "crate."}
14+
}}],
15+
"limit": 10
16+
}
17+
18+
expect:
19+
node_count: 1
20+
nodes:
21+
File:
22+
ids: [13002]
23+
filters:
24+
project_id: { eq: 1000 }
25+
content: { ends_with: "crate." }
Lines changed: 25 additions & 0 deletions

0 commit comments

Comments
 (0)