mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 20:49:44 +00:00
fix test config
This commit is contained in:
parent
243b8d839b
commit
a81562f379
3 changed files with 7 additions and 11 deletions
|
|
@ -12,12 +12,11 @@ steps:
|
||||||
- name: test
|
- name: test
|
||||||
image: python:3.6
|
image: python:3.6
|
||||||
commands:
|
commands:
|
||||||
# Wait for couch
|
# Install pre-requisites
|
||||||
- until curl 'http://couchdb:5984' ; do sleep 1 ; done
|
|
||||||
# Configure settings
|
|
||||||
- export HUMULUS_SETTINGS="$(pwd)/testsettings.py"
|
|
||||||
# Run tests
|
|
||||||
- pip install coverage pytest
|
- pip install coverage pytest
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
|
# Wait for couch
|
||||||
|
- until curl 'http://couchdb:5984' ; do sleep 1 ; done
|
||||||
|
# Run tests
|
||||||
- coverage run -m pytest
|
- coverage run -m pytest
|
||||||
- coverage report -m
|
- coverage report -m
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
@ -22,8 +23,9 @@ from humulus.couch import build_couch, get_couch, put_doc
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def app():
|
def app():
|
||||||
dbname = 'test_{}'.format(str(uuid.uuid4()))
|
dbname = 'test_{}'.format(str(uuid.uuid4()))
|
||||||
|
couchurl = os.environ.get('COUCH_URL', 'http://127.0.0.1:5984')
|
||||||
app = create_app({
|
app = create_app({
|
||||||
'COUCH_URL': 'http://127.0.0.1:5984',
|
'COUCH_URL': couchurl,
|
||||||
'COUCH_USERNAME': 'admin',
|
'COUCH_USERNAME': 'admin',
|
||||||
'COUCH_PASSWORD': 'password',
|
'COUCH_PASSWORD': 'password',
|
||||||
'COUCH_DATABASE': dbname,
|
'COUCH_DATABASE': dbname,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
SECRET_KEY = b'dev'
|
|
||||||
COUCH_URL='http://couchdb:5984'
|
|
||||||
COUCH_USERNAME='admin'
|
|
||||||
COUCH_PASSWORD='password'
|
|
||||||
COUCH_DATABASE='humulus'
|
|
||||||
Loading…
Add table
Reference in a new issue