From 5f235f683c6e04c5511884e3610944ab4490c299 Mon Sep 17 00:00:00 2001 From: ikappaki Date: Mon, 16 Oct 2023 21:28:47 +0100 Subject: [PATCH 1/3] temporarily run tests on GH --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f64e3cc75..b2a3fb411 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,6 +86,10 @@ jobs: - run: npm install shadow-cljs@2.20.13 -g - run: npm install nbb@1.1.152 -g + - name: Test the project + run: | + eldev -p -dtTC test || eldev -p -dtTC test + - name: Test integration run: | # The tests occasionally fail on macos&win in what is seems to From 9964960ff5ada3980ccef3ebf3a91458cfe3d742 Mon Sep 17 00:00:00 2001 From: ikappaki Date: Mon, 16 Oct 2023 21:46:47 +0100 Subject: [PATCH 2/3] Fix cider-expected-ns and cider-provide-file issues on GHA win - cider-expected-ns: can't use a fake `/a` path because it exists on the GH windows machine. - cider-provide-file: can't use `/tmp` as the temp directory becuase it doesn't exist. --- test/cider-client-tests.el | 18 +++++++++--------- test/cider-eval-tests.el | 35 ++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/test/cider-client-tests.el b/test/cider-client-tests.el index 505067397..1411827ab 100644 --- a/test/cider-client-tests.el +++ b/test/cider-client-tests.el @@ -136,7 +136,7 @@ (before-each (spy-on 'cider-connected-p :and-return-value t) (spy-on 'cider-classpath-entries :and-return-value - '("/a" "/b" "/c" "/c/inner" "/base/clj" "/base/clj-dev")) + '("/cider--a" "/cider--b" "/cider--c" "/cider--c/inner" "/cider--base/clj" "/cider--base/clj-dev")) (spy-on 'file-directory-p :and-return-value t) (spy-on 'file-in-directory-p :and-call-fake (lambda (file dir) (string-prefix-p dir file))) @@ -144,22 +144,22 @@ (substring file (+ 1 (length dir)))))) (it "returns the namespace matching the given string path" - (expect (cider-expected-ns "/a/foo/bar/baz_utils.clj") :to-equal + (expect (cider-expected-ns "/cider--a/foo/bar/baz_utils.clj") :to-equal "foo.bar.baz-utils") - (expect (cider-expected-ns "/b/foo.clj") :to-equal + (expect (cider-expected-ns "/cider--b/foo.clj") :to-equal "foo") - (expect (cider-expected-ns "/c/inner/foo/bar.clj") :to-equal + (expect (cider-expected-ns "/cider--c/inner/foo/bar.clj") :to-equal ;; NOT inner.foo.bar "foo.bar") - (expect (cider-expected-ns "/c/foo/bar/baz") :to-equal + (expect (cider-expected-ns "/cider--c/foo/bar/baz") :to-equal "foo.bar.baz") - (expect (cider-expected-ns "/base/clj-dev/foo/bar.clj") :to-equal + (expect (cider-expected-ns "/cider--base/clj-dev/foo/bar.clj") :to-equal "foo.bar") - (expect (cider-expected-ns "/not/in/classpath.clj") :to-equal - (clojure-expected-ns "/not/in/classpath.clj"))) + (expect (cider-expected-ns "/cider--not/in/classpath.clj") :to-equal + (clojure-expected-ns "/cider--not/in/classpath.clj"))) (it "returns nil if it cannot find the namespace" - (expect (cider-expected-ns "/z/abc/def") :to-equal "")) + (expect (cider-expected-ns "/cider--z/abc/def") :to-equal "")) (it "falls back on `clojure-expected-ns' in the absence of an active nREPL connection" (spy-on 'cider-connected-p :and-return-value nil) diff --git a/test/cider-eval-tests.el b/test/cider-eval-tests.el index 60fc4a8bf..b411d6413 100644 --- a/test/cider-eval-tests.el +++ b/test/cider-eval-tests.el @@ -31,23 +31,24 @@ ;; Please, for each `describe', ensure there's an `it' block, so that its execution is visible in CI. (describe "cider-provide-file" - (it "returns an empty string when the file is not found" - (expect (cider-provide-file "abc.clj") :to-equal "")) - (it "base64 encodes without newlines" - (let ((cider-sideloader-path (list "/tmp")) - (default-directory "/tmp") - (filename (make-temp-file "abc.clj"))) - (with-temp-file filename - (dotimes (_ 60) (insert "x"))) - (expect (cider-provide-file filename) :not :to-match "\n"))) - (it "can handle multibyte characters" - (let ((cider-sideloader-path (list "/tmp")) - (default-directory "/tmp") - (filename (make-temp-file "abc.clj")) - (coding-system-for-write 'utf-8-unix)) - (with-temp-file filename - (insert "🍻")) - (expect (cider-provide-file filename) :to-equal "8J+Nuw==")))) + (let ((tmp-dir (temporary-file-directory))) + (it "returns an empty string when the file is not found" + (expect (cider-provide-file "abc.clj") :to-equal "")) + (it "base64 encodes without newlines" + (let ((cider-sideloader-path (list tmp-dir)) + (default-directory tmp-dir) + (filename (make-temp-file "abc.clj"))) + (with-temp-file filename + (dotimes (_ 60) (insert "x"))) + (expect (cider-provide-file filename) :not :to-match "\n"))) + (it "can handle multibyte characters" + (let ((cider-sideloader-path (list tmp-dir)) + (default-directory tmp-dir) + (filename (make-temp-file "abc.clj")) + (coding-system-for-write 'utf-8-unix)) + (with-temp-file filename + (insert "🍻")) + (expect (cider-provide-file filename) :to-equal "8J+Nuw=="))))) (describe "cider-extract-error-info" (it "Matches Clojure compilation exceptions" From 04e0ad20c30ec84ca1f7fc064f1963567e8911fb Mon Sep 17 00:00:00 2001 From: ikappaki Date: Mon, 16 Oct 2023 22:04:23 +0100 Subject: [PATCH 3/3] remove test job from GHA --- .github/workflows/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2a3fb411..f64e3cc75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,10 +86,6 @@ jobs: - run: npm install shadow-cljs@2.20.13 -g - run: npm install nbb@1.1.152 -g - - name: Test the project - run: | - eldev -p -dtTC test || eldev -p -dtTC test - - name: Test integration run: | # The tests occasionally fail on macos&win in what is seems to