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 auto log uploader for CI workflow #514

Merged
merged 1 commit into from
May 15, 2017
Merged

Conversation

wohali
Copy link
Member

@wohali wohali commented May 11, 2017

Overview

This commit is intended to improve failure analysis in Travis and
Jenkins runs by uploading couch log files after failed test runs.

A new script has been added that, upon invocation from the top-level
directory, tars up all EUnit logfiles and the dev/logs/node1.log file.
It then constructs a document based on the running environment (Travis,
Jenkins, manual). The document is posted to a CouchDB instance running
on couchdb-vm.apache.org with credentials passed in the COUCHAUTH
environment variable.

The .travis.yml file has been updated to install the script's
prerequisites (python-requests) and with the secret credentials, and to
instruct travis to run the log uploader after any test failure. Similar
steps will be taken to reconfigure Jenkins after these changes are
merged to master.

The test/javascript/run harness had to be modified to terminate after
the first failure. This is because each new test wipes the logfile of
the previous run. All tests can still be run, regardless of failure, by
specifing the -a/--all flag, however it is expected that the reduction
in test suite execution time when a test fails will be appreciated by
many.

Testing recommendations

In the process of preparing this branch, Travis has already run multiple
times. I used a now-reverted checkin on the branch that forced a test
to fail to validate that the script worked correctly. One such build is:

https://travis-ci.org/apache/couchdb/builds/230990140

Interestingly, one of the jobs in that run actually encountered a new
test case failure:

https://travis-ci.org/apache/couchdb/jobs/230990141

Note that the URL of the uploaded tarball is displayed at the end
of the logfile (behind the after_failure twisty.)

For the duration of this PR, you can access the uploaded logs with
the username/password combination guest:guest. After merging,
CouchDB devs will be given access individually as desired and the
guest login will be disabled.

JIRA issue number

Take your pick of any JIRA ticket on which there is a currently failing test that we can't diagnose because the couch logfiles are missing.

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
  • I will not forget to update rebar.config.script
    with the correct commit hash once this PR get merged.

@wohali
Copy link
Member Author

wohali commented May 11, 2017

URL of the interesting failure document: http:https://couchdb-vm.apache.org:5984/ci_errorlogs/travis-couchdb-230990141-2017-05-11T01%3A02%3A46.653747

Check out the couchlog.tar.gz attachment.

@wohali wohali requested a review from janl May 11, 2017 01:42
@wohali wohali added the build label May 11, 2017
@wohali
Copy link
Member Author

wohali commented May 11, 2017

Ironically, another test failed in the PR itself (couch compress failure):

http:https://couchdb-vm.apache.org:5984/ci_errorlogs/travis-couchdb-230996527-2017-05-11T01%3A39%3A36.199020/couchlog.tar.gz


import requests

COUCH_URL = "http:https://couchdb-vm.apache.org:5984/ci_errorlogs"
Copy link
Member

Choose a reason for hiding this comment

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

Can we https this?

Copy link
Member

@janl janl left a comment

Choose a reason for hiding this comment

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

This is very cool, +1

@davisp
Copy link
Member

davisp commented May 11, 2017

+1 to the PR and to the HTTPSification if possible.

This commit is intended to improve failure analysis in Travis and
Jenkins runs by uploading couch log files after failed test runs.

A new script has been added that, upon invocation from the top-level
directory, tars up all EUnit logfiles and the dev/logs/node1.log file.
It then constructs a document based on the running environment (Travis,
Jenkins, manual). The document is posted to a CouchDB instance running
on couchdb-vm.apache.org with credentials passed in the COUCHAUTH
environment variable.

The .travis.yml file has been updated to install the script's
prerequisites (python-requests) and with the secret credentials, and to
instruct travis to run the log uploader after any test failure. Similar
steps will be taken to reconfigure Jenkins after these changes are
merged to master.

The test/javascript/run harness had to be modified to terminate after
the first failure. This is because each new test wipes the logfile of
the previous run. All tests can still be run, regardless of failure, by
specifing the -a/--all flag, however it is expected that the reduction
in test suite execution time when a test fails will be appreciated by
many.
@wohali wohali merged commit d583a46 into master May 15, 2017
@wohali wohali deleted the upload-failed-logfiles branch May 15, 2017 21:40
nickva pushed a commit to nickva/couchdb that referenced this pull request Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants