Skip to content

Commit

Permalink
test(logparser): add bad ts test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Dec 11, 2023
1 parent d1a88c7 commit 4984414
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions internal/logparser/_golden/genericjson_zap_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"severity": {
"str": "Info",
"number": 9,
"text": "info"
},
"body": "BadTimestamp",
"attrs": {
"ts": "\""
}
}
11 changes: 11 additions & 0 deletions internal/logparser/_golden/genericjson_zap_03.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"severity": {
"str": "Info",
"number": 9,
"text": "info"
},
"body": "BadTimestamp",
"attrs": {
"ts": "-"
}
}
4 changes: 3 additions & 1 deletion internal/logparser/_testdata/genericjson/zap.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"level":"info","ts":1701681119.1613183,"logger":"poll","caller":"gh-archived/main.go:197","msg":"Events","duration":0.437301455,"integers":[1, 2, 3],"new_count":100,"remaining":1040,"used":3960,"reset":660.838704106,"reset_human":"in 12 minutes","sleep":0.198120375,"target_rate":0.63542183}
{"level":"info","ts":1701681119.1613183,"logger":"poll","caller":"gh-archived/main.go:197","msg":"Events","duration":0.437301455,"integers":[1, 2, 3],"new_count":100,"remaining":1040,"used":3960,"reset":660.838704106,"reset_human":"in 12 minutes","sleep":0.198120375,"target_rate":0.63542183}
{"level":"info","ts":"\"","msg":"BadTimestamp"}
{"level":"info","ts":"-","msg":"BadTimestamp"}

0 comments on commit 4984414

Please sign in to comment.