[GitHub] willholley closed pull request #899: Mango test configuration

2017-10-18 Thread git
willholley closed pull request #899: Mango test configuration
URL: https://github.com/apache/couchdb/pull/899
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/mango/test/README.md b/src/mango/test/README.md
index 3aace39b09..a7f6350b0a 100644
--- a/src/mango/test/README.md
+++ b/src/mango/test/README.md
@@ -14,4 +14,16 @@ To run an individual test suite:
 nosetests --nocapture test/12-use-correct-index.py 
 
 To run the tests with text index support:
-MANGO_TEXT_INDEXES=1 nosetests --nocapture test
\ No newline at end of file
+MANGO_TEXT_INDEXES=1 nosetests --nocapture test
+
+
+Test configuration
+==
+
+The following environment variables can be used to configure the test fixtures:
+
+COUCH_HOST - root url (including port) of the CouchDB instance to run the 
tests against. Default is "http://127.0.0.1:15984;.
+COUCH_USER - CouchDB username (with admin premissions). Default is "testuser"
+COUCH_PASSWORD -  CouchDB password. Default is "testpass"
+COUCH_AUTH_HEADER - Optional Authorization header value. If specified, this is 
used instead of basic authentication with the username/password variables above.
+MANGO_TEXT_INDEXES - Set to "1" to run the tests only applicable to text 
indexes
diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index 576cec6ebc..ed4cafbe5f 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -29,26 +29,44 @@ def random_db_name():
 def has_text_service():
 return os.environ.get('MANGO_TEXT_INDEXES') == '1'
 
+def get_from_environment(key, default):
+value = os.environ.get(key)
+return value if value is not None else default
+
 
 class Database(object):
-def __init__(self, host, port, dbname, auth=None):
-self.host = host
-self.port = port
+def __init__(self, dbname,
+ host="127.0.0.1", port="15984",
+ user='testuser', password='testpass'):
+root_url = get_from_environment('COUCH_HOST', 
"http://{}:{}".format(host, port))
+auth_header = get_from_environment('COUCH_AUTH_HEADER', None)
+user = get_from_environment('COUCH_USER', user)
+password = get_from_environment('COUCH_PASSWORD', password)
+
+self.root_url = root_url
 self.dbname = dbname
 self.sess = requests.session()
-self.sess.auth = ('testuser', 'testpass')
+
+# allow explicit auth header to be set to enable testing
+# against deployments where basic auth isn't available
+if auth_header is not None:
+self.sess.headers["Authorization"] = auth_header
+else:
+self.sess.auth = (user, password)
+
 self.sess.headers["Content-Type"] = "application/json"
 
+
 @property
 def url(self):
-return "http://{}:{}/{}".format(self.host, self.port, self.dbname)
+return "{}/{}".format(self.root_url, self.dbname)
 
 def path(self, parts):
 if isinstance(parts, ("".__class__, u"".__class__)):
 parts = [parts]
 return "/".join([self.url] + parts)
 
-def create(self, q=1, n=3):
+def create(self, q=1, n=1):
 r = self.sess.get(self.url)
 if r.status_code == 404:
 r = self.sess.put(self.url, params={"q":q, "n": n})
@@ -206,7 +224,7 @@ class UsersDbTests(unittest.TestCase):
 
 @classmethod
 def setUpClass(klass):
-klass.db = Database("127.0.0.1", "15984", "_users")
+klass.db = Database("_users")
 user_docs.setup_users(klass.db)
 
 def setUp(self):
@@ -217,7 +235,7 @@ class DbPerClass(unittest.TestCase):
 
 @classmethod
 def setUpClass(klass):
-klass.db = Database("127.0.0.1", "15984", random_db_name())
+klass.db = Database(random_db_name())
 klass.db.create(q=1, n=3)
 
 def setUp(self):


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[Jenkins] SUCCESS: CouchDB ยป master #114

2017-10-18 Thread Apache Jenkins Server
Yay, we passed. https://builds.apache.org/job/CouchDB/job/master/114/

[GitHub] pierrekilly commented on issue #749: couch_peruser is broken in 2.1.0

2017-10-18 Thread GitBox
pierrekilly commented on issue #749: couch_peruser is broken in 2.1.0
URL: https://github.com/apache/couchdb/issues/749#issuecomment-337585148
 
 
   I have found a workaround:
   
   As setting the `couch_peruser` to `true` from Fauxton works well, I simply 
activate it "by hand" after the DB is started.
   
   In the script that starts the DB, I wait 10 seconds (to leave some time to 
the DB to start) and then:
   ```
   curl \
   -X PUT \
   --user "${adminUser}:${adminPass}" \
   --data '"true"' \
   "http://localhost:5984/_node/nonode@nohost/_config/couch_peruser/enable;
   ```
   (The admin username and password are taken from env variables in my case)
   
   Hope this helps!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dwbentley opened a new issue #901: HTTP access cannot be disabled Couch 2.1.0

2017-10-18 Thread GitBox
dwbentley opened a new issue #901: HTTP access cannot be disabled Couch 2.1.0 
URL: https://github.com/apache/couchdb/issues/901
 
 
   
   
   ## Expected Behavior
   Commenting the following from the default.ini
   `[daemons]`
   `httpd={couch_httpd, start_link, []}`
Disables HTTP access
   
   ## Current Behavior
   Commenting that line has no effect on HTTP access
   
   ## Possible Solution
   
   
   
   ## Steps to Reproduce (for bugs)
   
   
   1. Start CouchDB
   2. Use command line tool (Curl this instance): curl "http://localhost:5984;
   3. Receive the CouchDB welcome return
   4. Stop CouchDB
   5. Comment out above line within defaul.ini
   6. Start CouchDB
   7. Use command line tool (Curl this instance): curl "http://localhost:5984;
   8. Receive CouchDB welcome return
   
   This should have returned host unreachable.
   
   ## Context
   
   
   Running CouchDB in an environment with a requirement to ONLY use HTTPS for 
web based API puts us in a delinquent state in regards to environment network 
security.
   
   ## Your Environment
   
   * Version used: 2.0.1
   * Browser Name and version: Chrome and Edge
   * Operating System and version (desktop or mobile): Windows 10
   * Link to your project:
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #749: couch_peruser is broken in 2.1.0

2017-10-18 Thread GitBox
wohali commented on issue #749: couch_peruser is broken in 2.1.0
URL: https://github.com/apache/couchdb/issues/749#issuecomment-337619907
 
 
   There's a lot more wrong with couch_peruser in 2.1.0 - I strongly recommend 
you wait for our imminent 2.1.1 release before using this feature.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali opened a new pull request #902: Update 2.1.x with all changes on master to date

2017-10-18 Thread GitBox
wohali opened a new pull request #902: Update 2.1.x with all changes on master 
to date
URL: https://github.com/apache/couchdb/pull/902
 
 
   As nothing appears to have landed on master that could break 2.1.0, I 
propose doing a straightforward rebase of 2.1.x with the contents of master. 
This is 120 commits on this repo.
   
   Please review this PR and give your +1/0/-1. I will not "click the big green 
button" on GH to make this merge, but instead will do either a `git rebase` or 
a `git merge --no-ff` from the CLI and close this out by hand. (If you have a 
strong preference for either approach, let me know.)
   
   If this lands, I will request a release/tag of Fauxton, docs, and any other 
dependencies that have updated in the interim.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dwbentley commented on issue #901: HTTP access cannot be disabled Couch 2.1.0

2017-10-18 Thread GitBox
dwbentley commented on issue #901: HTTP access cannot be disabled Couch 2.1.0 
URL: https://github.com/apache/couchdb/issues/901#issuecomment-337749971
 
 
   Tomorrow I will install 2.0 and follow up with the results.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali opened a new pull request #177: Add 2.1.1 release notes

2017-10-18 Thread GitBox
wohali opened a new pull request #177: Add 2.1.1 release notes
URL: https://github.com/apache/couchdb-documentation/pull/177
 
 
   Also moved the upgrade notes to the start to be more consistent with 
previous release note formatting.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali opened a new issue #903: Aggregate stats for all nodes

2017-10-18 Thread GitBox
wohali opened a new issue #903: Aggregate stats for all nodes
URL: https://github.com/apache/couchdb/issues/903
 
 
   Continuing from #810:
   
   > Replications will uniformly pick one node in the cluster to run on which 
doesn't have to be the node which processed the document update request. To 
detect the crashed stats update would have to know which node to check for 
changes. I made this mistake so mentioning it here just in case. Perhaps there 
is a case there in general for aggregating stats for all nodes.
   
   /cc @nickva 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva commented on issue #902: Update 2.1.x with all changes on master to date

2017-10-18 Thread GitBox
nickva commented on issue #902: Update 2.1.x with all changes on master to date
URL: https://github.com/apache/couchdb/pull/902#issuecomment-337745379
 
 
   +1
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services