TravisCI: Count Errors and Warnings. #296

Merged
merged 7 commits into from Apr 26, 2016

Conversation

Projects
None yet
4 participants
@tammoippen
Contributor

tammoippen commented Apr 7, 2016

This PR extends the parsing of TravisCI compiler output for number of warnings and errors.

extras/parse_travis_log.py
+ if line.strip() == '+make install':
+ return warn, error, line
+
+ # /home/travis/build/tammoippen/nest-simulator/build/libnestutil/config.h:65:0: warning: "HAVE_DIRENT_H" redefined [enabled by default]

This comment has been minimized.

@heplesser

heplesser Apr 11, 2016

Contributor

Should this comment be removed?

@heplesser

heplesser Apr 11, 2016

Contributor

Should this comment be removed?

This comment has been minimized.

@tammoippen

tammoippen Apr 13, 2016

Contributor

Also in the other parse functions, I have the line I want match included as a comment. For consistency, I should remove them there as well.

@tammoippen

tammoippen Apr 13, 2016

Contributor

Also in the other parse functions, I have the line I want match included as a comment. For consistency, I should remove them there as well.

This comment has been minimized.

@jougs

jougs Apr 25, 2016

Contributor

Please remove them (or at least make it explicit that they are the expected output). Thanks!

@jougs

jougs Apr 25, 2016

Contributor

Please remove them (or at least make it explicit that they are the expected output). Thanks!

extras/parse_travis_log.py
+ warn[file] = 0
+ warn[file] += 1
+
+ if ': error:' in line:

This comment has been minimized.

@heplesser

heplesser Apr 11, 2016

Contributor

I am not really fond of a string constant here, as compilers may change. But gcc 4 and 5, clang, Intel and Portland Group compilers all include this string in their error messages, so I guess it is a rather safe bet. xlC will not work, but I think that is not a problem for checking on Travis.

@heplesser

heplesser Apr 11, 2016

Contributor

I am not really fond of a string constant here, as compilers may change. But gcc 4 and 5, clang, Intel and Portland Group compilers all include this string in their error messages, so I guess it is a rather safe bet. xlC will not work, but I think that is not a problem for checking on Travis.

This comment has been minimized.

@tammoippen

tammoippen Apr 13, 2016

Contributor

I know what you mean, but as the purpose of this script is to parse TravisCI output, i think it is ok to assume gcc 4 and 5.

@tammoippen

tammoippen Apr 13, 2016

Contributor

I know what you mean, but as the purpose of this script is to parse TravisCI output, i think it is ok to assume gcc 4 and 5.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Apr 11, 2016

Contributor

@tammoippen Looks mostly fine, but I have two issues.

First, CMake hides warnings from us, except those that come from the pynest build process. I think we need to use make VERBOSE=1 to see the warnings.

Second, towards the end of the build log, I see

Built target installcheck
+[  !=  ]
+[ 296 != false ]
+echo WARNING: Not uploading results as this is a pull request
WARNING: Not uploading results as this is a pull request
+exit 0

What are the two lines with the square brackets and inequality doing there?

Contributor

heplesser commented Apr 11, 2016

@tammoippen Looks mostly fine, but I have two issues.

First, CMake hides warnings from us, except those that come from the pynest build process. I think we need to use make VERBOSE=1 to see the warnings.

Second, towards the end of the build log, I see

Built target installcheck
+[  !=  ]
+[ 296 != false ]
+echo WARNING: Not uploading results as this is a pull request
WARNING: Not uploading results as this is a pull request
+exit 0

What are the two lines with the square brackets and inequality doing there?

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Apr 11, 2016

Contributor

@heplesser The two lines are generated by build.sh.

Contributor

tammoippen commented Apr 11, 2016

@heplesser The two lines are generated by build.sh.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Apr 13, 2016

Contributor

I put this PR on a hold, as the warnings are not parsed... I have to investigate.

Edit: Found the problem. ac5a7ed should parse the output again.

Contributor

tammoippen commented Apr 13, 2016

I put this PR on a hold, as the warnings are not parsed... I have to investigate.

Edit: Found the problem. ac5a7ed should parse the output again.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Apr 18, 2016

Contributor

@heplesser Can you please have another look?

Contributor

tammoippen commented Apr 18, 2016

@heplesser Can you please have another look?

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Apr 18, 2016

Contributor

👍

Contributor

heplesser commented Apr 18, 2016

👍

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen Apr 20, 2016

Contributor

@jougs Can you please look into this PR? Thank you.

Contributor

tammoippen commented Apr 20, 2016

@jougs Can you please look into this PR? Thank you.

extras/parse_travis_log.py
+
+ # /home/travis/build/tammoippen/nest-simulator/build/libnestutil/config.h:65:0: warning: "HAVE_DIRENT_H" redefined [enabled by default]
+ if ': warning:' in line:
+ file = line.split(':')[0]

This comment has been minimized.

@jakobj

jakobj Apr 25, 2016

Contributor

i'm fairly unhappy about the choice of using file as a variable name here, as this is also a Python object. I would use file_name instead.

@jakobj

jakobj Apr 25, 2016

Contributor

i'm fairly unhappy about the choice of using file as a variable name here, as this is also a Python object. I would use file_name instead.

extras/parse_travis_log.py
print("Make install: " + ("Ok" if make_install_ok else "Error"))
print("Make installcheck: " + ("Ok (" if make_installcheck_failed == 0 else "Error (") +
str(make_installcheck_failed) + " / " + str(make_installcheck_all) + ")")
print("Logs uploaded to S3: " + ("Yes" if uploading_results else "No"))
print("\nStatic analysis:" )
print_static_analysis(static_analysis)
+
+ print("\n\nWarnings:")
+ for k,v in actual_warnings.iteritems():

This comment has been minimized.

@jougs

jougs Apr 25, 2016

Contributor

There's a space missing between "k," and "v" for PEP-8 compliance.

@jougs

jougs Apr 25, 2016

Contributor

There's a space missing between "k," and "v" for PEP-8 compliance.

@jougs

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Apr 25, 2016

Contributor

Nice work. 👍 after my comment is addressed

Contributor

jougs commented Apr 25, 2016

Nice work. 👍 after my comment is addressed

@jougs jougs merged commit 07caea3 into nest:master Apr 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tammoippen tammoippen deleted the tammoippen:count_warnings branch May 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment