bb test now works

This commit is contained in:
Michael Jerger 2024-03-07 14:56:27 +01:00
parent 0311d68371
commit 10bf635cdf
5 changed files with 63 additions and 10 deletions

13
bb.edn
View file

@ -1,5 +1,10 @@
{:deps {dda/dda-devops-build {:local/root "."}}
:tasks
{:requires ([dda.devops-build.image :as image])
image-build (image/dbuild {:name "myimage"})}}
:tasks
{test
{:extra-paths ["src/test/clj"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (exec 'cognitect.test-runner.api/test)
:exec-args {:dirs ["src/test/clj"]}
:org.babashka/cli {:coerce {:nses [:symbol]
:vars [:symbol]}}}}}

View file

@ -1,7 +1,3 @@
{:paths ["src/main/clj"]
:deps {org.clojure/spec.alpha {:mvn/version "0.4.233"}
orchestra {:mvn/version "2021.01.01-1"}}
:aliases
{:test/env
{:extra-paths ["src/test/clj"]
:extra-deps {}}}}
orchestra {:mvn/version "2021.01.01-1"}}}

View file

@ -1,7 +1,6 @@
(ns dda.devops-build.image
(:require [orchestra.core :refer [defn-spec]]
[babashka.tasks :as t]
[clojure.string :as str]
[dda.devops-build.devops :as d]
[dda.devops-build.devops.domain :as dd]
[dda.devops-build.image.domain :as domain]))

15
test-runner.clj Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bb
(require '[clojure.test :as t]
'[babashka.classpath :as cp])
(cp/add-classpath "src:test")
(require 'your.test-a 'your.test-b)
(def test-results
(t/run-tests 'your.test-a 'your.test-b))
(let [{:keys [fail error]} test-results]
(when (pos? (+ fail error))
(System/exit 1)))

38
tests.edn Normal file
View file

@ -0,0 +1,38 @@
#kaocha/v1
{:kaocha/tests
[{:kaocha.testable/id :unit
:kaocha.testable/type :kaocha.type/clojure.test
:kaocha/ns-patterns ["-test$"],
:kaocha/source-paths ["src/test/clj" "src/test/cljc"],
:kaocha/test-paths ["src/test/clj" "src/test/cljc"],
:kaocha.filter/skip-meta [:kaocha/skip]}
{:kaocha.testable/id :generative-fdef-checks
:kaocha.testable/type :kaocha.type/spec.test.check
:kaocha/source-paths ["src/main/clj" "src/main/cljc"]
:kaocha.spec.test.check/checks [{:kaocha.spec.test.check/syms :all-fdefs
:clojure.spec.test.check/instrument? true
:clojure.spec.test.check/check-asserts? true
:clojure.spec.test.check/opts {:num-tests 10}}]}
]
:kaocha/reporter [kaocha.report/documentation]
:kaocha/color? #profile {:default true
:ci false}
;; Run tests of file changes, unless running in CI server
:kaocha/watch #profile {:default true :ci false}
:kaocha/fail-fast? true
:kaocha.plugin.randomize/randomize? false
:kaocha/plugins
[:kaocha.plugin/randomize
:kaocha.plugin/filter
:kaocha.plugin/capture-output
:kaocha.plugin.alpha/spec-test-check]
:kaocha.plugin.capture-output/capture-output? true
}