Skip to content

Commit d8bbaf0

Browse files
Load dev dependencies from deps.edn in bb tests
https://github.com/cognitect-labs/aws-api/pull/273/files#r2248681227
1 parent fc6e29c commit d8bbaf0

File tree

2 files changed

+29
-45
lines changed

2 files changed

+29
-45
lines changed

bb.edn

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,4 @@
22
:tasks
33
{test-bb {:doc "Run Babashka tests"
44
:extra-paths ["src" "test/src" "test/resources"]
5-
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
6-
com.cognitect.aws/endpoints {:mvn/version "871.2.31.23"}
7-
com.cognitect.aws/autoscaling {:mvn/version "871.2.29.35"}
8-
com.cognitect.aws/ec2 {:mvn/version "871.2.31.23"}
9-
com.cognitect.aws/lambda {:mvn/version "871.2.31.23"}
10-
com.cognitect.aws/s3 {:mvn/version "871.2.31.23"}
11-
com.cognitect.aws/ssm {:mvn/version "871.2.31.23"}}
125
:task bb-test-runner/run-tests}}}

test/src/bb_test_runner.clj

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,41 @@
11
(ns bb-test-runner
22
(:require [clojure.test :as t]
3-
[cognitect.aws.api-test]
4-
[cognitect.aws.client.shared-test]
5-
[cognitect.aws.config-test]
6-
[cognitect.aws.credentials-test]
7-
[cognitect.aws.ec2-metadata-utils-test]
8-
[cognitect.aws.endpoint-test]
9-
[cognitect.aws.http-test]
10-
[cognitect.aws.http.java-test]
11-
[cognitect.aws.integration.error-codes-test]
12-
[cognitect.aws.integration.s3-test]
13-
[cognitect.aws.interceptors-test]
14-
[cognitect.aws.protocols-test]
15-
[cognitect.aws.protocols.rest-test]
16-
[cognitect.aws.region-test]
17-
[cognitect.aws.retry-test]
18-
[cognitect.aws.shape-test]
19-
[cognitect.aws.util-test]
20-
[cognitect.client.impl-test]))
3+
[clojure.edn :as edn]))
4+
5+
; Load dev dependencies from deps.edn
6+
(require '[babashka.deps :as deps])
7+
(deps/add-deps (edn/read-string (slurp "deps.edn"))
8+
{:aliases [:dev]})
219

2210
; NOTE: some tests won't run in babashka:
2311
; cognitect.aws.http.default-test - all reify instances start with `babashka.impl.reify`, test won't pass
2412
; cognitect.aws.signers-test - requires loading AWS SDK, which is not supported (no Java libs)
2513
; cognitect.client.test-double-test - test double not supported in babashka
14+
(def test-namespaces
15+
['cognitect.aws.api-test
16+
'cognitect.aws.client.shared-test
17+
'cognitect.aws.config-test
18+
'cognitect.aws.credentials-test
19+
'cognitect.aws.ec2-metadata-utils-test
20+
'cognitect.aws.endpoint-test
21+
'cognitect.aws.http-test
22+
'cognitect.aws.http.java-test
23+
'cognitect.aws.integration.error-codes-test
24+
'cognitect.aws.integration.s3-test
25+
'cognitect.aws.interceptors-test
26+
'cognitect.aws.protocols-test
27+
'cognitect.aws.protocols.rest-test
28+
'cognitect.aws.region-test
29+
'cognitect.aws.retry-test
30+
'cognitect.aws.shape-test
31+
'cognitect.aws.util-test
32+
'cognitect.client.impl-test])
2633

2734
(defn run-tests [& _args]
28-
(let [{:keys [fail error] :as a}
29-
(t/run-tests
30-
'cognitect.aws.api-test
31-
'cognitect.aws.client.shared-test
32-
'cognitect.aws.config-test
33-
'cognitect.aws.credentials-test
34-
'cognitect.aws.ec2-metadata-utils-test
35-
'cognitect.aws.endpoint-test
36-
'cognitect.aws.http-test
37-
'cognitect.aws.http.java-test
38-
'cognitect.aws.integration.error-codes-test
39-
'cognitect.aws.integration.s3-test
40-
'cognitect.aws.interceptors-test
41-
'cognitect.aws.protocols-test
42-
'cognitect.aws.protocols.rest-test
43-
'cognitect.aws.region-test
44-
'cognitect.aws.retry-test
45-
'cognitect.aws.shape-test
46-
'cognitect.aws.util-test
47-
'cognitect.client.impl-test)]
35+
(apply require test-namespaces)
36+
37+
(let [{:keys [fail error]}
38+
(apply t/run-tests test-namespaces)]
4839
(when (or (pos? fail)
4940
(pos? error))
5041
(System/exit 1))))

0 commit comments

Comments
 (0)