Skip to content

Commit

Permalink
add integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: inge4pres <[email protected]>
  • Loading branch information
inge4pres committed Dec 9, 2024
1 parent ef2a8ea commit 945d91e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,26 @@ setup:
- length: { hits.hits: 2 }
- match: { hits.hits.0.fields: { "log.level": ["error"] } }
- match: { hits.hits.1.fields: { "log.level": ["warn"] } }
---
"Test traces-apm-* setting event.ingested via ingest pipeline":
- do:
bulk:
index: logs-apm.error-event-ingested-testing
refresh: true
body:
# No event.ingested field populated, it gets added
- create: {}
- '{"@timestamp": "2017-06-22", "log": {"level": "error"}, "error": {"log": {"message": "loglevel"}, "exception": [{"message": "exception_used"}]}}'

# event.ingested populated, it gets overwritten
- create: {}
- '{"@timestamp": "2017-06-22", "log": {"level": "warn"}, "error": {"log": {"message": "loglevel"}, "exception": [{"message": "exception_used"}]}, "event": {"ingested": "2017-06-22 22:00:00.000Z"}}'

- is_false: errors

- do:
search:
index: logs-apm.error-event-ingested-testing
body:
fields: ["event.ingested"]
- length: { hits.hits: 2 }
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,27 @@ setup:
- match: { hits.hits.1.fields: null }
- match: { hits.hits.2.fields: {"event.success_count": [1]} }
- match: { hits.hits.3.fields: {"event.success_count": [0]} }
---
"Test traces-apm-* setting event.ingested via ingest pipeline":
- do:
bulk:
index: traces-apm-testing
refresh: true
body:
# No event.ingested field populated, it gets added
- create: {}
- '{"@timestamp": "2017-06-22"}'

# event.ingested populated, it gets overwritten
- create: {}
- '{"@timestamp": "2017-06-22", "event": {"ingested": "2017-06-22T00:00:00.123456Z"}}'

- is_false: errors

- do:
search:
index: traces-apm-testing
body:
fields: ["event.ingested"]
- length: { hits.hits: 2 }

0 comments on commit 945d91e

Please sign in to comment.