clean up tests
This commit is contained in:
@@ -147,6 +147,40 @@
|
||||
(fs/delete-tree repo-dir)
|
||||
(println "Cleaned up" repo-dir)))
|
||||
|
||||
(def test-repo-paths
|
||||
"All test repo paths created by e2e tests."
|
||||
["/tmp/lazygitclj-e2e-test"
|
||||
"/tmp/lazygitclj-e2e-nav"
|
||||
"/tmp/lazygitclj-e2e-stage"
|
||||
"/tmp/lazygitclj-e2e-commit"
|
||||
"/tmp/lazygitclj-e2e-commit-verify"
|
||||
"/tmp/lazygitclj-e2e-branch"
|
||||
"/tmp/lazygitclj-e2e-branches-tabs"
|
||||
"/tmp/lazygitclj-e2e-commits-tabs"
|
||||
"/tmp/lazygitclj-e2e-stash"
|
||||
"/tmp/lazygitclj-e2e-stash-menu"
|
||||
"/tmp/lazygitclj-e2e-help"
|
||||
"/tmp/lazygitclj-e2e-reset"
|
||||
"/tmp/lazygitclj-e2e-undo"
|
||||
"/tmp/lazygitclj-e2e-cursor"
|
||||
"/tmp/lazygitclj-e2e-branch-order"
|
||||
;; Additional test repos from older/manual tests
|
||||
"/tmp/lazygitclj-e2e-modal"
|
||||
"/tmp/lazygitclj-e2e-modal-large"
|
||||
"/tmp/lazygitclj-e2e-modal-narrow"
|
||||
"/tmp/lazygitclj-e2e-modal-small"
|
||||
"/tmp/lazygitclj-e2e-scroll"])
|
||||
|
||||
(defn cleanup-all
|
||||
"Clean up all test repos."
|
||||
[]
|
||||
(println "Cleaning up e2e test repos...")
|
||||
(doseq [path test-repo-paths]
|
||||
(when (fs/exists? path)
|
||||
(fs/delete-tree path)
|
||||
(println " Removed" path)))
|
||||
(println "Cleanup complete."))
|
||||
|
||||
(def tests
|
||||
"List of e2e test tapes."
|
||||
["test/e2e/navigation.tape"
|
||||
@@ -182,6 +216,9 @@
|
||||
(println "Running lazygitclj VHS e2e tests...")
|
||||
(println "=================================")
|
||||
|
||||
;; Clean up any leftover test repos before starting
|
||||
(cleanup-all)
|
||||
|
||||
(let [results (map run-tape tests)
|
||||
passed (count (filter true? results))
|
||||
failed (count (filter false? results))]
|
||||
@@ -191,6 +228,9 @@
|
||||
(println (str "Results: " passed " passed, " failed " failed"))
|
||||
(println "=================================")
|
||||
|
||||
;; Clean up after tests complete
|
||||
(cleanup-all)
|
||||
|
||||
(when (pos? failed)
|
||||
(System/exit 1))))
|
||||
|
||||
@@ -202,5 +242,6 @@
|
||||
"setup-cursor" (setup-cursor-test-repo (or (second args) "/tmp/lazygitclj-e2e-cursor"))
|
||||
"setup-branch-order" (setup-branch-order-test-repo (or (second args) "/tmp/lazygitclj-e2e-branch-order"))
|
||||
"cleanup-branch-order" (cleanup-branch-order-test-repo (or (second args) "/tmp/lazygitclj-e2e-branch-order"))
|
||||
"cleanup" (cleanup-all)
|
||||
"run" (run-all)
|
||||
(run-all))))
|
||||
|
||||
Reference in New Issue
Block a user