Add unit test for mgr-gitlab-clone, run in CI

This commit is contained in:
2022-03-23 15:00:22 -07:00
parent e05c409207
commit e63f1ce9cc
3 changed files with 30 additions and 2 deletions

View File

@@ -45,12 +45,12 @@
(defun mgr-gitlab-clone (name)
"Clone the project NAME."
;; TODO: Automatically set remote.pushDefault so it does not prompt
;; TODO: Clone with API token, if there is one
(interactive
(list (completing-read "Project: " (mgr-gitlab-list-remote-project-names))))
(let* ((url (mgr-gitlab--get-url-by-name name))
(dest mgr-gitlab-project-path))
(setf magit-clone-set-remote.pushDefault t)
(magit-clone-regular url dest nil)))
(defun mgr-gitlab-clone-all ()
@@ -92,4 +92,8 @@ gitlab so kindly removes."
(add-to-list 'dashboard-item-generators '(mgr-gitlab-gitlab-projects . mgr-gitlab-dashboard-insert-gitlab-projects))
(ert-deftest mgr-gitlab-clone-test ()
"Tests that mgr-gitlab can clone a repo"
(mgr-gitlab-clone "IotButton"))
(provide 'mgr-gitlab)