Skip to content

Commit

Permalink
Fixed failing test
Browse files Browse the repository at this point in the history
And removed incorrect warnings check from another test. But that test is not providing any warnings, so we have a bug in enrich warnings production.
  • Loading branch information
craigtaverner committed Nov 11, 2024
1 parent 498adc3 commit 678a302
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,36 @@ teardown:
---
"Invalid IP strings":
- requires:
cluster_features: ["gte_v8.14.0"]
reason: "IP range ENRICH support was added in 8.14.0"
capabilities:
- method: POST
path: /_query
parameters: [method, path, parameters, capabilities]
capabilities: [enrich_strict_range_types]
reason: "Runtime range type checking was added"
test_runner_features: [capabilities, allowed_warnings_regex, warnings_regex]

- do:
catch: /'invalid_[\d\.]+' is not an IP string literal/
allowed_warnings_regex:
- "No limit defined, adding default limit of \\[.*\\]"

esql.query:
body:
query: 'FROM events | eval ip_str = concat("invalid_", to_string(ip)) | ENRICH networks-policy ON ip_str | sort @timestamp | KEEP ip, name, department, message'
query: 'FROM events | eval ip_str = mv_concat("invalid_", to_string(ip)) | ENRICH networks-policy ON ip_str | sort @timestamp | KEEP ip, name, department, message'

- match: { columns.0.name: "ip" }
- match: { columns.0.type: "ip" }
- match: { columns.1.name: "name" }
- match: { columns.1.type: "keyword" }
- match: { columns.2.name: "department" }
- match: { columns.2.type: "keyword" }
- match: { columns.3.name: "message" }
- match: { columns.3.type: "keyword" }

- length: { values: 4 }
- match: { values.0: [ "10.100.0.21", null, null, "network connected" ] }
- match: { values.1: [ [ "10.100.0.21", "10.101.0.107" ], null, null, "sending messages" ] }
- match: { values.2: [ "10.101.0.107" , null, null, "network disconnected" ] }
- match: { values.3: [ "13.101.0.114" , null, null, "authentication failed" ] }

---
"IP":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ teardown:
- do:
allowed_warnings_regex:
- "No limit defined, adding default limit of \\[.*\\]"
- "Line 1:29: evaluation of [ak::integer] failed, treating result as null. Only first 20 failures recorded."
- "Line 1:29: org.elasticsearch.xpack.esql.core.InvalidArgumentException: Cannot parse number [immortal]"
esql.query:
body:
query: 'FROM employees | ENRICH ages-policy ON name | STATS count=COUNT(*) BY description | SORT count DESC, description ASC'
Expand Down

0 comments on commit 678a302

Please sign in to comment.