Skip to content

Commit

Permalink
lein -> deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenet committed Sep 15, 2023
1 parent cfa0e61 commit be3b301
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
with:
java-version: '17'

- name: Install leiningen
uses: DeLaGuardo/setup-clojure@master
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@10.0
with:
lein: 2.9.3
cli: 1.11.1.1182

- name: Test
run: lein test
run: clojure -X:test qbits.spandex-test-runner/run



Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ it's quite cheap.

Or the [clj.specs](https://github.com/mpenet/spandex/blob/master/src/clj/qbits/spandex/spec.clj) if that's your thing:

## Running the tests

``` clojure
clj -X:test qbits.spandex-test-runner/run
```

clj -X:test qbits.spandex-test-runner/run

## Patreon

If you wish to support the work on this project you can do this via my
Expand Down
33 changes: 17 additions & 16 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{:deps
{org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/core.async {:mvn/version "0.6.532"}
{:exoscale.project/lib cc.qbits/spandex
:exoscale.project/version-file "VERSION"
:exoscale.project/deploy? true
:slipset.deps-deploy/exec-args {:installer :remote
:sign-releases? false
:repository "clojars"}

:deps
{org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/core.async {:mvn/version "1.6.681"}
org.elasticsearch.client/elasticsearch-rest-client {:mvn/version "8.10.0"}
org.elasticsearch.client/elasticsearch-rest-client-sniffer
{:mvn/version "8.10.0"
:exclusions [com.fasterxml.jackson.core/jackson-core]}
org.elasticsearch.client/elasticsearch-rest-client-sniffer {:mvn/version "8.10.0"}
cc.qbits/commons {:mvn/version "0.5.2"}
cheshire {:mvn/version "5.9.0"}
cheshire/cheshire {:mvn/version "5.11.0"}
ring/ring-codec {:mvn/version "1.1.2"}}

:paths ["src/clj"]

:aliases {:test {:extra-paths ["test"]
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "5fb4fc46ad0bf2e0ce45eba5b9117a2e89166479"}}
:main-opts ["-m" "cognitect.test-runner"]}
:cljfmt {:extra-deps {com.jameslaverack/cljfmt-runner {:git/url "https://github.com/JamesLaverack/cljfmt-runner"
:sha "fc12c2724c44185cd1b221a79c8486c73846f14c"
:exclusions [cljfmt]}
cljfmt {:mvn/version "0.6.4"}}
:main-opts ["-m" "cljfmt-runner.check"]}
:cljfmt/fix {:main-opts ["-m" "cljfmt-runner.fix"]}}}
:extra-deps {eftest/eftest {:mvn/version "0.6.0"}}}
:project
{:extra-deps {io.github.exoscale/tools.project {:git/sha "5f24196ebea4dc6e601d201d97b463ea26923c7e"}}
:ns-default exoscale.tools.project
:jvm-opts ["-Dclojure.main.report=stderr"]}}}
29 changes: 0 additions & 29 deletions project.clj

This file was deleted.

38 changes: 38 additions & 0 deletions test/qbits/spandex/spandex_test_runner.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(ns qbits.spandex.spandex-test-runner
(:gen-class)
(:require [clojure.test]
eftest.report.pretty
[eftest.runner :as ef]))

(def default-options
{:dir "test"
:capture-output? true
:fail-fast? true
:multithread? :vars
:reporters [eftest.report.pretty/report]})

(defn- ret->exit-code
[{:as _ret :keys [error fail]}]
(System/exit
(cond
(and (pos? fail) (pos? error)) 30
(pos? fail) 20
(pos? error) 10
:else 0)))

(defn combined-reporter
"Combines the reporters by running first one directly,
and others with clojure.test/*report-counters* bound to nil."
[[report & rst]]
(fn [m]
(report m)
(doseq [report rst]
(binding [clojure.test/*report-counters* nil]
(report m)))))

(defn run
[options]
(let [options (merge default-options options)]
(-> (ef/find-tests (:dir options))
(ef/run-tests options)
ret->exit-code)))

0 comments on commit be3b301

Please sign in to comment.