Skip to content

Commit

Permalink
expectations are changed for nested fields for existing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ferh6t authored and aybabtme committed Nov 18, 2024
1 parent 9613be7 commit 319e43e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func TestHarness(t *testing.T) {
mismatches = 10
t.Errorf("only showing first %d mismatches", mismatches)
}
for _, br := range ranges.ranges[:mismatches] {
for val, br := range ranges.ranges[:mismatches] {
t.Errorf("- mismatch from byte %d to %d", br.start, br.end)
wantPart := want[br.start:br.end]
t.Errorf("- mismatch from byte %v", val)
gotPart := got[br.start:br.end]
t.Errorf("want %q", wantPart)
t.Errorf("got %q", gotPart)
Expand Down
8 changes: 4 additions & 4 deletions test/cases/00001-json/want
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Aug 11 18:14:50 || <no msg> specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup]
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access]
Aug 11 18:14:50 || <no msg> specversion="1.0" type="simple-log" invloglevel="Info" data.short="service-startup" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data.message="The login-api service is running on port 8085."
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" data.short="http access" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" data.message="incoming HTTP request was served" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G"
Aug 11 18:14:59 || <no msg> id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P"
Aug 11 18:15:00 || <no msg> id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV"
Aug 11 18:15:00 || <no msg> id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP"
Aug 11 18:15:00 || <no msg> id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV"
Aug 11 18:15:05 || <no msg> id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V"
Aug 11 18:15:10 || <no msg> type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"
Aug 11 18:15:10 || <no msg> data.event="Shutdown" type="service-shutdown" id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"
Aug 11 18:15:10 || hello
Aug 11 18:15:10 || hello
Aug 11 18:15:10 || hello
Expand All @@ -23,4 +23,4 @@ Aug 11 18:15:10 || hello
<no time> |ERRO| <no msg>
<no time> |PANI| <no msg>
<no time> |SOME| <no msg>
Oct 29 08:45:54 |DEBU| first match found at index storage.i=0 source.line=243 storage.machine.id=5089 storage.session.id=1.730187806608637e+18 source.function="github.com/humanlogio/humanlog/internal/memstorage.(*MemStorageSink).firstMatch" source.file="/Users/antoine/code/src/github.com/humanlogio/humanlog/internal/memstorage/memory.go"
Oct 29 07:45:54 |DEBU| first match found at index storage.i=0 source.line=243 storage.machine.id=5089 storage.session.id=1.730187806608637e+18 source.function="github.com/humanlogio/humanlog/internal/memstorage.(*MemStorageSink).firstMatch" source.file="/Users/antoine/code/src/github.com/humanlogio/humanlog/internal/memstorage/memory.go"
6 changes: 3 additions & 3 deletions test/cases/20001-strip-docker-compose/want
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Aug 11 18:14:50 || <no msg> service=web_1 specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup]
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access]
Aug 11 18:14:50 || <no msg> service=web_1 specversion="1.0" type="simple-log" invloglevel="Info" data.short="service-startup" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data.message="The login-api service is running on port 8085."
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" data.short="http access" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" data.message="incoming HTTP request was served" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G"
Aug 11 18:14:59 || <no msg> id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P"
Aug 11 18:15:00 || <no msg> id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV"
Aug 11 18:15:00 || <no msg> id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP"
Aug 11 18:15:00 || <no msg> id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV"
Aug 11 18:15:05 || <no msg> id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V"
Aug 11 18:15:10 || <no msg> type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"
Aug 11 18:15:10 || <no msg> data.event="Shutdown" type="service-shutdown" id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"
6 changes: 3 additions & 3 deletions test/cases/20001-strip-syslog/want
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Aug 11 18:14:50 || <no msg> specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup]
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access]
Aug 11 18:14:50 || <no msg> specversion="1.0" type="simple-log" invloglevel="Info" data.short="service-startup" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data.message="The login-api service is running on port 8085."
Aug 11 18:14:55 || <no msg> invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" data.short="http access" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" data.message="incoming HTTP request was served" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G"
Aug 11 18:14:59 || <no msg> id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P"
Aug 11 18:15:00 || <no msg> id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV"
Aug 11 18:15:00 || <no msg> id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP"
Aug 11 18:15:00 || <no msg> id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV"
Aug 11 18:15:05 || <no msg> id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V"
Aug 11 18:15:10 || <no msg> type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"
Aug 11 18:15:10 || <no msg> data.event="Shutdown" type="service-shutdown" id="01FCV6SR6JZH7JZ6RFDFN9Q99Y"

0 comments on commit 319e43e

Please sign in to comment.