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

restructure error_check into no_error_found and error_found #57

Closed
gouyang opened this issue Apr 11, 2014 · 2 comments
Closed

restructure error_check into no_error_found and error_found #57

gouyang opened this issue Apr 11, 2014 · 2 comments

Comments

@gouyang
Copy link
Contributor

gouyang commented Apr 11, 2014

There are several negative testings which are expected to fail, which looks so bad in the test report, it would be better to turn them into GOOD result.

suggest to split error_check into no_error_found and error_found:
for normal testing, skip the error_found method, maybe add it into default config file is a good idea.
for negative testing, skip the no_error_found method when call OutputGood.

@staticmethod
def no_error_found(output):
    """
    Return False if Go panic string found in output

    :param output: Stripped output string
    :return: True if Go panic pattern **not** found
    """
    regex = re.compile(r'\s*panic:\s*.+error.*')
    for line in output.splitlines():
        if bool(regex.search(line.strip())):
            return False  # panic message found
    return True  # panic message not found

@staticmethod
def error_found(output):
    """
    Return True if Go panic string found in output

    :param output: Stripped output string
    :return: False if Go panic pattern **not** found
    """
    regex = re.compile(r'\s*panic:\s*.+error.*')
    for line in output.splitlines():
        if bool(regex.search(line.strip())):
            return True  # panic message found
    return False  # panic message not found
@gouyang
Copy link
Contributor Author

gouyang commented Apr 11, 2014

apply to crash_check as well

@gouyang
Copy link
Contributor Author

gouyang commented Apr 18, 2014

withdraw this at the moment

@gouyang gouyang closed this as completed Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant