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

Integrating taiga to Perceval #1

Closed
valeriocos opened this issue Jun 16, 2020 · 3 comments
Closed

Integrating taiga to Perceval #1

valeriocos opened this issue Jun 16, 2020 · 3 comments

Comments

@valeriocos
Copy link

valeriocos commented Jun 16, 2020

Hi @fioddor ,

First of all, thank you for working on Perceval!

If you want to develop a backend for Perceval, you should

$ git remote -v
origin	https://github.com/fioddor/grimoirelab-perceval (fetch)
origin	https://github.com/fioddor/grimoirelab-perceval (push)
upstream	https://github.com/chaoss/grimoirelab-perceval (fetch)
upstream	https://github.com/chaoss/grimoirelab-perceval (push)
  • create a branch in your local repo
git checkout -b taiga-backend master
  • once the work is done, you can commit and push the code to origin
git add ...
git commit ...
git push https://github.com/fioddor/grimoirelab-perceval
  • The GitHub UI will detect the new branch and ask to create a pull request (in case you want)

Examples of this workflow are:

Hope this helps,
Valerio

@fioddor
Copy link
Owner

fioddor commented Jun 16, 2020

Nice, but unfortunately it doesn't solve my problem.

My issue isn't about code integration into repository. It's about integration deployment into the grimoirelab/full container.

Taking gitlab as model, copying the relevant import sentences and even substituting the files, it doesn't import and the message doesn't provide clues. My files work together when placed in the same directory. Placing the tests up in the same path (in /dist/perceval-0.12.24 it works also. See below). I'm overlooking something and I cannot find it.

`
/dist/perceval-0.12.24$ python3 test_minTaiga.py TestTaigaClientAgainstMockServer

Debug: Executing test_taiga as main (called as ./script.py or as python3 script.py).

test_init_with_token (main.TestTaigaClientAgainstMockServer)
A token-born client... ...
ok
test_init_with_user_and_pswd (main.TestTaigaClientAgainstMockServer)
A client is created without token. ...
ok
test_init_without_expected_arguments_causes_exception (main.TestTaigaClientAgainstMockServer)
Raises exception if client is requested without expected arguments. ...
ok
test_initialization (main.TestTaigaClientAgainstMockServer)
Taiga Client initializations. ...
ok
test_login_fail (main.TestTaigaClientAgainstMockServer)
Taiga denies permission. ...
ERROR:perceval.backends.core.gitlab:TaigaMinClient.login failed:
ERROR:perceval.backends.core.gitlab:TaigaMinClient.login Rq.headers : {'Accept': '/', 'Content-Length': '64', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'python-requests/2.21.0', 'Connection': 'close'}
ERROR:perceval.backends.core.gitlab:TaigaMinClient.login Rq.body : bytearray(b'{ "type": "normal", "username": "a_user", "password": "a_pswd" }')
ERROR:perceval.backends.core.gitlab:TaigaMinClient.login Rs.status_code : 401
ERROR:perceval.backends.core.gitlab:TaigaMinClient.login Rs.text:
{ "etc":"etc" }
ok
test_no_permission (main.TestTaigaClientAgainstMockServer)
Taiga denies permission. ...
ok
test_pj_epics (main.TestTaigaClientAgainstMockServer)
Taiga Project Epics. ...
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 37 items out of 37.
ok
test_pj_issues_stats (main.TestTaigaClientAgainstMockServer)
proj_issues_stats retrieves the expected elements. ...
ok
test_pj_stats (main.TestTaigaClientAgainstMockServer)
proj_stats retrieves the expected elements. ...
ok
test_pj_tasks (main.TestTaigaClientAgainstMockServer)
Taiga Project Tasks. ...
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 38 items out of 38.
ok
test_pj_userstories (main.TestTaigaClientAgainstMockServer)
Taiga Project User Stories. ...
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 38 items out of 38.
ok
test_pj_wiki_pages (main.TestTaigaClientAgainstMockServer)
Taiga Project Wiki Pages. ...
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 36 items out of 36.
ok
test_proj (main.TestTaigaClientAgainstMockServer)
Taiga Project data. ...
Mock set up for https://a.taiga.instance/API/V9/projects/01
Mock set up for https://a.taiga.instance/API/V9/projects/01/stats
Mock set up for https://a.taiga.instance/API/V9/projects/01/issues_stats
Mock set up for https://a.taiga.instance/API/V9/epics?project=01
Mock set up for https://a.taiga.instance/API/V9/userstories?project=01
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01&page=2
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01&page=3
Mock set up for https://a.taiga.instance/API/V9/wiki?project=01
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 60 items out of 81.
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 81 items out of 81.
Mock set up for https://a.taiga.instance/API/V9/projects/02
Mock set up for https://a.taiga.instance/API/V9/projects/02/stats
Mock set up for https://a.taiga.instance/API/V9/projects/02/issues_stats
Mock set up for https://a.taiga.instance/API/V9/epics?project=02
Mock set up for https://a.taiga.instance/API/V9/userstories?project=02
Mock set up for https://a.taiga.instance/API/V9/userstories?project=02&page=2
Mock set up for https://a.taiga.instance/API/V9/tasks?project=02
Mock set up for https://a.taiga.instance/API/V9/wiki?project=02
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 38 items out of 38.
ok
test_rq_max (main.TestTaigaClientAgainstMockServer)
Rq stops paginating on user limit. ...
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01&page=2
Mock set up for https://a.taiga.instance/API/V9/tasks?project=01&page=3
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 60 items out of 81.
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 60 items out of 81.
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 81 items out of 81.
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 60 items out of 81.
INFO:perceval.backends.core.gitlab:TaigaMinClient.rp_pages got yet 81 items out of 81.
ok
test_wrong_token (main.TestTaigaClientAgainstMockServer)
Taiga rejects wrong token. ...
ok


Ran 15 tests in 0.214s

OK
`

@fioddor
Copy link
Owner

fioddor commented Jun 16, 2020

Ok. I think I've got it!

The correct deployment directory within the grimoirelab/full container isn't /dist/perceval-0.12.24/..., but /usr/local/lib/python3.5/dist-packages/perceval/backends/core.

Now test_minTaiga.py is runned ok by run_tests.py.

@fioddor fioddor closed this as completed Jun 16, 2020
@valeriocos
Copy link
Author

The correct deployment directory within the grimoirelab/full container isn't /dist/perceval-0.12.24/..., but /usr/local/lib/python3.5/dist-packages/perceval/backends/core

You are right!

Just a minor comment about #1 (comment), if you develop the Perceval backend as suggested at #1 (comment), you can then copy the python file that includes the backend to the location /usr/local/lib/python3.5/dist-packages/perceval/backends/core in the container. This would ease the development of the backend.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants