clean up tests
This commit is contained in:
@@ -16,4 +16,6 @@
|
||||
e2e:setup-branch-order {:doc "Setup branch order test repo"
|
||||
:task (e2e/setup-branch-order-test-repo)}
|
||||
e2e:cleanup-branch-order {:doc "Cleanup branch order test repo"
|
||||
:task (e2e/cleanup-branch-order-test-repo)}}}
|
||||
:task (e2e/cleanup-branch-order-test-repo)}
|
||||
e2e:cleanup {:doc "Cleanup all e2e test repos"
|
||||
:task (e2e/cleanup-all)}}}
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-branch && cd /tmp/lazygitclj-e2e-branch && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-branch && cd /tmp/lazygitclj-e2e-branch && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -69,3 +69,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-branch"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo with tags and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-branches-tabs && cd /tmp/lazygitclj-e2e-branches-tabs && git tag v1.0.0 && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-branches-tabs && cd /tmp/lazygitclj-e2e-branches-tabs && git tag v1.0.0 && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -46,3 +46,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-branches-tabs"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -12,8 +12,8 @@ Set Width 1000
|
||||
Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo (clean working tree) and run lazygitclj
|
||||
Type "cd /tmp && rm -rf lazygitclj-e2e-branch && git clone /tmp/lazygitclj-e2e-nav lazygitclj-e2e-branch 2>/dev/null && cd lazygitclj-e2e-branch && git checkout main && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-branch && cd /tmp/lazygitclj-e2e-branch && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -37,3 +37,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-branch"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -83,3 +83,8 @@ Sleep 500ms
|
||||
Type "git show --stat HEAD"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-commit-verify"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-commit && cd /tmp/lazygitclj-e2e-commit && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-commit && cd /tmp/lazygitclj-e2e-commit && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -48,3 +48,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-commit"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-commits-tabs && cd /tmp/lazygitclj-e2e-commits-tabs && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-commits-tabs && cd /tmp/lazygitclj-e2e-commits-tabs && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -44,3 +44,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-commits-tabs"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -12,8 +12,8 @@ Set Width 1000
|
||||
Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo with many files using setup script
|
||||
Type "./test/e2e/setup-cursor-test.sh && cd /tmp/lazygitclj-e2e-cursor && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
# Setup test repo with many files
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup-cursor && cd /tmp/lazygitclj-e2e-cursor && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 3s
|
||||
|
||||
@@ -50,3 +50,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-cursor"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-help && cd /tmp/lazygitclj-e2e-help && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-help && cd /tmp/lazygitclj-e2e-help && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -36,3 +36,8 @@ Sleep 1s
|
||||
# Quit the app
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-help"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-nav && cd /tmp/lazygitclj-e2e-nav && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-nav && cd /tmp/lazygitclj-e2e-nav && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -77,3 +77,8 @@ Sleep 300ms
|
||||
# Quit with q
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-nav"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo with changes and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-reset && cd /tmp/lazygitclj-e2e-reset && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-reset && cd /tmp/lazygitclj-e2e-reset && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -55,3 +55,8 @@ Sleep 1s
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-reset"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-stage && cd /tmp/lazygitclj-e2e-stage && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-stage && cd /tmp/lazygitclj-e2e-stage && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -43,3 +43,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-stage"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo with changes and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-stash-menu && cd /tmp/lazygitclj-e2e-stash-menu && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-stash-menu && cd /tmp/lazygitclj-e2e-stash-menu && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -48,3 +48,8 @@ Sleep 500ms
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-stash-menu"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and run lazygitclj
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-stash && cd /tmp/lazygitclj-e2e-stash && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-stash && cd /tmp/lazygitclj-e2e-stash && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -57,3 +57,8 @@ Sleep 1s
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-stash"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
@@ -13,7 +13,7 @@ Set Height 600
|
||||
Set Framerate 10
|
||||
|
||||
# Setup test repo and make some changes
|
||||
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-undo && cd /tmp/lazygitclj-e2e-undo && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Type "cd /home/ajet/repos/lazygitclj && bb e2e:setup /tmp/lazygitclj-e2e-undo && cd /tmp/lazygitclj-e2e-undo && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
@@ -57,3 +57,8 @@ Sleep 1s
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 1s
|
||||
|
||||
# Cleanup test repo
|
||||
Type "rm -rf /tmp/lazygitclj-e2e-undo"
|
||||
Enter
|
||||
Sleep 500ms
|
||||
|
||||
Reference in New Issue
Block a user