Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Commit

Permalink
fix a couple bugs; can test locally; closes #588
Browse files Browse the repository at this point in the history
  • Loading branch information
cglewis committed Aug 16, 2017
1 parent 5ae54f7 commit 888f17b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
25 changes: 18 additions & 7 deletions Dockerfile.test
@@ -1,20 +1,31 @@
FROM elasticsearch:2-alpine
FROM rabbitmq:3-management
FROM redis:alpine
FROM alpine:3.6
FROM ubuntu:latest
MAINTAINER Charlie Lewis <clewis@iqt.org>

RUN apk add --update \
docker \
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
git \
make \
python \
py2-pip \
&& rm -rf /var/cache/apk/*
python-pip \
software-properties-common

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

RUN apt-get update && apt-get install -y docker-ce

ADD . /vent
WORKDIR /vent
RUN pip install -r tests/requirements.txt
RUN python2.7 setup.py install

ENTRYPOINT ["make"]
CMD ["test"]
ENTRYPOINT ["pytest"]
CMD ["-l", "-s", "-v", "--cov=.", "-k", "'not vendor'", "--cov-report", "term-missing"]
14 changes: 13 additions & 1 deletion Makefile
Expand Up @@ -82,6 +82,18 @@ clean:
pip2.7 uninstall -y vent || true

test: build
py.test -s -v --cov=. -k 'not vendor' --cov-report term-missing
pytest -l -s -v --cov=. -k 'not vendor' --cov-report term-missing

test-local: test-local-clean clean
docker build -t vent-test -f Dockerfile.test .
docker run -d --name vent-test-redis redis:alpine
docker run -d --name vent-test-rabbitmq rabbitmq:3-management
docker run -d --name vent-test-elasticsearch elasticsearch:2-alpine
docker run -it -v /var/run/docker.sock:/var/run/docker.sock:rw --link vent-test-redis:redis --link vent-test-rabbitmq:localhost --link vent-test-elasticsearch:localhost vent-test

test-local-clean:
docker rm -f vent-test-redis || true
docker rm -f vent-test-rabbitmq || true
docker rm -f vent-test-elasticsearch || true

.PHONY: build test
4 changes: 3 additions & 1 deletion vent/api/actions.py
Expand Up @@ -485,7 +485,8 @@ def build(self,
build=True,
branch=branch,
version=version)
template.write_config()
if len(s) > 0:
template.write_config()
except Exception as e: # pragma: no cover
self.logger.error("build failed with error: " + str(e))
status = (False, e)
Expand Down Expand Up @@ -834,6 +835,7 @@ def get_configure(self,
"""
self.logger.info("Starting: get_configure")
constraints = locals()
del constraints['main_cfg']
status = (True, None)
template_dict = {}
return_str = ""
Expand Down
1 change: 1 addition & 0 deletions vent/core/rmq_es_connector/rmq_es_connector.py
Expand Up @@ -52,6 +52,7 @@ def connections(self, wait):
wait = False
print("connected to rabbitmq...")
except Exception as e: # pragma: no cover
print(str(e))
print("waiting for connection to rabbitmq..." + str(e))
time.sleep(2)
wait = True
Expand Down

0 comments on commit 888f17b

Please sign in to comment.