Skip to content

Commit 7c61388

Browse files
authored
Version Promiscuity (#499)
* dev version of LRS with permissive versions * test for permissive versions * release of LRS lib * bind the right thing to prevent test error
1 parent a121cba commit 7c61388

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

deps.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
xyz.capybara/clamav-client {:mvn/version "2.1.2"}
5454
;; Yet Analytics deps
5555
com.yetanalytics/lrs
56-
{:mvn/version "1.4.0"
56+
{:mvn/version "1.4.2"
5757
:exclusions [org.clojure/clojure
5858
org.clojure/clojurescript
5959
com.yetanalytics/xapi-schema]}

src/test/lrsql/lrs_test.clj

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns lrsql.lrs-test
2-
(:require [clojure.test :refer [deftest testing is use-fixtures]]
2+
(:require [clojure.test :refer [deftest testing is use-fixtures are]]
33
[clojure.string :as cstr]
44
[clojure.walk :as walk]
55
[com.stuartsierra.component :as component]
@@ -8,7 +8,9 @@
88
[lrsql.test-support :as support]
99
[lrsql.test-constants :as tc]
1010
[lrsql.util :as u]
11-
[xapi-schema.spec :as xs]))
11+
[xapi-schema.spec :as xs]
12+
[babashka.curl :as curl]
13+
[cheshire.core :as json]))
1214

1315
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1416
;; Init Test Config
@@ -1447,3 +1449,28 @@
14471449
activity-prof-id-params)))
14481450

14491451
(component/stop sys')))
1452+
1453+
(deftest accept-version-test
1454+
(let [lrs (component/start (support/test-system))]
1455+
(testing "Accepts versions 1.0.0-1.0.3"
1456+
(try
1457+
(are [version-header
1458+
result-status]
1459+
(= result-status
1460+
(:status
1461+
(curl/post
1462+
"http://localhost:8080/xapi/statements"
1463+
{:basic-auth ["username" "password"]
1464+
:headers {"X-Experience-API-Version" version-header
1465+
"Content-Type" "application/json;"}
1466+
:body (json/generate-string test-statements)
1467+
:throw false})))
1468+
"0.9.5" 400
1469+
"1.0.0" 200
1470+
"1.0.1" 200
1471+
"1.0.2" 200
1472+
"1.0.3" 200
1473+
"1.0.4" 400
1474+
"2.0.0" 200)
1475+
(finally
1476+
(component/stop lrs))))))

0 commit comments

Comments
 (0)