Closed c-martinez closed 1 year ago
I've added gitlab tests, but am not familiar enough with Gitlab library to write these tests. @GenEars, do you think you might be able to help there?
I've added gitlab tests, but am not familiar enough with Gitlab library to write these tests. @GenEars, do you think you might be able to help there?
Hello @c-martinez. I browsed over your https://github.com/CLARIAH/grlc/pull/390/commits/7bbcdcc1982eea8440405cee290e6f0f75e30643 commit where I understand we need to simulate a GitLab endpoint.
I am currently digging into references and code to see how we can do this, or whether we can simply substitute GitHub for these tests. Indeed the git_access_token
config parameter exists in both grlc's GitHub and GitLab context, and gitlab_url
is the only new thing.
Will keep you informed ...
Great, thanks @GenEars -- indeed for the tests we should simulate (mock) the responses from GitLab endpoint. Let me know if you get stuck and feel you need a hand.
Hey @GenEars, just wondering if you managed to make any progress in adding tests for GitLab endpoint. I think we have two possibilities, depending on how long it might take to develop these test:
a) Leave as draft until tests are ready b) Merge without tests, and open a new issue for adding tests
What do you think?
Hello @c-martinez, I had to postpone my work on this project, so I have no updates to provide at the moment. I think option b) "Merge without tests, and open a new issue for adding tests" is quite safe. Did you tried to run a local version of the code with a configuration targetting your office/university GitLab instance? By the way, this makes me think that a providing a test repo on https://gitlab.com may help on this task as this would avoid the need to create temporary instances of GitLab during tests.
No worries, perfectly understand having to postpone projects.
Ok, will go ahead with option b). I've created issues #394 and #395 to follow up later.
I think a GitLab test repo is a very good idea, but I think that unit tests should still work with temporary (mock) GitLab instances. The reason being that then tests can run even if you do not have an internet connection at the time of testing.
I think a GitLab test repo is a very good idea, but I think that unit tests should still work with temporary (mock) GitLab instances. The reason being that then tests can run even if you do not have an internet connection at the time of testing.
Continuing here from #387
A few issues that remain:
Method dispatch_query seems to be significantly different. It looks like it just posts request directly to the endpoint, without rewriting the query (which, we want to do), so I am sticking to the original implementation (unless I am missing something somewhere)
Variable
git_type
is used to differentiate between GitHub and GitLab loaders. It is assigned"github"
and"gitlab"
-- it should probably be replaced for a constant.Tests for gitlab are missing