Skip to content

Commit 41d2f50

Browse files
authored
Decouple :dev :from :test profiles (#400)
enerally, test suites should be able to run without the :dev profile being activated.
1 parent e176116 commit 41d2f50

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,44 @@ clean:
77
rm -f .inline-deps
88

99
.inline-deps: clean
10-
lein with-profile -user,+$(VERSION) inline-deps
10+
lein with-profile -user,-dev,+$(VERSION) inline-deps
1111
touch .inline-deps
1212

1313
inline-deps: .inline-deps
1414

1515
fast-test: clean
16-
lein with-profile -user,+$(VERSION) test
16+
lein with-profile -user,-dev,+$(VERSION) test
17+
18+
quick-test: fast-test
1719

1820
test: .inline-deps
19-
lein with-profile -user,+$(VERSION),+plugin.mranderson/config test
21+
lein with-profile -user,-dev,+$(VERSION),+plugin.mranderson/config test
2022

2123
cljfmt:
22-
lein with-profile -user,+$(VERSION),+cljfmt cljfmt check
24+
lein with-profile -user,-dev,+$(VERSION),+cljfmt cljfmt check
2325

2426
cljfmt-fix:
25-
lein with-profile -user,+$(VERSION),+cljfmt cljfmt fix
27+
lein with-profile -user,-dev,+$(VERSION),+cljfmt cljfmt fix
2628

2729
eastwood:
28-
lein with-profile -user,+$(VERSION),+deploy,+eastwood eastwood
30+
lein with-profile -user,-dev,+$(VERSION),+deploy,+test,+eastwood eastwood
2931

3032
kondo:
31-
lein with-profile -dev,+$(VERSION),+clj-kondo run -m clj-kondo.main --lint src test
33+
lein with-profile -user,-dev,+$(VERSION),+clj-kondo run -m clj-kondo.main --lint src test
3234

3335

3436
# Deployment is performed via CI by creating a git tag prefixed with "v".
3537
# Please do not deploy locally as it skips various measures (particularly around mranderson).
3638
deploy: check-env .inline-deps
37-
lein with-profile -user,+$(VERSION),+plugin.mranderson/config deploy clojars
39+
lein with-profile -user,-dev,+$(VERSION),+plugin.mranderson/config deploy clojars
3840

3941
jar: .inline-deps
40-
lein with-profile -user,+$(VERSION),+plugin.mranderson/config jar
42+
lein with-profile -user,-dev,+$(VERSION),+plugin.mranderson/config jar
4143

4244
# Usage: PROJECT_VERSION=3.7.1 make install
4345
# PROJECT_VERSION is needed because it's not computed dynamically
4446
install: check-install-env .inline-deps
45-
LEIN_JVM_OPTS="-Dmranderson.internal.no-parallelism=true" lein with-profile -user,+$(VERSION),+plugin.mranderson/config install
47+
LEIN_JVM_OPTS="-Dmranderson.internal.no-parallelism=true" lein with-profile -user,-dev,+$(VERSION),+plugin.mranderson/config install
4648

4749
check-env:
4850
ifndef CLOJARS_USERNAME

project.clj

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,16 @@
4646
"https://oss.sonatype.org/content/repositories/snapshots"]]
4747
:dependencies [[org.clojure/clojure "1.12.0-master-SNAPSHOT"]
4848
[org.clojure/clojure "1.12.0-master-SNAPSHOT" :classifier "sources"]]}
49-
50-
:test {:dependencies [[print-foo "1.0.2"]]}
51-
:dev {:dependencies [[org.clojure/clojurescript "1.11.60"]
52-
[org.clojure/core.async "1.6.673" :exclusions [org.clojure/clojure org.clojure/tools.reader]]
53-
[cider/piggieback "0.5.3"]
54-
[commons-io/commons-io "2.13.0"]]
55-
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
56-
:jvm-opts ["-Dorchard.use-dynapath=false"]
57-
:java-source-paths ["java-test"]
58-
:resource-paths ["test-resources"
59-
"testproject/src"]
60-
:repositories [["snapshots" "https://oss.sonatype.org/content/repositories/snapshots"]]}
49+
:dev {}
50+
:test {:dependencies [[cider/piggieback "0.5.3"]
51+
[org.clojure/clojurescript "1.11.60"]
52+
[org.clojure/core.async "1.6.673" :exclusions [org.clojure/clojure org.clojure/tools.reader]]
53+
[commons-io/commons-io "2.13.0"]]
54+
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
55+
:jvm-opts ["-Dorchard.use-dynapath=false"]
56+
:resource-paths ["test-resources"
57+
"testproject/src"]
58+
:java-source-paths ["java-test"]}
6159
:cljfmt [:test
6260
{:plugins [[lein-cljfmt "0.9.2" :exclusions [org.clojure/clojure
6361
org.clojure/clojurescript]]]
@@ -76,7 +74,8 @@
7674
:add-linters [:performance :boxed-math]
7775
:config-files ["eastwood.clj"]}}
7876
:clj-kondo [:test
79-
{:dependencies [[clj-kondo "2022.06.22"]]}]
77+
{:dependencies [[clj-kondo "2022.06.22"]
78+
[com.fasterxml.jackson.core/jackson-core "2.13.3"]]}]
8079

8180
:deploy {:source-paths [".circleci/deploy"]}}
8281

0 commit comments

Comments
 (0)