Fix Windows test

This commit is contained in:
Michiel Borkent 2021-07-14 14:54:05 +02:00
parent 36ab5ab299
commit a8eea0dfd7
2 changed files with 15 additions and 15 deletions

View file

@ -7,16 +7,16 @@ For a list of breaking changes, check [here](#breaking-changes).
Babashka proper: Babashka proper:
- Add `clojure.tools.logging` with `taoensso.timbre` as the default implementation - Add `clojure.tools.logging` with `taoensso.timbre` as the default implementation
- Passing form on Windows with question mark breaks evaluation [#889](https://github.com/babashka/babashka/issues/889) - Source compatibility with `org.clojure/data.json {:mvn/version "2.4.0}"`
- `(read-line)` is buggy in REPL [#899](https://github.com/babashka/babashka/issues/899)
- Add `java.io.FileInputStream`. This fixes compatibility with [replikativ/hasch](https://github.com/replikativ/hasch).
- `babashka.tasks/clojure` with `:dir` option doesn't resolve deps in `:dir` [#914](https://github.com/babashka/babashka/issues/914)
- Support `pprint/formatter-out` [#922](https://github.com/babashka/babashka/issues/922) - Support `pprint/formatter-out` [#922](https://github.com/babashka/babashka/issues/922)
- Support `pprint/cl-format` with `with-out-str` [#930](https://github.com/babashka/babashka/issues/930) - Support `pprint/cl-format` with `with-out-str` [#930](https://github.com/babashka/babashka/issues/930)
- Compatibility with `org.clojure/data.json {:mvn/version "2.4.0}"`
- Support passing `GITLIBS` via `:extra-env` in `clojure` to set git lib dir: - Support passing `GITLIBS` via `:extra-env` in `clojure` to set git lib dir:
`(clojure {:extra-env {"GITLIBS" ".gitlib"}} ,,,)` [#934](https://github.com/babashka/babashka/issues/934) `(clojure {:extra-env {"GITLIBS" ".gitlib"}} ,,,)` [#934](https://github.com/babashka/babashka/issues/934)
- Add `--force` option to force recomputation of bababashka deps classpath. - Add `--force` option to force recomputation of bababashka deps classpath.
- Add `java.io.FileInputStream`. This fixes compatibility with [replikativ/hasch](https://github.com/replikativ/hasch).
- Passing form on Windows with question mark breaks evaluation [#889](https://github.com/babashka/babashka/issues/889)
- Fix `(read-line)` in REPL [#899](https://github.com/babashka/babashka/issues/899)
- `babashka.tasks/clojure` with `:dir` option doesn't resolve deps in `:dir` [#914](https://github.com/babashka/babashka/issues/914)
Deps.clj: Deps.clj:

View file

@ -3,7 +3,8 @@
[babashka.fs :as fs] [babashka.fs :as fs]
[babashka.test-utils :as test-utils] [babashka.test-utils :as test-utils]
[clojure.edn :as edn] [clojure.edn :as edn]
[clojure.test :as test :refer [deftest is testing]])) [clojure.test :as test :refer [deftest is testing]]
[clojure.string :as str]))
(defn bb [& args] (defn bb [& args]
(edn/read-string (edn/read-string
@ -79,14 +80,13 @@ true
(testing "GITLIBS can set location of .gitlibs dir" (testing "GITLIBS can set location of .gitlibs dir"
(let [tmp-dir (fs/create-temp-dir) (let [tmp-dir (fs/create-temp-dir)
libs-dir (fs/file tmp-dir ".gitlibs") libs-dir (fs/file tmp-dir ".gitlibs")
libs-dir2 (fs/file tmp-dir ".gitlibs2")] libs-dir2 (fs/file tmp-dir ".gitlibs2")
;; TODO: fix for Windows native. template (pr-str '(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"]
;; See https://ci.appveyor.com/project/borkdude/babashka/builds/39970756 {:out :string :env-key {"PATH" (System/getenv "PATH")
(when-not (and test-utils/windows? "GITLIBS" :gitlibs}}) nil))]
test-utils/native?) (bb (-> template (str/replace ":gitlibs" (pr-str (str libs-dir)))
(bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"] (str/replace ":env-key" ":env")))
{:out :string :env {"PATH" (System/getenv "PATH") (bb (-> template (str/replace ":gitlibs" (pr-str (str libs-dir2)))
"GITLIBS" ~(str libs-dir)}}) nil)))) (str/replace ":env-key" ":extra-env")))
(bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"] {:out :string :extra-env {"GITLIBS" ~(str libs-dir2)}}) nil)))
(is (fs/exists? libs-dir)) (is (fs/exists? libs-dir))
(is (fs/exists? libs-dir2))))) (is (fs/exists? libs-dir2)))))