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:
- 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)
- `(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)
- Source compatibility with `org.clojure/data.json {:mvn/version "2.4.0}"`
- 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)
- Compatibility with `org.clojure/data.json {:mvn/version "2.4.0}"`
- 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)
- 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:

View file

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