-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix Slack bot not displaying error messages #1068
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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 think there is a logical error in how empty files are counted.
Also, I wonder what happens if there are several log files (can that happen?). In that case, empty_file
will be determined by the last log file that is opened. What is the logical thing to do: Post a failure if any log file is empty, or only if all log files are empty?
@@ -26,8 +26,7 @@ | |||
total_num_failed += 1 | |||
else: | |||
passed.append([test, duration, log.name.split('_')[0]]) | |||
if nb_lines == 0: | |||
empty_file = True | |||
empty_file = i == 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.
Hmm, when there is exactly one line,i
would also be 0. How about inside of the loop, doing i += 1
instead of using enumerate?
I changed a bit the logic now, please let me know WDYT! |
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.
Should be more robust now, thanks for fixing.
What does this PR do?
As per title, the line
nb_lines = sum(1 for _ in f)
will loop over all the lines in the file and leading the next for loop to be emptycc @BenjaminBossan