Skip to content

Commit d8cb908

Browse files
committed
add another log test case
1 parent 96056f0 commit d8cb908

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

framework/logs_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)