Skip to content

Commit

Permalink
Test fix for Travis build on PR #356
Browse files Browse the repository at this point in the history
Signed-off-by: Carter Landis <[email protected]>
  • Loading branch information
ccarterlandis committed Aug 17, 2019
1 parent 72c24bc commit 2ea2b4a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ _pycache_
augur/bin
.pytest_cache
.ipynb_checkpoints
venv/
dist/

# Node #
########
Expand Down
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
matrix:
include:
- name: Python Datasource Unit Tests
install: pip install .
install: python setup.py install; pip install .
language: python
python: '3.6'
script: python -m pytest augur/datasources/**/test_**_functions.py
script:
- pip install zmq
- python -m pytest augur/datasources/**/test_**_functions.py

- name: API Unit Tests
install: python setup.py install; pip install -e .
install: python setup.py install; pip install .
language: python
python: '3.6'
script:
- pip install zmq
- augur run > /dev/null 2>&1 &
- augur run &
- sleep 10
- python -m pytest augur/datasources/**/test_**_routes.py

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ build: frontend docs
test:test-functions test-routes

test-functions:
bash -c '$(CONDAACTIVATE) $(AUGUR_PYTHON) -m pytest augur/datasources/$(PLUGIN)/test_$(PLUGIN)_functions.py'
bash -c '$(CONDAACTIVATE) $(AUGUR_PYTHON) -m pytest -ra augur/datasources/$(PLUGIN)/test_$(PLUGIN)_functions.py'

test-routes:
@ python test/api/test_api.py $(PLUGIN)
Expand Down
1 change: 1 addition & 0 deletions augur/datasources/ghtorrent/ghtorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, user, password, host, port, dbname):
self.DB_STR = 'mysql+pymysql://{}:{}@{}:{}/{}'.format(
user, password, host, port, dbname
)
print(self.DB_STR)
logger.debug('GHTorrent: Connecting to {}:{}/{} as {}'.format(host, port, dbname, user))
self.db = s.create_engine(self.DB_STR, poolclass=s.pool.NullPool)
try:
Expand Down
16 changes: 8 additions & 8 deletions augur/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def list_commands(self, ctx):
return rv

def get_command(self, ctx, name):
try:
if sys.version_info[0] == 2:
name = name.encode('ascii', 'replace')
mod = __import__('augur.cli.' + name,
None, None, ['cli'])
except ImportError as e:
logger.debug(e)
return
# try:
if sys.version_info[0] == 2:
name = name.encode('ascii', 'replace')
mod = __import__('augur.cli.' + name,
None, None, ['cli'])
# except ImportError as e:
# logger.debug(e)
# return
return mod.cli


Expand Down
Binary file removed dist/augur-0.9.4-py3.6.egg
Binary file not shown.
3 changes: 2 additions & 1 deletion test/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
FNULL = open(os.devnull, 'w')

start = subprocess.Popen(['augur', 'run'], stdout=FNULL, stderr=subprocess.STDOUT)
print("Waiting for the server to start...")
time.sleep(20)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
process = subprocess.run("pytest -ra augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(5)
subprocess.Popen(['make', 'backend-stop'])

Expand Down

0 comments on commit 2ea2b4a

Please sign in to comment.