Skip to content

Commit

Permalink
[HOTFIX] Fix coverage and broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipe72 committed Nov 26, 2018
1 parent 4bf9163 commit 1fb9f55
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ before_install:
script:
- docker-compose up -d
- sleep 10
- docker-compose run worker coverage run -m unittest resources/testsYotube.py
- docker-compose run worker coverage report
- mv worker/.coverage .

after_success:
- docker-compose run -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -w /queue worker coveralls

deploy:
- provider: heroku
Expand Down
4 changes: 3 additions & 1 deletion worker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM python:3.6-jessie

RUN apt-get update && apt-get install git

ENV CELERY_BROKER_URL redis://redis:6379/0
ENV CELERY_RESULT_BACKEND redis://redis:6379/0
ENV C_FORCE_ROOT true

COPY . /queue
WORKDIR /queue
WORKDIR /queue/worker

RUN pip install -r requirements.txt

Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ version: '3.5'
services:
worker:
build:
context: worker
context: .
dockerfile: Dockerfile
networks:
- proxynet
depends_on:
- redis
environment:
- COVERALLS_REPO_TOKEN
env_file:
- .env
volumes:
- ./worker:/queue
- .:/queue
redis:
image: redis
networks:
Expand Down
2 changes: 2 additions & 0 deletions worker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ vine==1.1.4
requests
colorific
requests-mock
coverage
coveralls
10 changes: 5 additions & 5 deletions worker/resources/testsYotube.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def test_requisicao_video_Yotube(self, request_mock):
request_mock.get(url, json=data_video)

data = {
'count_views': 907581,
'count_likes': 4067,
'count_dislikes': 1352,
'count_favorites': 0,
'count_comments': 466
'viewCount': 907581,
'likeCount': 4067,
'dislikeCount': 1352,
'favoriteCount': 0,
'commentCount': 466
}

video_data = self.youtube.get_video_youtube_data(id_video)
Expand Down

0 comments on commit 1fb9f55

Please sign in to comment.