Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI to check pull-requests #11

Closed
leportella opened this issue Jun 12, 2018 · 12 comments
Closed

Add CI to check pull-requests #11

leportella opened this issue Jun 12, 2018 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@leportella
Copy link
Collaborator

  • flake8
  • isort
  • coverage
@leportella leportella added the help wanted Extra attention is needed label Jun 26, 2018
@amadeu01
Copy link
Contributor

Could it be Travis CI? Or, do you want any specific CI ?

@cuducos
Copy link
Contributor

cuducos commented Jul 22, 2018

Nothing specific at this moment ; )

@amadeu01
Copy link
Contributor

Okay.

@amadeu01
Copy link
Contributor

Hi again.

I did one really simple Travis.

Build

Which I simply run the tests as it was described on the readme. However, it raises


==================================== ERRORS ====================================
_______________ ERROR collecting candidates/tests/test_views.py ________________
ImportError while importing test module '/code/candidates/tests/test_views.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
candidates/tests/test_views.py:6: in <module>
    from candidates.models import Candidates
E   ModuleNotFoundError: No module named 'candidates.models'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.21 seconds ============================

I wonder if you could give me a hand on this.

@amadeu01
Copy link
Contributor

To be clear, I just run:
docker-compose run --rm api pytest

@cuducos
Copy link
Contributor

cuducos commented Jul 23, 2018

Many thanks, @amadeu01 – it looks like you've catch some lines that weren't updated after last change in the architecture. I've changed two lines and now tests are passing:

diff --git a/api/candidates/tests/test_views.py b/api/candidates/tests/test_views.py
index d44b26e..ee25b77 100644
--- a/api/candidates/tests/test_views.py
+++ b/api/candidates/tests/test_views.py
@@ -3,7 +3,7 @@ import json
 import pytest
 from mongoengine.errors import NotUniqueError
 
-from candidates.models import Candidates
+from models import Candidates
 
 
 @pytest.fixture
diff --git a/api/candidates/views.py b/api/candidates/views.py
index a58fd4d..9acc84d 100644
--- a/api/candidates/views.py
+++ b/api/candidates/views.py
@@ -4,7 +4,7 @@ from restless.dj import DjangoResource
 from restless.preparers import FieldsPreparer
 from restless.serializers import JSONSerializer
 
-from .models import Candidates
+from models.candidates import Candidates
 
 
 class CandidateResource(DjangoResource):

@amadeu01
Copy link
Contributor

amadeu01 commented Jul 23, 2018 via email

@cuducos
Copy link
Contributor

cuducos commented Jul 23, 2018

Okay, I’ll keep on the travis script.

I would suggest you to incorporate these fixes in your PR. They are important to make sure the Travis CI is working as expected ; )

@amadeu01
Copy link
Contributor

amadeu01 commented Jul 23, 2018 via email

@amadeu01
Copy link
Contributor

amadeu01 commented Jul 23, 2018

@cuducos don’t you think that would be better to make those fixes on another PR?

@cuducos
Copy link
Contributor

cuducos commented Jul 23, 2018

I think either way would be just fine.

amadeu01 added a commit to amadeu01/perfil that referenced this issue Jul 24, 2018
As commented on issue okfn-brasil#11, there was misspellig at  and
@cuducos
Copy link
Contributor

cuducos commented Aug 28, 2018

Working ; )

@cuducos cuducos closed this as completed Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants