-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dist/tools/compile_test: Add Python3 support #5865
Conversation
results_with_output = filter(lambda (outcome, board, output): output.getvalue(), results_with_output) | ||
failed_with_output = filter(lambda (outcome, board, output): 'failed' in outcome, results_with_output) | ||
success_with_output = filter(lambda (outcome, board, output): 'success' in outcome, results_with_output) | ||
results = groupby(sorted(results), lambda res: res[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a bit ugly and makes it less readable, but it was the only way I could get it to work in both Python 2.7 and Python 3.x without resorting to writing two separate if
branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not less readable as before IMHO ^^.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with the changes. ACK.
results_with_output = filter(lambda (outcome, board, output): output.getvalue(), results_with_output) | ||
failed_with_output = filter(lambda (outcome, board, output): 'failed' in outcome, results_with_output) | ||
success_with_output = filter(lambda (outcome, board, output): 'success' in outcome, results_with_output) | ||
results = groupby(sorted(results), lambda res: res[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not less readable as before IMHO ^^.
Can you squash, please? |
a21e3c6
to
64e1f23
Compare
results = groupby(sorted(results), lambda res: res[0]) | ||
results_with_output = list(filter(lambda res: res[2].getvalue(), results_with_output)) | ||
failed_with_output = list(filter(lambda res: 'failed' in res[0], results_with_output)) | ||
success_with_output = list(filter(lambda res: 'success' in res[0], results_with_output)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an error with Python3 when counting the number or errors and warnings. Fixed by explicitly constructing a list from the iterator produced by the filter function. (Python2 filter produces a list directly)
Fixed a mistake when using Python3 and printing the errors, immediately squashed. (Added the list constructor on the three |
Somehow Murdock does not want to start building. @kaspar030 any idea? |
There's a concurrency bug in murdock which makes it get stuck sometimes. Happened two or three times in the last six months, and I don't have an easy way to trigger it. I've now added a little more conservative locking and hope it will help. |
Something went wrong. Murdock reports fails where there are none :-/ |
oops, Python exception in unittests. I'll investigate later |
@gebart ping? |
Postponed due to feature freeze |
64e1f23
to
ed0db85
Compare
I am trying to debug the Python unicode exceptions via Murdock because I haven't been able to reproduce them locally. |
Somehow the buildgroups get stuck. ps output looks like this:
|
ed0db85
to
f5ecc88
Compare
f5ecc88
to
38ae9c3
Compare
Tested with Python 2.7.12 and Python 3.4.5
a544760
to
06092aa
Compare
@kaspar030 the exception came from ISO8859-1 encoded ó in the output from some pkg/relic code preparation, unsure whether the hung task was also related to that. The exception went away when I added errors='replace' on the decode line, which will replace any non-UTF8 letters by a special character (0xfffd) instead of raising an exception. Updated commit by adding errors='replace', immediately squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. ACK if Murdock agrees!
Tested working in Python 2.7.12 and Python 3.4.5
Python 3 is becoming more widely supported by distributions, so it is wise to stay up to date with our scripts so that they continue to run in the future.