Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanitycheck: parse testcase names correctly #21191

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

nashif
Copy link
Member

@nashif nashif commented Dec 4, 2019

We were parsing random FAIL messages from the output of test runs ad
testcases and capturing them in the xml output. Now we only parse the
name if it starts with test_.

Fixes #21162

@nashif nashif changed the title sanitycheck: parse testcases correctly sanitycheck: parse testcase names correctly Dec 4, 2019
We were parsing random FAIL messages from the output of test runs ad
testcases and capturing them in the xml output. Now we only parse the
name if it starts with test_.

Fixes zephyrproject-rtos#21162

Signed-off-by: Anas Nashif <[email protected]>
@@ -126,7 +126,7 @@ class Test(Harness):

def handle(self, line):
match = result_re.match(line)
if match:
if match and match.group(2):
Copy link
Collaborator

@maksimmasalski maksimmasalski Dec 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nashif First, I thought that it can help. But then I decided to check our regular expression. Now I don't think that change can help get rid of the incorrect results. Incorrect text comes from the group(3)
With that fix we check according to the full match and match(2). Even if the line has an additional unnecessary text inside -regular expression will be matched. Please check my idea on that webpage https://regex101.com/ You can insert there our regular expression (PASS|FAIL|SKIP) - (test_)?(.*) with test string for example FAIL - test_kernel_3 garbage here
You can see that group 1 is FAIL, group 2 is test_, group 3 is kernel_3 garbage here.
I think necessary to add a check if group(3) has a space symbols inside that part of the string. If no spaces, that part is a part of the test case name. If space(s) detected, something went wrong, maybe additional incorrect text inside that part of string. I think, necessary to edit regular expression. I will continue to think about it.

@nashif nashif merged commit a4dd49b into zephyrproject-rtos:master Dec 9, 2019
@nashif nashif deleted the sanity_parse_cases branch December 9, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sanitycheck Sanitycheck has been renamed to Twister
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sanitycheck corrupted test case names in test-report.xml files
4 participants