Merge branch 'ci/wildcard_known_failure_cases' into 'master'

ci: allow wildcard in known failure cases

Closes IDFCI-529

See merge request espressif/esp-idf!12929
This commit is contained in:
Fu Hanxi 2021-04-02 04:11:54 +00:00
commit 2563c85b49

View File

@ -25,6 +25,7 @@ import argparse
import os import os
import sys import sys
import threading import threading
from fnmatch import fnmatch
from tiny_test_fw.TinyFW import JunitReport, set_default_config from tiny_test_fw.TinyFW import JunitReport, set_default_config
from tiny_test_fw.Utility import CaseConfig, SearchCases, console_log from tiny_test_fw.Utility import CaseConfig, SearchCases, console_log
@ -69,12 +70,21 @@ class Runner(threading.Thread):
for case in self.test_cases: for case in self.test_cases:
case.run() case.run()
@staticmethod
def is_known_issue(tc_name, known_cases):
for case in known_cases:
if tc_name == case:
return True
if fnmatch(tc_name, case):
return True
return False
def get_test_result(self): def get_test_result(self):
_res = True _res = True
console_log('Test Results:') console_log('Test Results:')
for tc in JunitReport.JUNIT_TEST_SUITE.test_cases: for tc in JunitReport.JUNIT_TEST_SUITE.test_cases:
if tc.failures: if tc.failures:
if tc.name in self.known_failure_cases: if self.is_known_issue(tc.name, self.known_failure_cases):
console_log(' Known Failure: ' + tc.name, color='orange') console_log(' Known Failure: ' + tc.name, color='orange')
else: else:
console_log(' Test Fail: ' + tc.name, color='red') console_log(' Test Fail: ' + tc.name, color='red')