Enable OS process IO logging + upload for Travis and Jenkins tests#598
Merged
nickva merged 1 commit intoJun 14, 2017
Merged
Conversation
wohali
requested changes
Jun 14, 2017
| cwd=$(pwd) | ||
| rm -rf /tmp/couchjslogs | ||
| mkdir -p /tmp/couchjslogs | ||
| export COUCHDB_IO_LOG_DIR=/tmp/couchjslogs |
Member
There was a problem hiding this comment.
You want this envvar in the environment {} block at the top of the file so you don't have to repeat yourself 10 times.
Contributor
Author
There was a problem hiding this comment.
I had it there at first but noticed the tests were run in a withDockerContainer clause and wasn't sure environment vars would propagate into that environment
| for log in glob.glob('dev/logs/node1.log'): | ||
| tb.add(log) | ||
| # couchjs OS process IO logs | ||
| if os.path.isdir(OSPROC_IO_LOG_DIR): |
Member
There was a problem hiding this comment.
No need for this check, if the directory doesn't exist, glob.glob will return []:
$ ls -la /tmp/abc/def
ls: cannot access /tmp/abc/def: No such file or directory
$ python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import glob
>>> glob.glob("/tmp/abc/def/*")
[]| # Then comment this section out | ||
| before_script: | ||
| - rm -rf /tmp/couchjslogs | ||
| - mkdir -p /tmp/couchjslogs |
Member
There was a problem hiding this comment.
Generally, I prefer mktemp for this, but given how annoying that will be to setup and pass as an env var in Jenkins, this approach is fine.
Member
|
+1 with the changes mentioned. |
068c7b1 to
f8d44b8
Compare
f8d44b8 to
f74c0b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enabled OS process IO logging by setting
COUCHDB_IO_LOG_DIR=/tmp/couchjslogsBoth Travis and Jenkins then clear and create that directory before tests run.
Also
logfile-uploader.pywas the modified to upload any log files from that directory.Issue #551