more couchdb_password

This commit is contained in:
binux 2020-07-26 19:35:59 -07:00
parent 9d17460ff5
commit 9bae58797e
3 changed files with 6 additions and 50 deletions

View File

@ -13,26 +13,15 @@ services:
networks:
- pyspider
command: rabbitmq-server
couchdb:
image: couchdb:latest
container_name: couchdb
mysql:
image: mysql:latest
container_name: mysql
volumes:
- /tmp:/var/lib/mysql
environment:
- COUCHDB_USER=user
- COUCHDB_PASSWORD=password
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
networks:
- pyspider
ports:
- "5984:5984"
# OR we can replace couchdb with mysql
#mysql:
# image: mysql:latest
# container_name: mysql
# volumes:
# - /tmp:/var/lib/mysql
# environment:
# - MYSQL_ALLOW_EMPTY_PASSWORD=yes
# networks:
# - pyspider
phantomjs:
image: pyspider:latest
container_name: phantomjs

View File

@ -697,11 +697,6 @@ class TestCouchDBProjectDB(ProjectDBCase, unittest.TestCase):
@classmethod
def setUpClass(self):
# create a test admin user
import requests
requests.put('http://localhost:5984/_node/_local/_config/admins/test',
data='"password"')
os.environ["COUCHDB_USER"] = "test"
os.environ["COUCHDB_PASSWORD"] = "password"
self.projectdb = database.connect_database(
'couchdb+projectdb://localhost:5984/'
)
@ -710,12 +705,6 @@ class TestCouchDBProjectDB(ProjectDBCase, unittest.TestCase):
@classmethod
def tearDownClass(self):
# remove the test admin user
import requests
from requests.auth import HTTPBasicAuth
requests.delete('http://localhost:5984/_node/_local/_config/admins/test',
auth=HTTPBasicAuth('test', 'password'))
del os.environ["COUCHDB_USER"]
del os.environ["COUCHDB_PASSWORD"]
self.projectdb.drop_database()
@ -725,11 +714,6 @@ class TestCouchDBResultDB(ResultDBCase, unittest.TestCase):
@classmethod
def setUpClass(self):
# create a test admin user
import requests
requests.put('http://localhost:5984/_node/_local/_config/admins/test',
data='"password"')
os.environ["COUCHDB_USER"] = "test"
os.environ["COUCHDB_PASSWORD"] = "password"
self.resultdb = database.connect_database(
'couchdb+resultdb://localhost:5984/'
)
@ -738,12 +722,6 @@ class TestCouchDBResultDB(ResultDBCase, unittest.TestCase):
@classmethod
def tearDownClass(self):
# remove the test admin user
import requests
from requests.auth import HTTPBasicAuth
requests.delete('http://localhost:5984/_node/_local/_config/admins/test',
auth=HTTPBasicAuth('test', 'password'))
del os.environ["COUCHDB_USER"]
del os.environ["COUCHDB_PASSWORD"]
self.resultdb.drop_database()
def test_create_project(self):

View File

@ -156,14 +156,9 @@ class TestRun(unittest.TestCase):
def test_60a_docker_couchdb(self):
try:
# create a test admin user
import requests
requests.put('http://localhost:5984/_node/_local/_config/admins/test',
data='"password"')
os.environ['COUCHDB_NAME'] = 'couchdb'
os.environ['COUCHDB_PORT_5984_TCP_ADDR'] = 'localhost'
os.environ['COUCHDB_PORT_5984_TCP_PORT'] = '5984'
os.environ["COUCHDB_USER"] = "test"
os.environ["COUCHDB_PASSWORD"] = "password"
ctx = run.cli.make_context('test', [], None,
obj=dict(testing_mode=True))
ctx = run.cli.invoke(ctx)
@ -172,15 +167,9 @@ class TestRun(unittest.TestCase):
self.assertIsNone(e)
finally:
# remove the test admin user
import requests
from requests.auth import HTTPBasicAuth
requests.delete('http://localhost:5984/_node/_local/_config/admins/test',
auth=HTTPBasicAuth('test', 'password'))
del os.environ['COUCHDB_NAME']
del os.environ['COUCHDB_PORT_5984_TCP_ADDR']
del os.environ['COUCHDB_PORT_5984_TCP_PORT']
del os.environ["COUCHDB_USER"]
del os.environ["COUCHDB_PASSWORD"]
@unittest.skip('only available in docker')
@unittest.skipIf(os.environ.get('IGNORE_MYSQL') or os.environ.get('IGNORE_ALL'), 'no mysql server for test.')