mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-30 19:41:46 +01:00
76 lines
2.7 KiB
YAML
76 lines
2.7 KiB
YAML
|
tests:
|
||
|
- name: Basic Test
|
||
|
inputs:
|
||
|
- insert_at: quota_check
|
||
|
type: vrl
|
||
|
source: |
|
||
|
.message = [{}]
|
||
|
.message[0].properties = {}
|
||
|
.message[0].properties."$$session_id" = "123"
|
||
|
.message[0].properties."$$window_id" = "123"
|
||
|
.message[0].properties."token" = "123"
|
||
|
.message[0].properties."distinct_id" = "123"
|
||
|
.message[0].properties."$$snapshot_data" = [{"offset": 123}]
|
||
|
|
||
|
.ip = "0.0.0.0"
|
||
|
.timestamp = now()
|
||
|
."_" = "123456789"
|
||
|
%token = "123"
|
||
|
|
||
|
outputs:
|
||
|
- conditions:
|
||
|
- source: |
|
||
|
assert!(is_string(.uuid))
|
||
|
assert!(is_string(%headers.token))
|
||
|
assert!(is_string(parse_json!(.data).uuid))
|
||
|
assert!(parse_json!(.data).properties."$$snapshot_items"[0].offset == 123)
|
||
|
type: vrl
|
||
|
extract_from: overflow_check._unmatched
|
||
|
- name: Quota limited
|
||
|
inputs:
|
||
|
- insert_at: quota_check
|
||
|
type: vrl
|
||
|
source: |
|
||
|
.message = [{}]
|
||
|
.message[0].properties = {}
|
||
|
.message[0].properties."$$session_id" = "123"
|
||
|
.message[0].properties."$$window_id" = "123"
|
||
|
.message[0].properties."token" = "limited_token"
|
||
|
.message[0].properties."distinct_id" = "123"
|
||
|
.message[0].properties."$$snapshot_data" = [{"offset": 123}]
|
||
|
|
||
|
.ip = "0.0.0.0"
|
||
|
.timestamp = now()
|
||
|
."_" = "123456789"
|
||
|
%token = "limited_token"
|
||
|
outputs:
|
||
|
- conditions:
|
||
|
- source: |
|
||
|
true
|
||
|
type: vrl
|
||
|
extract_from: metric_quota_dropped
|
||
|
- name: Overflow
|
||
|
inputs:
|
||
|
- insert_at: quota_check
|
||
|
type: vrl
|
||
|
source: |
|
||
|
.message = [{}]
|
||
|
.message[0].properties = {}
|
||
|
.message[0].properties."$$session_id" = "overflow_session"
|
||
|
.message[0].properties."$$window_id" = "123"
|
||
|
.message[0].properties."token" = "123"
|
||
|
.message[0].properties."distinct_id" = "123"
|
||
|
.message[0].properties."$$snapshot_data" = [{"offset": 123}]
|
||
|
|
||
|
.ip = "0.0.0.0"
|
||
|
.timestamp = now()
|
||
|
."_" = "123456789"
|
||
|
%token = "123"
|
||
|
|
||
|
outputs:
|
||
|
- conditions:
|
||
|
- source: |
|
||
|
true
|
||
|
type: vrl
|
||
|
extract_from: overflow_check.overflow
|