@@ -47,7 +47,7 @@ func TestProcessS3Record(t *testing.T) {
4747 },
4848 cfg : testutil .EmptyConfig (),
4949 chanSize : 1 ,
50- want : []model.LogEntry {wantS3Entry ("line1" , "s3" , "s3" , model. Tags { "service:s3" } )},
50+ want : []model.LogEntry {wantS3Entry ("line1" , "s3" , "s3" , nil )},
5151 },
5252 "multiple lines" : {
5353 mockSetup : func (m * MockS3APIClient ) {
@@ -59,9 +59,9 @@ func TestProcessS3Record(t *testing.T) {
5959 cfg : testutil .EmptyConfig (),
6060 chanSize : 3 ,
6161 want : []model.LogEntry {
62- wantS3Entry ("line1" , "s3" , "s3" , model. Tags { "service:s3" } ),
63- wantS3Entry ("line2" , "s3" , "s3" , model. Tags { "service:s3" } ),
64- wantS3Entry ("line3" , "s3" , "s3" , model. Tags { "service:s3" } ),
62+ wantS3Entry ("line1" , "s3" , "s3" , nil ),
63+ wantS3Entry ("line2" , "s3" , "s3" , nil ),
64+ wantS3Entry ("line3" , "s3" , "s3" , nil ),
6565 },
6666 },
6767 "empty file" : {
@@ -91,7 +91,7 @@ func TestProcessS3Record(t *testing.T) {
9191 },
9292 cfg : testutil .EmptyConfig (),
9393 chanSize : 1 ,
94- want : []model.LogEntry {wantS3Entry (`{"msg":"hello"}` , "s3" , "myapp" , model.Tags {"env:prod" , "service:myapp" })},
94+ want : []model.LogEntry {wantS3Entry (`{"msg":"hello"}` , "s3" , "myapp" , model.Tags {"env:prod" })},
9595 },
9696 "invalid utf8 stripped" : {
9797 mockSetup : func (m * MockS3APIClient ) {
@@ -102,7 +102,7 @@ func TestProcessS3Record(t *testing.T) {
102102 },
103103 cfg : testutil .EmptyConfig (),
104104 chanSize : 1 ,
105- want : []model.LogEntry {wantS3Entry ("helloworld" , "s3" , "s3" , model. Tags { "service:s3" } )},
105+ want : []model.LogEntry {wantS3Entry ("helloworld" , "s3" , "s3" , nil )},
106106 },
107107 "multiline groups continuation lines" : {
108108 mockSetup : func (m * MockS3APIClient ) {
@@ -114,8 +114,8 @@ func TestProcessS3Record(t *testing.T) {
114114 cfg : & config.Config {S3MultilineLogRegex : regexp .MustCompile (`\d{4}-\d{2}-\d{2}` )},
115115 chanSize : 2 ,
116116 want : []model.LogEntry {
117- wantS3Entry ("2024-01-15 ERROR NullPointer\n at com.foo.Bar\n " , "s3" , "s3" , model. Tags { "service:s3" } ),
118- wantS3Entry ("2024-01-15 INFO started" , "s3" , "s3" , model. Tags { "service:s3" } ),
117+ wantS3Entry ("2024-01-15 ERROR NullPointer\n at com.foo.Bar\n " , "s3" , "s3" , nil ),
118+ wantS3Entry ("2024-01-15 INFO started" , "s3" , "s3" , nil ),
119119 },
120120 },
121121 "multiline flushes at eof" : {
@@ -127,7 +127,7 @@ func TestProcessS3Record(t *testing.T) {
127127 },
128128 cfg : & config.Config {S3MultilineLogRegex : regexp .MustCompile (`\d{4}-\d{2}-\d{2}` )},
129129 chanSize : 1 ,
130- want : []model.LogEntry {wantS3Entry ("2024-01-15 ERROR\n stacktrace" , "s3" , "s3" , model. Tags { "service:s3" } )},
130+ want : []model.LogEntry {wantS3Entry ("2024-01-15 ERROR\n stacktrace" , "s3" , "s3" , nil )},
131131 },
132132 "custom tags passed through" : {
133133 mockSetup : func (m * MockS3APIClient ) {
@@ -138,7 +138,7 @@ func TestProcessS3Record(t *testing.T) {
138138 },
139139 cfg : & config.Config {Tags : model.Tags {"env:prod" , "team:aws" }},
140140 chanSize : 1 ,
141- want : []model.LogEntry {wantS3Entry ("line1" , "s3" , "s3" , model.Tags {"service:s3" , " env:prod" , "team:aws" })},
141+ want : []model.LogEntry {wantS3Entry ("line1" , "s3" , "s3" , model.Tags {"env:prod" , "team:aws" })},
142142 },
143143 }
144144
0 commit comments