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

Add check_log_for_errors to detect and handle multiple errors #3118

Merged
merged 7 commits into from
Jan 14, 2020

Conversation

Flamefire
Copy link
Contributor

In preparation for easybuilders/easybuild-easyblocks#157 I created this PoC.

The specification is (as documented):

    Check logTxt for messages matching regExps in order and do appropriate action
    :param logTxt: String containing the log, will be split into individual lines
    :param regExps: List of: regular expressions (as RE or string) to error on,
                    or tuple of regular expression and action (any of [IGNORE, WARN, ERROR])

In the end you'll get (if appropriate) a logged warning and an exception about the found issues.

I guess this function could even be split: 1 that returns the (warnings, errors) tuple and one that also increases errors_found_in_log, logs the warning and raises the exception (which would be the most common usage), but the name parse_log_for_error is already taken. Maybe name it parse_log_for_errors? The "old" parse_log_for_error can be implemented in terms of that but in can probably be simply deprecated. It is strange, does to much and yet almost nothing. Similar for parse_cmd_output. So for backwards compatibility I'd rather have EasyBlocks call check_log_for_errors directly and pass None as the regExp to run_cmd*

test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
test/framework/run.py Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
test/framework/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
easybuild/tools/run.py Outdated Show resolved Hide resolved
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

@Flamefire I squeezed in some minor fixes via 0859617, with that in place this is good to go in imho.

I'll go ahead and merge this to be included in the upcoming EasyBuild v4.1.1...

@boegel boegel merged commit 5a0cf13 into easybuilders:develop Jan 14, 2020
@Flamefire Flamefire deleted the build_errors branch January 15, 2020 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants