File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,20 @@ func TestCheckLogFilesForLevels(t *testing.T) {
1111 name string
1212 dir string
1313 content string
14+ ignoreFlag bool
1415 expectError bool
1516 }{
1617 {
1718 name : "Clean" ,
1819 dir : "clean" ,
1920 expectError : false ,
2021 },
22+ {
23+ name : "Ignore all" ,
24+ dir : "crit" ,
25+ ignoreFlag : true ,
26+ expectError : false ,
27+ },
2128 {
2229 name : "Contains CRIT" ,
2330 dir : "crit" ,
@@ -37,6 +44,9 @@ func TestCheckLogFilesForLevels(t *testing.T) {
3744
3845 for _ , tt := range tests {
3946 t .Run (tt .name , func (t * testing.T ) {
47+ if tt .ignoreFlag {
48+ t .Setenv ("CTF_IGNORE_CRITICAL_LOGS" , "true" )
49+ }
4050 err := checkNodeLogErrors (filepath .Join ("testdata" , tt .dir ))
4151 if tt .expectError && err == nil {
4252 t .Errorf ("expected error but got none" )
You can’t perform that action at this time.
0 commit comments