Skip to content

Commit b45298e

Browse files
[ci] Test against multiple nREPL versions
1 parent b9ff56f commit b45298e

File tree

4 files changed

+47
-23
lines changed

4 files changed

+47
-23
lines changed

.circleci/config.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ jobs:
137137
clojure_version:
138138
description: Version of Clojure to test against
139139
type: string
140+
nrepl_version:
141+
description: Version of nREPL to test against
142+
type: string
143+
default: "1.4"
140144
executor: << parameters.jdk_version >>
141145
environment:
142146
CLOJURE_VERSION: << parameters.clojure_version >>
143147
JDK_SRC_VERSION: << parameters.jdk_version >>
148+
NREPL_VERSION: << parameters.nrepl_version >>
144149
steps:
145150
- checkout
146151
- with_cache:
147-
cache_version: "test_v1_<< parameters.clojure_version >>_<< parameters.jdk_version >>"
152+
cache_version: "test_v1_<< parameters.clojure_version >>_<< parameters.jdk_version >>_<< parameters.nrepl_version >>"
148153
steps:
149154
- run:
150155
name: Running quick tests
@@ -209,12 +214,22 @@ workflows:
209214
clojure_version: ["1.12"]
210215
jdk_version: [jdk8, jdk25]
211216
<<: *run_always
217+
- test:
218+
# Test against multiple nREPL versions.
219+
matrix:
220+
alias: "nrepl-test"
221+
parameters:
222+
clojure_version: ["1.12"]
223+
jdk_version: [jdk25]
224+
nrepl_version: ["1.0", "1.3", "1.4"]
225+
<<: *run_always
212226
- lint:
213227
<<: *run_always
214228
- deploy:
215229
requires:
216230
- test
217231
- full-test
232+
- nrepl-test
218233
- lint
219234
filters:
220235
branches:

Makefile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33

44
# Set bash instead of sh for the @if [[ conditions,
55
# and use the usual safety flags:
6-
SHELL = /bin/bash -Ee
6+
SHELL = /bin/bash -Eex
77

88
CLOJURE_VERSION ?= 1.12
9+
NREPL_VERSION ?= 1.4
10+
COMMON_PROFILES = "+$(CLOJURE_VERSION),+nrepl-$(NREPL_VERSION)"
911
TEST_PROFILES ?= "-user,-dev,+test"
1012

1113
# We need Java sources to test Java parsing functionality, but the Docker images
@@ -39,42 +41,40 @@ target/srcdeps: project.clj
3941
# Remove cljfmt.main because it depends on tools.cli which we explicitly removed.
4042
rm -f target/srcdeps/cider/nrepl/inlined/deps/cljfmt/*/cljfmt/main.clj
4143

42-
test_impl: copy-sources-to-jdk
43-
lein with-profile $(TEST_PROFILES),+$(CLOJURE_VERSION) test
44+
quick-test: copy-sources-to-jdk
45+
lein with-profile $(COMMON_PROFILES),$(TEST_PROFILES) test
4446

4547
test: target/srcdeps
46-
@make test_impl TEST_PROFILES="$(TEST_PROFILES),+plugin.mranderson/config"
47-
48-
quick-test: test_impl
48+
lein with-profile $(COMMON_PROFILES),$(TEST_PROFILES),+plugin.mranderson/config test
4949

5050
eastwood:
51-
lein with-profile -user,-dev,+$(CLOJURE_VERSION),+deploy,+eastwood eastwood
51+
lein with-profile -user,-dev,$(COMMON_PROFILES),+deploy,+eastwood eastwood
5252

5353
cljfmt:
54-
lein with-profile -user,-dev,+$(CLOJURE_VERSION),+cljfmt cljfmt check
54+
lein with-profile -user,-dev,$(COMMON_PROFILES),+cljfmt cljfmt check
5555

5656
cljfmt-fix:
57-
lein with-profile -user,-dev,+$(CLOJURE_VERSION),+cljfmt cljfmt fix
57+
lein with-profile -user,-dev,$(COMMON_PROFILES),+cljfmt cljfmt fix
5858

5959
.make_kondo_prep: project.clj .clj-kondo/config.edn
60-
CIDER_NO_MRANDERSON="true" CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION) clj-kondo --copy-configs --dependencies --lint '$$classpath' > $@
60+
CIDER_NO_MRANDERSON="true" CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,$(COMMON_PROFILES) clj-kondo --copy-configs --dependencies --lint '$$classpath' > $@
6161

6262
kondo: .make_kondo_prep clean
63-
CIDER_NO_MRANDERSON="true" CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION) clj-kondo
63+
CIDER_NO_MRANDERSON="true" CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,$(COMMON_PROFILES) clj-kondo
6464

6565
lint: kondo cljfmt eastwood
6666

6767
# PROJECT_VERSION=x.y.z make install
6868
install: dump-version check-install-env target/srcdeps
69-
CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,+$(CLOJURE_VERSION),+plugin.mranderson/config install
69+
CIDER_NO_PEDANTIC="true" lein with-profile -user,-dev,$(COMMON_PROFILES),+plugin.mranderson/config install
7070

7171
# PROJECT_VERSION=x.y.z make fast-install
7272
fast-install: dump-version check-install-env
73-
lein with-profile -user,-dev,+$(CLOJURE_VERSION) install
73+
lein with-profile -user,-dev,$(COMMON_PROFILES) install
7474

7575
smoketest: install
7676
cd test/smoketest && \
77-
lein with-profile -user,-dev,+$(CLOJURE_VERSION) uberjar && \
77+
lein with-profile -user,-dev,$(COMMON_PROFILES) uberjar && \
7878
java -jar target/smoketest-0.1.0-SNAPSHOT-standalone.jar
7979

8080
# Deployment is performed via CI by creating a git tag prefixed with "v".
@@ -87,7 +87,7 @@ deploy: check-env target/srcdeps
8787
rm -f .no-mranderson
8888
export PROJECT_VERSION=$$(echo "$(CIRCLE_TAG)" | sed 's/^v//'); \
8989
echo "\"$$PROJECT_VERSION\"" > resources/cider/nrepl/version.edn; \
90-
lein with-profile -user,-dev,-provided,+$(CLOJURE_VERSION),+plugin.mranderson/config deploy clojars
90+
lein with-profile -user,-dev,-provided,$(COMMON_PROFILES),+plugin.mranderson/config deploy clojars
9191

9292
check-env:
9393
ifndef CLOJARS_USERNAME

project.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
:license {:name "Eclipse Public License"
2121
:url "http://www.eclipse.org/legal/epl-v10.html"}
2222
:scm {:name "git" :url "https://github.com/clojure-emacs/cider-nrepl"}
23-
:dependencies [[nrepl/nrepl "1.4.0" :exclusions [org.clojure/clojure]]
24-
[cider/orchard "0.37.0" :exclusions [org.clojure/clojure]]
23+
:dependencies [[cider/orchard "0.37.0" :exclusions [org.clojure/clojure]]
2524
^:inline-dep [compliment "0.7.1"]
2625
^:inline-dep [org.rksm/suitable "0.6.2" :exclusions [org.clojure/clojure
2726
org.clojure/clojurescript]]
@@ -78,15 +77,20 @@
7877
:password :env/clojars_password
7978
:sign-releases false}]]
8079

81-
:profiles {:provided {:dependencies [[org.clojure/clojure "1.12.2"]]}
80+
:profiles {:provided {:dependencies [[org.clojure/clojure "1.12.3"]
81+
[nrepl/nrepl "1.4.0" :exclusions [org.clojure/clojure]]]}
8282

8383
:1.10 {:dependencies [[org.clojure/clojure "1.10.3"]
8484
[org.clojure/clojurescript "1.10.520" :scope "provided"]]}
8585
:1.11 {:dependencies [[org.clojure/clojure "1.11.4"]
8686
[org.clojure/clojurescript "1.11.60" :scope "provided"]]}
87-
:1.12 {:dependencies [[org.clojure/clojure "1.12.2"]
87+
:1.12 {:dependencies [[org.clojure/clojure "1.12.3"]
8888
[org.clojure/clojurescript "1.12.42" :scope "provided"]]}
8989

90+
:nrepl-1.0 {:dependencies [[nrepl/nrepl "1.0.0" :exclusions [org.clojure/clojure]]]}
91+
:nrepl-1.3 {:dependencies [[nrepl/nrepl "1.3.0" :exclusions [org.clojure/clojure]]]}
92+
:nrepl-1.4 {:dependencies [[nrepl/nrepl "1.4.0" :exclusions [org.clojure/clojure]]]}
93+
9094
:maint {:source-paths ["src" "maint"]
9195
:dependencies [[org.clojure/tools.cli "1.2.245"]]}
9296

test/clj/cider/nrepl_test.clj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
(ns cider.nrepl-test
22
(:require
33
[cider.nrepl :as sut]
4-
[clojure.test :refer [deftest is testing]]))
4+
[clojure.test :refer [deftest is testing]]
5+
[nrepl.version]))
56

6-
(deftest clojure-version-sanity-check
7+
(deftest versions-sanity-check
78
(is (let [v (System/getenv "CLOJURE_VERSION")]
89
(println "Running on Clojure" (clojure-version))
9-
(or (nil? v) (.startsWith ^String (clojure-version) v)))))
10+
(or (nil? v) (.startsWith ^String (clojure-version) v))))
11+
(is (let [v (System/getenv "NREPL_VERSION")
12+
nver (:version-string nrepl.version/version)]
13+
(println "Running on nREPL" nver)
14+
(or (nil? v) (.startsWith ^String nver v)))))

0 commit comments

Comments
 (0)