use safer resolve-tilde-path to get to user Library on mac

--- src/overtone/sc/machinery/synthdef.clj
+++ src/overtone/sc/machinery/synthdef.clj
@@ -129,7 +129,7 @@
   "Returns a constructed path to a named synthdef on the current platform"
   [synth-name]
   (case (get-os)
-        :mac   (str "/Users/" (user-name) "/Library/Application Support/SuperCollider/synthdefs/" synth-name ".scsyndef")))
+    :mac   (str (resolve-tilde-path "~/Library/Application Support/SuperCollider/synthdefs/") synth-name ".scsyndef")))

 ; TODO: byte array shouldn't really be the default here, but I don't
 ; know how to test for one correctly... (byte-array? data) please?


added some dependencies

added some dependencies

--- cljx/plongeur-clj/project.clj
+++ cljx/plongeur-clj/project.clj
@@ -1,4 +1,15 @@
 (defproject plongeur-clj "0.1.0-SNAPSHOT"
-  :description "Plongeur CLJ"
-  :url "http://example.com/FIXME"
-  :dependencies [[org.clojure/clojure "1.8.0"]])
+
+  :description "Plongeur CLJ - the CLJ implementation."
+
+  :url "https://github.com/tmoerman/plongeur"
+
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [org.clojure/core.async "0.2.374"]
+                 [com.taoensso/sente "1.8.1"]
+                 [gorillalabs/sparkling "1.2.4"]
+
+                 ;; smile
+                 ;; breeze natives ?
+
+                 ])


STORM-1027: Apply overflow buffer to metric emit in bolt

--- storm-core/src/clj/backtype/storm/daemon/executor.clj
+++ storm-core/src/clj/backtype/storm/daemon/executor.clj
@@ -646,6 +646,15 @@
         {:keys [storm-conf component-id worker-context transfer-fn report-error sampler
                 open-or-prepare-was-called?]} executor-data
         rand (Random. (Utils/secureRandomLong))
+
+        ;; the overflow buffer is used to ensure that bolts do not block when emitting
+        ;; this ensures that the bolt can always clear the incoming messages, which
+        ;; prevents deadlock from occurs across the topology
+        ;; (e.g. Spout -> BoltA -> Splitter -> BoltB -> BoltA, and all
+        ;; buffers filled up)
+        ;; the overflow buffer is might gradually fill degrading the performance gradually
+        ;; eventually running out of memory, but at least prevent live-locks/deadlocks.
+        overflow-buffer (if (storm-conf TOPOLOGY-BOLTS-OUTGOING-OVERFLOW-BUFFER-ENABLE) (ConcurrentLinkedQueue.) nil)
         tuple-action-fn (fn [task-id ^TupleImpl tuple]
                           ;; synchronization needs to be done with a key provided by this bolt, otherwise:
                           ;; spout 1 sends synchronization (s1), dies, same spout restarts somewhere else, sends synchronization (s2) and incremental update. s2 and update finish before s1 -> lose the incremental update
@@ -670,7 +679,7 @@
                                       bolt-obj (:object task-data)]
                                   (when (instance? ICredentialsListener bolt-obj)
                                     (.setCredentials bolt-obj (.getValue tuple 0))))
-                              Constants/METRICS_TICK_STREAM_ID (metrics-tick executor-data (get task-datas task-id) tuple)
+                              Constants/METRICS_TICK_STREAM_ID (metrics-tick executor-data (get task-datas task-id) tuple overflow-buffer)
                               (let [task-data (get task-datas task-id)
                                     ^IBolt bolt-obj (:object task-data)
                                     user-context (:user-context task-data)
@@ -696,16 +705,7 @@
                                     (stats/bolt-execute-tuple! executor-stats
                                                                (.getSourceComponent tuple)
                                                                (.getSourceStreamId tuple)
-                                                               delta)))))))
-
-        ;; the overflow buffer is used to ensure that bolts do not block when emitting
-        ;; this ensures that the bolt can always clear the incoming messages, which
-        ;; prevents deadlock from occurs across the topology
-        ;; (e.g. Spout -> BoltA -> Splitter -> BoltB -> BoltA, and all
-        ;; buffers filled up)
-        ;; the overflow buffer is might gradually fill degrading the performance gradually
-        ;; eventually running out of memory, but at least prevent live-locks/deadlocks.
-        overflow-buffer (if (storm-conf TOPOLOGY-BOLTS-OUTGOING-OVERFLOW-BUFFER-ENABLE) (ConcurrentLinkedQueue.) nil)]
+                                                               delta)))))))]

     ;; TODO: can get any SubscribedState objects out of the context now


inc server version for latest changes

inc server version for latest changes

--- possibledb/project.clj
+++ possibledb/project.clj
@@ -1,5 +1,5 @@

-(defproject possibledb "0.1-1"
+(defproject possibledb "0.1-2"
   :description "PossibleDB is a Datomic Database Server clone built with DataScript, RethinkDB, Clojure, ClojureScript, and NodeJS."
   :url "http://github.com/runexec/PossibleDB"
   :dependencies [[org.clojure/clojure "1.6.0"]


commit to add user name on banner

commit to add user name on banner

--- src/stonecutter_client/view/voting.clj
+++ src/stonecutter_client/view/voting.clj
@@ -10,7 +10,7 @@

 (defn voting-page [request]
   (->> (vh/load-template "public/poll.html")
-       #_(set-user-name request)
+       (set-user-name request)
         html/emit*
        (apply str)))


Remove normal middleware, slow and noicy

--- modules/reitit-ring/src/reitit/ring/coercion.cljc
+++ modules/reitit-ring/src/reitit/ring/coercion.cljc
@@ -110,31 +110,6 @@
          [status (response-coercer coercion schema opts)])
        (into {})))

-(defn wrap-coerce-parameters
-  "Pluggable request coercion middleware.
-  Expects a :coercion of type `reitit.coercion.protocol/Coercion`
-  and :parameters from route data, otherwise will do nothing."
-  [handler]
-  (fn
-    ([request]
-     (let [method (:request-method request)
-           match (ring/get-match request)
-           parameters (-> match :result method :data :parameters)
-           coercion (-> match :data :coercion)]
-       (if (and coercion parameters)
-         (let [coercers (request-coercers coercion parameters)
-               coerced (coerce-parameters coercers request)]
-           (handler (impl/fast-assoc request :parameters coerced)))
-         (handler request))))
-    ([request respond raise]
-     (let [method (:request-method request)
-           match (ring/get-match request)
-           parameters (-> match :result method :data :parameters)
-           coercion (-> match :data :coercion)]
-       (if (and coercion parameters)
-         (let [coercers (request-coercers coercion parameters)
-               coerced (coerce-parameters coercers request)]
-           (handler (impl/fast-assoc request :parameters coerced) respond raise)))))))
 (defn handle-coercion-exception [e respond raise]
   (let [data (ex-data e)]
     (if-let [status (condp = (:type data)
@@ -167,34 +142,6 @@
                          ([request respond raise]
                           (let [coerced (coerce-request coercers request)]
                             (handler (impl/fast-assoc request :parameters coerced) respond raise))))))))}))
-
-(defn wrap-coerce-response
-  "Pluggable response coercion middleware.
-  Expects a :coercion of type `reitit.coercion.protocol/Coercion`
-  and :responses from route data, otherwise will do nothing."
-  [handler]
-  (fn
-    ([request]
-     (let [response (handler request)
-           method (:request-method request)
-           match (ring/get-match request)
-           responses (-> match :result method :data :responses)
-           coercion (-> match :data :coercion)
-           opts (-> match :data :opts)]
-       (if (and coercion responses)
-         (let [coercers (response-coercers coercion responses opts)]
-           (coerce-response coercers request response))
-         response)))
-    ([request respond raise]
-     (let [method (:request-method request)
-           match (ring/get-match request)
-           responses (-> match :result method :data :responses)
-           coercion (-> match :data :coercion)
-           opts (-> match :data :opts)]
-       (if (and coercion responses)
-         (let [coercers (response-coercers coercion responses opts)]
-           (handler request #(respond (coerce-response coercers request %))))
-         (handler request respond raise))))))

 (def gen-wrap-coerce-response
   "Middleware for pluggable response coercion.


Made sequential processing recursive.

Made sequential processing recursive.

--- src/blutwurst/tuple_formatter.clj
+++ src/blutwurst/tuple_formatter.clj
@@ -110,20 +110,22 @@

 (declare create-xml-elements-for-property)

-(defn- create-xml-element-for-pair [pair]
-  (let [tag-name (first pair)
-        content (second pair)]
+(defn- create-xml-element-for-pair [tag-name content]
   (cond
     (map? content)
       (xml/element tag-name nil (create-xml-elements-for-property content))
     (sequential? content)
-      (xml/element tag-name nil (map #(xml/element "item" nil %) content))
+      (xml/element tag-name
+                   nil
+                   (map create-xml-element-for-pair
+                        (repeat "item")
+                        content
+                   ))
     :else
-      (xml/element tag-name nil content))))
+      (xml/element tag-name nil content)))

 (defn- create-xml-elements-for-property [property]
-  (map  create-xml-element-for-pair ; TODO: make this recursive to handle complex and sequence
-       property))
+  (map  #(create-xml-element-for-pair (first %) (second %)) property))

 (defn- create-xml-elements-for-entity [entity]
   (let [top-level-name (-> entity :entity :name)]


Add appropriate warning signs

Add appropriate warning signs

--- src/caesium/crypto/scalarmult.clj
+++ src/caesium/crypto/scalarmult.clj
@@ -1,5 +1,8 @@
 (ns caesium.crypto.scalarmult
-  "Scalar multiplication."
   (:require [caesium.binding :refer [defconsts]]))
+  "**DANGER** This namespace consists of low-level details that you should
+  not use unless you know what you are doing.
+
+  Scalar multiplication."

 (defconsts [bytes scalarbytes primitive])


using with-defaults

using with-defaults

--- test/celestial/integration/vc.clj
+++ test/celestial/integration/vc.clj
@@ -4,12 +4,12 @@
      [hypervisors.networking :refer (clear-range initialize-networking)]
      [vc.vijava :refer (guest-status)]
      [celestial.fixtures.data :refer (redis-vc-spec)]
-     [celestial.fixtures.core :refer (with-conf)]
+     [celestial.fixtures.core :refer (with-defaults)]
      [celestial.model :refer (vconstruct)]
      [flatland.useful.map :refer (dissoc-in*)])
   (:use midje.sweet vc.provider vc.guest))

-(with-conf
+(with-defaults
   (with-state-changes [(before :facts (do (clear-range :vcenter) (initialize-networking)))]
     (fact "creating a virtualmachine" :integration :vcenter
       (let [vm (.create (vconstruct redis-vc-spec))]


All supported HTTP codes must be covered by tests

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -967,3 +967,30 @@
                      :headers {"Content-Type" "application/json"}
                      :body    "{\"response\":{\"deep\":{\"structure\":\"error\"}}}"})))))

+(deftest test-send-error-response-http-codes
+    "Check the function emender-jenkins.rest-api/send-error-response."
+    (testing "the function emender-jenkins.rest-api/send-error-response."
+        (let [request       {:configuration {:jenkins {:currently-building-view "Building"
+                                                      :jenkins-url "http://10.20.30.40:8080/"}}}
+              response      {:response :error}]
+              (are [x y] (= (send-error-response response request x) y)
+                  :ok
+                    {:status  200
+                     :headers {"Content-Type" "application/json"}
+                     :body    "{\"response\":\"error\"}"}
+                  :bad-request
+                    {:status  400
+                     :headers {"Content-Type" "application/json"}
+                     :body    "{\"response\":\"error\"}"}
+                  :not-found
+                    {:status  404
+                     :headers {"Content-Type" "application/json"}
+                     :body    "{\"response\":\"error\"}"}
+                  :internal-server-error
+                    {:status  500
+                     :headers {"Content-Type" "application/json"}
+                     :body    "{\"response\":\"error\"}"}
+                  :not-implemented
+                    {:status  501
+                     :headers {"Content-Type" "application/json"}
+                     :body    "{\"response\":\"error\"}"}))))


Basic test for function create-job

Basic test for function create-job

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -12,7 +12,8 @@

 (ns emender-jenkins.rest-api-test
   (:require [clojure.test :refer :all]
-            [emender-jenkins.rest-api :refer :all]))
+            [emender-jenkins.rest-api :refer :all]
+            [clj-jenkins-api.jenkins-api :as jenkins-api]))

 ;
 ; Common functions used by tests.
@@ -475,3 +476,28 @@
                     nil
                     ))))))

+(def create-job-postdata
+    "{\"name\":\"test-Test_Product-1.0-Test_Book-en-US (preview)\", \"ssh_url_to_repo\":\"https://url-to-repo.git\", \"branch\":\"master\"}")
+
+(def default-request
+    {:configuration
+        {:jobs
+            {:preview-test-jobs-suffix "(preview)"
+             :stage-test-jobs-suffix   "(stage)"
+             :prod-test-jobs-suffix    "(prod)"
+             :test-jobs-prefix         "test-"}}})
+
+(deftest test-create-job
+    "Check the function emender-jenkins.rest-api/create-job."
+    (testing "the function emender-jenkins.rest-api/create-job."
+        (with-redefs [jenkins-api/create-job (fn [jenkins-url jenkins-auth include-jenkins-reply? job-name git-repo branch credentials-id metadata-directory metadata]
+                                                 (jenkins-api/ok-response-structure job-name "create_job" include-jenkins-reply? "created"))
+                      jenkins-api/start-job  (fn [jenkins-url jenkins-auth include-jenkins-reply? job-name]
+                                                 (jenkins-api/ok-response-structure job-name "build" include-jenkins-reply? "added to queue"))
+                      read-request-body      (fn [request] create-job-postdata)
+                      reload-job-list        (fn [response request] response)
+                      send-response          (fn [response request] response)]
+                      (is (= (create-job default-request) {:status "ok"
+                                                           :jobName "test-Test_Product-1.0-Test_Book-en-US (preview)"
+                                                           :command "create_job"}))
+)))


Refactor find card fns

Refactor find card fns

--- src/clj/decktouch/mtg_card_master.clj
+++ src/clj/decktouch/mtg_card_master.clj
@@ -11,12 +11,16 @@
   (some? (re-matches (re-pattern (str "(?i)" query ".*"))
                     string)))

+(defn find-cards-matching-query-in-names [names query]
+  (let [match-query (partial match query)]
+    (map (fn [thing] (str thing))
+         (filter match-query names))))
+
 (defn get-cards-matching-query
   "Return a list of maps of strings of card names that match the query for the card input autocomplete"
   [query]
-  (let [match-query (partial match query)]
-    (map (fn [thing] (str thing))
-      (filter match-query card-names))))
+  (let [query-args (clojure.string/split query #"\s")]
+    (reduce find-cards-matching-query-in-names card-names query-args)))

 (defn get-card-info
   "Given a card name, return a map containing all the info for the card"


Make function private

Make function private

--- src/clj/rumahsewa141/routes/admin.clj
+++ src/clj/rumahsewa141/routes/admin.clj
@@ -8,7 +8,7 @@
             [rumahsewa141.views :refer [history-view]]
             [rumahsewa141.math :refer [parse-double]]))

-(defn do-to-selected [users f]
+(defn- do-to-selected [users f]
   (doall (map f (flatten (vector users)))))

 (defn update-registration-config [{{action :action} :params}]


remove redundant threading macro

remove redundant threading macro

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -204,11 +204,12 @@
   (when transaction
     (assoc transaction
            :items
-           (->> (select-transaction-items storage
-                                          {:transaction-id id
-                                           :transaction-date transaction-date}
-                                          {:sort [[:action :desc] [:amount :desc]]})
-                (mapv after-item-read)))))
+           (mapv after-item-read
+                 (select-transaction-items
+                   storage
+                   {:transaction-id id
+                    :transaction-date transaction-date}
+                   {:sort [[:action :desc] [:amount :desc]]})))))

 (defn- append-lot-items
   [transaction storage]


Use dotimes instead of doseq when appropriate

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -194,7 +194,7 @@
         zoom-factor (get-in @app [:zoom-factor])
         pixel-size zoom-factor
         sub-image-pixel-count (count (:image-data sub-image))]
-    (doseq [x (range 0 sub-image-pixel-count)]
+    (dotimes [x sub-image-pixel-count]
       (let [pix-x (* (mod x (:width sub-image)) pixel-size)
             pix-y (* (quot x (:width sub-image)) pixel-size)
             color (nth (:image-data sub-image) x)


working on having abstractions and specializations fill rules

--- src/clojure_dmap/phrasal_patterns.clj
+++ src/clojure_dmap/phrasal_patterns.clj
@@ -176,7 +176,7 @@
 			(doseq [rule (*phrasal-patterns-map* sym)]
 				(let [matched-sym (:slot-values (sym *completed-patterns*))
 					  matched-value  (rule :slot-values)
-						adv-rule (advance-pattern-concept rule  matched-sym)] ; FIX doesnt'w ork consistenly either
+						adv-rule (advance-pattern-concept rule  matched-sym)] ;
 					;(println "GEN:  matched-sym:" matched-sym (rule :frame))
 					(add-pattern adv-rule) ))))

@@ -194,13 +194,18 @@
 	(let [frames-list ( apply concat
 						(map (fn [ptn] (concat (get-abstractions ptn) (get-specializations ptn)))
 								(keys *completed-patterns*))) ]
+		(println "")
+		(println "completed:" (keys *completed-patterns*) " abs/spec:" frames-list )
+		(println "waiting keys:" (keys *phrasal-patterns-map*))
 		(doseq [sym frames-list]
+			(println "  attempting with:" sym)
 			(doseq [rule (*phrasal-patterns-map* sym)]
+				(println "    on rule named " (rule :frame) " waiting on " (nth (rule :tokens) (rule :token-index)) )
 				(let [matched-sym (:slot-values (sym *completed-patterns*))
 					  matched-value  (rule :slot-values)
-					  adv-rule (advance-pattern-concept rule matched-sym )] ; FIX
-					;(println "ADV:" sym matched-sym matched-value)
-					(cond adv-rule (add-pattern adv-rule))
+					  ;adv-rule (advance-pattern-concept rule matched-sym )] ; FIX
+					  adv-rule (advance-pattern-concept rule {sym nil} )] ; FIX
+					(cond rule (add-pattern rule))
 				))
 )))

@@ -218,6 +223,6 @@
 					(add-pattern x)
 				))
 				(propagate-advances)
-				;(propagate-advances-generalize)
+				(propagate-advances-generalize)
 			)))


Remove initial focus on email field as it doesn't work on longer landing pages (forces a scroll).

--- src/coming_soon/cljs/coming_soon.cljs
+++ src/coming_soon/cljs/coming_soon.cljs
@@ -103,11 +103,10 @@
   false) ; prevent the form from submitting on its own

 (defn init
-  "define the function to attach validate-email to the submit event of the form, focus on the email field"
+  "define the function to attach validate-email to the submit event of the form"
   []
   (log "ClojureScript is working... that's good.")
-  (bind $subscribe :submit validate-email-and-submit)
-  (.focus $email))
+  (bind $subscribe :submit validate-email-and-submit))

 ;; initialize once the HTML page has loaded
 (document-ready init)


More small tests for «pseudo-intents»

More small tests for «pseudo-intents»

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/tests/fca/implications.clj
+++ src/conexp/tests/fca/implications.clj
@@ -159,7 +159,9 @@
 (deftest test-pseudo-intents
   (with-testing-data [ctx (random-contexts 10 20)]
     (= (set (pseudo-intents ctx))
-       (set (map premise (stem-base ctx))))))
+       (set (map premise (stem-base ctx)))))
+  (is (empty? (pseudo-intents (adiag-context [0 1 2 3]))))
+  (is (empty? (pseudo-intents (adiag-context [nil true adiag-context])))))

 (deftest test-minimal-intersection-sets
   (let [minimal-intersection-sets @#'conexp.fca.implications/minimal-intersection-sets]


Added another enemy effect. Fixed level progression for level 3.

--- src/divergence/system/conditions.cljs
+++ src/divergence/system/conditions.cljs
@@ -16,6 +16,7 @@
                  0 no-condition
                  1 no-condition
                  2 button-condition
+                 3 no-condition
                  })

 (defn conditions


change default to not group jars

change default to not group jars

still need to add CLI args to toggle this

--- src/main/shadow/cljs/devtools/api.clj
+++ src/main/shadow/cljs/devtools/api.clj
@@ -494,7 +494,7 @@
         (io/file output-dir "bundle-info.edn")
         (core-ext/safe-pr-str bundle-info))

-      (snapshot/print-bundle-info-table bundle-info {:group-jars true}))
+      (snapshot/print-bundle-info-table bundle-info {:group-npm true}))

     :done
     ))


Refector web server to start using mount

--- src/madouc/core.clj
+++ src/madouc/core.clj
@@ -6,17 +6,12 @@
             [madouc.handlers :as app]
             [environ.core :refer [env]]
             [taoensso.timbre :as timbre]
-            [selmer.parser :refer [set-resource-path!]])
+            [selmer.parser :refer [set-resource-path!]]
+            [mount.core :as mount :refer [defstate]])
   (:gen-class))

-(defn stop-server
-  []
-  (timbre/info "Stopping server...")
-  (server/stop)
-  (timbre/info "Server stopped"))
-
-(defn wrap-with-dev
+(defn- wrap-with-dev
   [orig-ep]
   (if (= (env :madouc-env "dev"))
     (do
@@ -26,16 +21,30 @@
           wrap-stacktrace))
     orig-ep))

-(defn make-entrypoint
+(defn- make-entrypoint
   [handler]
   (-> handler
       logger/wrap-with-logger
       wrap-with-dev))

+(defn- start-server
+  []
+  (timbre/info "Starting server...")
+  (let [ep (make-entrypoint app/main-handler)]
+    (server/run ep)))
+
+(defn- stop-server
+  []
+  (timbre/info "Stopping server...")
+  (server/stop)
+  (timbre/info "Server stopped"))
+
+(defstate ^{:on-reload :noop} http-server
+  :start (start-server)
+  :stop (stop-server))
+
 (defn -main
   [& args]
-  (.addShutdownHook (Runtime/getRuntime) (Thread. #(stop-server)))
-  (timbre/info "Starting server...")
+  (.addShutdownHook (Runtime/getRuntime) (Thread. #(mount/stop)))
   (set-resource-path! (clojure.java.io/resource "templates"))
-  (let [ep (make-entrypoint app/main-handler)]
-    (server/run ep)))
+  (mount/start))


Comment out clj-stacktrace injection.

Comment out clj-stacktrace injection.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -8,5 +8,10 @@
                   ;[lein-autodoc "0.9.0"]
                   [lein-marginalia "0.7.0"]
                   [lein-noir "1.2.0"]]
+        ;:injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
+                                            ;'print-cause-trace)
+                           ;new (ns-resolve (doto 'clj-stacktrace.repl require)
+                                           ;'pst)]
+                       ;(alter-var-root orig (constantly @new)))]
         :vimclojure-opts {:repl true
                           :port 2113}}}


Pre: Add multistep upsert example.

Pre: Add multistep upsert example.

--- test/datomish/db_test.cljc
+++ test/datomish/db_test.cljc
@@ -214,6 +214,24 @@
                                                     [:db/add (d/id-literal :db.part/user -1) :name "Petr"]
                                                     [:db/add (d/id-literal :db.part/user -1) :age 36]])))))))

+(deftest-db test-multistep-upsert conn
+  (<? (d/<transact! conn test-schema))
+  ;; The upsert algorithm will first try to resolve -1, fail, and then allocate both -1 and -2.
+  (let [tx0 (<? (d/<transact! conn [{:db/id (d/id-literal :db.part/user -1) :name "Ivan" :email "@1"}
+                                    {:db/id (d/id-literal :db.part/user -2) :name "Petr" :friends (d/id-literal :db.part/user -1)}]))]
+
+    ;; Sanity checks that these are freshly allocated, not resolved.
+    (is (> (get (tempids tx0) -1) 1000))
+    (is (> (get (tempids tx0) -1) 1000))
+
+    ;; This time, we can resolve both, but we have to try -1, succeed, and then resolve -2.
+    (let [tx1 (<? (d/<transact! conn [{:db/id (d/id-literal :db.part/user -1) :name "Ivan" :email "@1"}
+                                      {:db/id (d/id-literal :db.part/user -2) :name "Petr" :friends (d/id-literal :db.part/user -1)}]))]
+
+      ;; Ensure these are resolved, not freshly allocated.
+      (is (= (tempids tx0)
+             (tempids tx1))))))
+
 (deftest-db test-map-upsert conn
   ;; Not having DB-as-value really hurts us here.  This test only works because all upserts
   ;; succeed on top of each other, so we never need to reset the underlying store.


fixing windows path bug

fixing windows path bug

--- support/src/figwheel/core.clj
+++ support/src/figwheel/core.clj
@@ -118,12 +118,16 @@
     (set (keep identity
                (mapcat keys [old-mtimes new-mtimes]))))))

+(defn norm-path [p]
+  (string/replace p  "\\" "/"))
+
 (defn resource-paths [{:keys [root resource-paths]}]
-  (mapv #(string/replace-first % (str root "/") "") resource-paths))
+  (mapv #(string/replace-first (norm-path %)
+                               (str (norm-path root) "/") "") resource-paths))

 (defn resource-paths-pattern-str [state]
-  (str "(" (string/join "|" (resource-paths state)) ")"
-        "/" (:http-server-root state)))
+  (str "(" (string/join "|" (resource-paths state)) ")/"
+       (:http-server-root state)))

 (def resource-paths-pattern (comp re-pattern resource-paths-pattern-str))


let the image be null for the author since the email users doesn't have one

--- src/open_company/resources/common.clj
+++ src/open_company/resources/common.clj
@@ -65,7 +65,7 @@
 (def Author {
   :name schema/Str
   :user-id schema/Str
-  :image schema/Str})
+  :image (schema/maybe schema/Str)})

 (def Section
   {(schema/optional-key :section-name) SectionName


Add contentype related test.

Add contentype related test.

--- test/catacumba/ring_tests.clj
+++ test/catacumba/ring_tests.clj
@@ -24,18 +24,18 @@
        ~@body
        (finally (.stop server#)))))

-;; (defn hello-world-rhandler
-;;   [request]
-;;   (println 111 request)
-;;   {:status 200
-;;    :headers {"content-type" "text/html"}
-;;    :body "hello world"})
-
-(defn echo-rhandler
+(defn echo-handler
   [request]
   {:status 200
    :headers {"request-map" (pr-str (dissoc request :body))}
    :body (:body request)})
+
+(defn content-type-handler
+  [content-type]
+  (fn [request]
+    {:status  200
+     :headers {"Content-Type" content-type}
+     :body    ""}))

 (defn read-request
   [response]
@@ -50,7 +50,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (deftest request-get
-  (with-ring-server echo-rhandler
+  (with-ring-server echo-handler
     (let [response (http/get base-url {:basic-auth ["user" "password"]})
           request-map (read-request response)]
       (is (= (:request-method request-map) :get))
@@ -58,21 +58,21 @@
              "Basic dXNlcjpwYXNzd29yZA==")))))

 (deftest request-post
-  (with-ring-server echo-rhandler
+  (with-ring-server echo-handler
     (let [response (http/post base-url {:body "foobar"})
           request-map (read-request response)]
       (is (= (:request-method request-map) :post))
       (is (= "foobar" (:body response))))))

 (deftest request-put
-  (with-ring-server echo-rhandler
+  (with-ring-server echo-handler
     (let [response (http/put base-url {:body "foobar"})
           request-map (read-request response)]
       (is (= (:request-method request-map) :put))
       (is (= "foobar" (:body response))))))

 (deftest request-translate
-  (with-ring-server echo-rhandler
+  (with-ring-server echo-handler
     (let [url (str base-url "/foo/bar/baz?surname=jones&age=123")
           response (http/post url {:body "hello"})]
       (is (= (:status response) 200))
@@ -89,3 +89,9 @@
         (is (= (:server-name request-map) "127.0.0.1"))
         (is (= (:server-port request-map) 5050))
         (is (= (:ssl-client-cert request-map) nil))))))
+
+(deftest custom-content-type
+  (with-ring-server (content-type-handler "text/plain;charset=UTF-16;version=1")
+    (let [response (http/get base-url)]
+      (is (= (get-in response [:headers "content-type"])
+             "text/plain;charset=UTF-16;version=1")))))


Test parse coercion in cheshire custom also

--- test/cheshire/test/custom.clj
+++ test/cheshire/test/custom.clj
@@ -147,3 +147,9 @@
 (deftest test-namespaced-keywords
   (is (= "{\"foo\":\"user/bar\"}"
          (json/encode {:foo :user/bar}))))
+
+(deftest test-array-coerce-fn
+  (is (= {"set" #{"a" "b"} "array" ["a" "b"]}
+         (json/decode
+          (json/encode {"set" #{"a" "b"} "array" ["a" "b"]}) false
+          (fn [field-name] (if (= "set" field-name) #{} []))))))


distinct method middleware test names

distinct method middleware test names

--- test/clj_http/client_test.clj
+++ test/clj_http/client_test.clj
@@ -23,8 +23,9 @@
     (is (= :val (:key echo)))
     (is (not (:request-method echo)))))

-(deftest method-pass
+(deftest method-apply
   (let [echo (method-client {:key :val :method :post})]
     (is (= :val (:key echo)))
     (is (= :post (:request-method echo)))
     (is (not (:method echo)))))
+


add test for request timing

add test for request timing

--- test/clj_http/test/client.clj
+++ test/clj_http/test/client.clj
@@ -441,3 +441,7 @@
            #(do (is (= {:headers {"accept" "application/json"}} %1))
                 {:headers {"Content-Type" "application/json"}}))
           {:headers {"Accept" "application/json"}}))))
+
+(deftest t-request-timing
+  (is (pos? (:request-time ((client/wrap-request-timing
+                             (fn [r] (Thread/sleep 15) r)) {})))))


splitting async tests

splitting async tests

since you can only really have one per deftest

--- test/deferst/system_test.cljc
+++ test/deferst/system_test.cljc
@@ -302,7 +302,8 @@
            (fn [_] (is (= @destructor-vals x-dvals))
              (done))))))))

-(deftest dependent-item-system-with-mixed-destructors
+(defn dependent-item-system-with-mixed-destructors-fixtures
+  []
   (let [destructor-vals (atom [])
         ff (fn [v] [v (fn [] (swap! destructor-vals conj v))])
         sb (s/system-builder [[:a identity {:a-arg [:foo]}]
@@ -312,6 +313,24 @@
         stop-sys (s/stop-system! sys)
         x-sysmap {:foo 10 :a {:a-arg 10} :b {:b-arg 10}}
         x-dvals [{:b-arg 10}]]
+    {:destructor-vals destructor-vals
+     :ff ff
+     :sb sb
+     :sys sys
+     :sysmap sysmap
+     :stop-sys stop-sys
+     :x-sysmap x-sysmap
+     :x-dvals x-dvals}))
+
+(deftest dependent-item-system-with-mixed-destructors-creation
+  (let [{destructor-vals :destructor-vals
+         ff :ff
+         b :sb
+         sys :sys
+         sysmap :sysmap
+         stop-sys :stop-sys
+         x-sysmap :x-sysmap
+         x-dvals :x-dvals} (dependent-item-system-with-mixed-destructors-fixtures)]

     (testing "dependent items are created"
       #?(:clj
@@ -323,7 +342,17 @@
           (p/then
            sysmap
            (fn [v] (is (= v x-sysmap))
-             (done))))))
+             (done))))))))
+
+(deftest dependent-item-system-with-mixed-destructors-destruction
+  (let [{destructor-vals :destructor-vals
+         ff :ff
+         b :sb
+         sys :sys
+         sysmap :sysmap
+         stop-sys :stop-sys
+         x-sysmap :x-sysmap
+         x-dvals :x-dvals} (dependent-item-system-with-mixed-destructors-fixtures)]

     (testing "dependent items were destroyed"
       #?(:clj


fixed test in reproject.

fixed test in reproject.

--- test/forma/reproject_test.clj
+++ test/forma/reproject_test.clj
@@ -1,12 +1,16 @@
 (ns forma.reproject-test
   (:use [forma.reproject] :reload)
-  (:use midje.sweet))
+  (:use midje.sweet
+        [forma.matrix.utils :only (rowcol->idx)]))

-(let [rain-indexer (wgs84-indexer "1000" 0.5 + + -90 0)]
-  (fact
-   "This is the only one I have so far... but we need to verify at
+(let [step 0.5
+      [width] (dimensions-for-step step)
+      rain-indexer (wgs84-indexer "1000" step + + -90 0)]
+  (facts
+    "This is the only one I have so far... but we need to verify at
 least one of these indices."
-   (rain-indexer 8 6 12 12) => 172569))
+    (rain-indexer 8 6 12 12) => [239 489]
+    (rowcol->idx width 239 489) => 172569))

 (fact (dimensions-for-step 0.5) => [720 360])
 (fact (fit-to-grid 0.5 + + -90 0 -42.1 0) => [95 0])


Fixed unterminated <h1> in demos index.html.

--- test/plugboard/demos/menu.clj
+++ test/plugboard/demos/menu.clj
@@ -20,16 +20,15 @@

 (defn render-page []
   (hiccup/html
-   [:h1 "Plugboard"
-    [:h2 "Main menu"]
-    [:ul
-     [:li [:a {:href "hello-world/"} "hello-world"]]
-     [:li [:a {:href "query-params/"} "query-params"]]
-     [:li [:a {:href "links/"} "links"]]
-     [:li [:a {:href "forms/"} "forms"]]
-     [:li [:a {:href "status-views/"} "status-views"]]
-     [:li [:a {:href "basic-auth/"} "basic-auth"]]
-     [:li [:a {:href "custom-auth/index.html"} "custom-auth"]]
-     ]
+   [:h1 "Plugboard"]
+   [:h2 "Main menu"]
+   [:ul
+    [:li [:a {:href "hello-world/"} "hello-world"]]
+    [:li [:a {:href "query-params/"} "query-params"]]
+    [:li [:a {:href "links/"} "links"]]
+    [:li [:a {:href "forms/"} "forms"]]
+    [:li [:a {:href "status-views/"} "status-views"]]
+    [:li [:a {:href "basic-auth/"} "basic-auth"]]
+    [:li [:a {:href "custom-auth/index.html"} "custom-auth"]]
     ]))


Add more tests.

Add more tests.

--- test/postal/client_tests.cljs
+++ test/postal/client_tests.cljs
@@ -2,7 +2,9 @@
   (:require [cljs.test :as t]
             [cats.core :as m]
             [promesa.core :as p]
-            [postal.client :as pc])
+            [postal.client :as pc]
+            [httpurr.errors :as e]
+            [httpurr.client :as http])
   (:import [goog.testing.net XhrIo]
            [goog.net]))

@@ -39,6 +41,41 @@
       (t/is (= (:uri req) (:url c)))
       (t/is (not (empty? (:headers req)))))))

+
+(t/deftest send-query-that-fails-with-timeout-spec
+  (t/async done
+    (let [c (pc/client "http://localhost/api")
+          r (pc/query c :users {:id 1})]
+      (p/catch r (fn [err]
+                   (t/is (= err e/timeout))
+                   (done))))
+    (let [xhr (raw-last-request)]
+      (.simulateTimeout xhr))))
+
+(t/deftest send-novelty-that-is-aborted-spec
+  (t/async done
+    (let [c (pc/client "http://localhost/api")
+          r (pc/query c :users {:id 1})]
+      (p/catch r (fn [err]
+                   (t/is (= err e/abort))
+                   (done)))
+      (http/abort! r))))
+
+(t/deftest send-novelty-and-recv-response-spec
+  (t/async done
+    (let [rframe (pc/encode {:type :response :data [1]})]
+      (let [c (pc/client "http://localhost/api")
+            r (pc/novelty c :users {:id 1})]
+        (p/then r (fn [{:keys [type data]}]
+                    (t/is (= type :response))
+                    (t/is (= data [1]))
+                    (done))))
+      (let [xhr (raw-last-request)
+            status 200
+            body rframe
+          headers #js {"Content-Type" "application/transit+json"}]
+        (.simulateResponse xhr status body headers)))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Initial Setup & Entry Point
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Add test to ensure that the problems key is populated

--- test/cljc/reitit/ring_coercion_test.cljc
+++ test/cljc/reitit/ring_coercion_test.cljc
@@ -95,7 +95,9 @@
                  (app valid-request))))

         (testing "invalid request"
-          (let [{:keys [status]} (app invalid-request)]
+          (let [{:keys [status body]} (app invalid-request)
+                problems (:problems body)]
+            (is (= 1 (count problems)))
             (is (= 400 status))))

         (testing "invalid response"


More tests, including some error conditions

--- test/com/stuartsierra/component_test.clj
+++ test/com/stuartsierra/component_test.clj
@@ -6,7 +6,8 @@
 (def ^:dynamic *log* nil)

 (defn- log [& args]
-  (set! *log* (conj *log* args)))
+  (when (thread-bound? #'*log*)
+    (set! *log* (conj *log* args))))

 (defn- ordering
   "Given an ordered collection of messages, returns a map from the
@@ -23,6 +24,9 @@

 (defn started? [component]
   (true? (::started? component)))
+
+(defn stopped? [component]
+  (false? (::started? component)))

 (defrecord ComponentA [state]
   component/Lifecycle
@@ -129,3 +133,39 @@
          'ComponentB.start 'ComponentC.start
          'ComponentC.start 'ComponentD.start
          'ComponentB.start 'ComponentD.start)))
+
+(deftest all-components-started
+  (let [system (component/start (system-1))]
+    (doseq [component (vals system)]
+      (is (started? component)))))
+
+(deftest all-components-stopped
+  (let [system (component/stop (component/start (system-1)))]
+    (doseq [component (vals system)]
+      (is (stopped? component)))))
+
+(deftest dependencies-satisfied
+  (let [system (component/start (component/start (system-1)))]
+    (are [keys] (started? (get-in system keys))
+         [:b :a]
+         [:c :a]
+         [:c :b]
+         [:d :my-c])))
+
+(defrecord ErrorStartComponentC [state a b]
+  component/Lifecycle
+  (start [this]
+    (throw (ex-info "Boom!" {:state state})))
+  (stop [this]
+    this))
+
+(defn error-start-c []
+  (component/using
+    (map->ErrorStartComponentC {:state (rand-int Integer/MAX_VALUE)})
+    [:a :b]))
+
+(deftest error-thrown-with-partial-system
+  (let [ex (try (component/start (assoc (system-1)
+                                   :c (error-start-c)))
+                (catch Exception e e))]
+    (is (started? (-> ex ex-data :system :b :a)))))


Fix fixed sim

Fix fixed sim

--- test/onyx/coordinator/sim_test_utils.clj
+++ test/onyx/coordinator/sim_test_utils.clj
@@ -78,9 +78,10 @@
       (let [coordinator (:coordinator components)
             sync (:sync components)
             payload (extensions/create sync :payload)
+            pulse (extensions/create sync :pulse)
             sync-spy (chan 1)
             status-spy (chan 1)]
-        (extensions/write-place sync peer payload)
+        (extensions/write-place sync peer {:pulse pulse :payload payload})
         (extensions/on-change sync payload #(>!! sync-spy %))

         (>!! (:born-peer-ch-head coordinator) peer)
@@ -96,7 +97,7 @@
             (<!! (timeout (gen/geometric (/ 1 (:model/mean-completion-time model)))))

             (let [next-payload (extensions/create sync :payload)]
-              (extensions/write-place sync peer next-payload)
+              (extensions/write-place sync peer {:pulse pulse :payload next-payload})
               (extensions/on-change sync next-payload #(>!! sync-spy %))
               (extensions/touch-place sync (:completion nodes))


♻ Remove unnecessary test-time constants

Why:
- Command handler tests do not need a specific time,
  but only process manager tests need it (so that they
  can assert the generated commands)

--- test/territory_bro/congregation_test.clj
+++ test/territory_bro/congregation_test.clj
@@ -178,16 +178,14 @@
 (deftest rename-congregation-test
   (let [cong-id (UUID. 0 1)
         user-id (UUID. 0 2)
-        test-time (Instant/ofEpochSecond 1)
-        injections {:now (constantly test-time)
-                    :check-permit (fn [_permit])}
+        injections {:check-permit (fn [_permit])}
         created-event {:event/type :congregation.event/congregation-created
                        :event/version 1
                        :congregation/id cong-id
                        :congregation/name "old name"
                        :congregation/schema-name ""}
         rename-command {:command/type :congregation.command/rename-congregation
-                        :command/time test-time
+                        :command/time (Instant/now)
                         :command/user user-id
                         :congregation/id cong-id
                         :congregation/name "new name"}
@@ -220,9 +218,7 @@
         admin-id (UUID. 0 2)
         new-user-id (UUID. 0 3)
         invalid-user-id (UUID. 0 4)
-        test-time (Instant/ofEpochSecond 1)
-        injections {:now (constantly test-time)
-                    :check-permit (fn [_permit])
+        injections {:check-permit (fn [_permit])
                     :user-exists? (fn [user-id]
                                     (= new-user-id user-id))}
         created-event {:event/type :congregation.event/congregation-created
@@ -231,7 +227,7 @@
                        :congregation/name ""
                        :congregation/schema-name ""}
         add-user-command {:command/type :congregation.command/add-user
-                          :command/time test-time
+                          :command/time (Instant/now)
                           :command/user admin-id
                           :congregation/id cong-id
                           :user/id new-user-id}
@@ -267,9 +263,7 @@
         admin-id (UUID. 0 2)
         target-user-id (UUID. 0 3)
         invalid-user-id (UUID. 0 4)
-        test-time (Instant/ofEpochSecond 1)
-        injections {:now (constantly test-time)
-                    :check-permit (fn [_permit])
+        injections {:check-permit (fn [_permit])
                     :user-exists? (fn [user-id]
                                     (= target-user-id user-id))}
         created-event {:event/type :congregation.event/congregation-created
@@ -288,7 +282,7 @@
                                   :user/id target-user-id
                                   :permission/id :PLACEHOLDER}
         set-user-permissions-command {:command/type :congregation.command/set-user-permissions
-                                      :command/time test-time
+                                      :command/time (Instant/now)
                                       :command/user admin-id
                                       :congregation/id cong-id
                                       :user/id target-user-id


Refactor execute-steps to easier distinguish the different functionalities

--- src/clj/lambdacd/execution/internal/execute_steps.clj
+++ src/clj/lambdacd/execution/internal/execute_steps.clj
@@ -94,23 +94,54 @@
     (map (partial replace-step-with-retrigger-mock retrigger-predicate) step-contexts)
     step-contexts))

+(defn- call-step-result-producer [step-result-producer]
+  (fn [step-contexts-and-steps args _]
+    (let [step-results (step-result-producer args step-contexts-and-steps)]
+      (reduce execution-util/merge-two-step-results step-results))))
+
+(defn- wrap-inheritance [handler unify-results-fn]
+  (fn [step-contexts-and-steps args ctx]
+    (let [subscription                  (event-bus/subscribe ctx :step-result-updated)
+          children-step-results-channel (->> subscription
+                                             (event-bus/only-payload)
+                                             (async/filter< (inherit-message-from-parent? ctx)))
+          _                             (process-inheritance (:result-channel ctx) children-step-results-channel unify-results-fn)
+          result                        (handler step-contexts-and-steps args ctx)]
+      (event-bus/unsubscribe ctx :step-result-updated subscription)
+      result)))
+
+
+(defn- add-kill-switch [is-killed]
+  (fn [[ctx step]]
+    [(assoc ctx :is-killed is-killed) step]))
+
+(defn- wrap-kill-handling [handler is-killed]
+  (fn [step-contexts-and-steps args ctx]
+    (handler (map (add-kill-switch is-killed) step-contexts-and-steps)
+             args
+             ctx)))
+
+(defn- wrap-retrigger-handling [handler retrigger-predicate]
+  (fn [step-contexts-and-steps args ctx]
+    (handler (add-retrigger-mocks retrigger-predicate ctx step-contexts-and-steps)
+             args
+             ctx)))
+
+(defn- wrap-filter-nil-steps [handler]
+  (fn [step-contexts-and-steps args ctx]
+    (handler (filter (fn [[_ step]] (not-nil? step)) step-contexts-and-steps)
+             args
+             ctx)))
+
 ; TODO: this should be in a namespace like lambdacd.execution.core?
 (defn execute-steps [steps args ctx & {:keys [step-result-producer is-killed unify-results-fn retrigger-predicate]
                                        :or   {step-result-producer (serial-step-result-producer)
                                               is-killed            (atom false)
                                               unify-results-fn     (unify-only-status status/successful-when-all-successful)
                                               retrigger-predicate  sequential-retrigger-predicate}}]
-  (let [unify-results-fn                   (or unify-results-fn )
-        steps                              (filter not-nil? steps)
-        base-ctx-with-kill-switch          (assoc ctx :is-killed is-killed)
-        subscription                       (event-bus/subscribe ctx :step-result-updated)
-        children-step-results-channel      (->> subscription
-                                                (event-bus/only-payload)
-                                                (async/filter< (inherit-message-from-parent? ctx)))
-        step-contexts                      (contexts-for-steps steps base-ctx-with-kill-switch)
-        _                                  (process-inheritance (:result-channel ctx) children-step-results-channel unify-results-fn)
-        step-contexts-with-retrigger-mocks (add-retrigger-mocks retrigger-predicate ctx step-contexts)
-        step-results                       (step-result-producer args step-contexts-with-retrigger-mocks)
-        result                             (reduce execution-util/merge-two-step-results step-results)]
-    (event-bus/unsubscribe ctx :step-result-updated subscription)
-    result))
+  (let [handler-chain (-> (call-step-result-producer step-result-producer)
+                          (wrap-inheritance unify-results-fn)
+                          (wrap-kill-handling is-killed)
+                          (wrap-retrigger-handling retrigger-predicate)
+                          (wrap-filter-nil-steps))]
+    (handler-chain (contexts-for-steps steps ctx) args ctx)))


updated test

updated test

--- server/test/gratefulplace/controllers/t_users.clj
+++ server/test/gratefulplace/controllers/t_users.clj
@@ -26,7 +26,7 @@
           :new-password "new-password"
           :new-password-confirmation "new-password"}
          (auth "joebob"))
-    => (contains {:status 401})))
+    => (contains {:status 400})))

 (facts "Users can update stuff"


Cleaning up tests - pulling out helpers.

--- test/ahnentafel/server/pages_test.clj
+++ test/ahnentafel/server/pages_test.clj
@@ -2,6 +2,30 @@
   (:require [ahnentafel.server.pages :refer :all])
   (:require [ahnentafel.gedcom.data :as data])
   (:require [clojure.test :refer :all]))
+
+(defn get-page [page & args]
+  (apply str (apply page
+                    {:version "x.x.x"
+                    :gedcom-file "/path/to/test.ged"
+                     :get-data (fn [] 'fake-data)}
+                    args)))
+
+(defmethod assert-expr 'page-contains? [msg form]
+  (let [text (nth form 1)
+        msg (or msg (str "Expected to find '" text "' on the page."))]
+    `(let [result# (.contains ~'page ~text)]
+       (do-report {:message ~msg :expected '~form :actual ~'page
+                   :type (if result# :pass :fail)}))))
+
+(defmethod assert-expr 'page-not-contains? [msg form]
+  (let [text (nth form 1)
+        msg (or msg (str "Expected not to find '" text "' on the page."))]
+    `(let [result# (.contains ~'page ~text)]
+       (do-report {:message ~msg :expected '~form :actual ~'page
+                   :type (if result# :fail :pass)}))))
+
+(defmacro are-on-page [& texts]
+  `(are [text] (~'page-contains? text) ~@texts))

 (deftest home-page-test
   (with-redefs [data/header (constantly {:number-of-records 23
@@ -14,24 +38,24 @@
                                          :encoding "ANSEL"
                                          :submitter {:xref "@I31@"
                                                      :name "Fred Smith"}})]
-    (let [page (apply str (home {:version "x.x.x"
-                                      :get-data (fn [] 'fake-data)
-                                      :file "/path/to/test.ged"}))]
-      (is (.contains page "<title>Ahnentafel</title>"))
-      (is (.contains page "23 records in test.ged."))
-      (is (.contains page "id=\"home-contents\""))
-      (is (.contains page "created by Author"))
-      (is (.contains page "for Recipient"))
-      (is (.contains page "on 13 SEP 2000"))
-      (is (.contains page "GEDCOM version 5.5.1 (LINEAGE-LINKED ANSEL)"))
-      (is (.contains page "Submitted by Fred Smith"))
-      (is (.contains page "x.x.x")))))
+    (let [page (get-page home)]
+      (are-on-page
+       "<title>Ahnentafel</title>"
+       "23 records in test.ged."
+       "id=\"home-contents\""
+       "created by Author"
+       "for Recipient"
+       "on 13 SEP 2000"
+       "GEDCOM version 5.5.1 (LINEAGE-LINKED ANSEL)"
+       "Submitted by Fred Smith"
+       "x.x.x"))))

 (deftest page-not-found-test
-  (let [page (apply str (not-found {:version "x.x.x"} {:uri "/unknown"}))]
-    (is (.contains page "<title>Ahnentafel</title>"))
-    (is (.contains page "/unknown not found."))
-    (is (.contains page "x.x.x"))))
+  (let [page (get-page not-found {:uri "/unknown"})]
+    (are-on-page
+     "<title>Ahnentafel</title>"
+     "/unknown not found."
+     "x.x.x")))

 (deftest record-page-test
   (testing "individual record - maximum data"
@@ -51,21 +75,21 @@
                        :family-as-child "@FAM1@"
                        :family-as-spouse "@FAM2@"
                        })]
-        (let [page (apply str (record {:get-data (fn [] 'fake-data)} "@I23@"))]
+        (let [page (get-page record "@I23@")]
           (is (= @trapped-query {:xref "@I23@"}))
-          (is (.contains page "INDIVIDUAL"))
-          (is (.contains page "Bob Smith (a.k.a. Robert Smith, The Guy from The Cure)"))
-          (is (.contains page "Sex: M"))
-          (is (.contains page "Born: 1 JAN 1970 00:00:00 near his mother"))
-          (is (.contains page "Died: 1 JAN 2000 00:00:00 graveside"))
-          (is (.contains page "Buried: 2 JAN 2000 00:00:00 6 feet under"))
-          (is (.contains page "Go To Family (where this person was a child)"))
-          (is (.contains page "Go To Family (where this person was a spouse)") page)))))
+          (are-on-page
+           "INDIVIDUAL"
+           "Bob Smith (a.k.a. Robert Smith, The Guy from The Cure)"
+           "Sex: M"
+           "Born: 1 JAN 1970 00:00:00 near his mother"
+           "Died: 1 JAN 2000 00:00:00 graveside"
+           "Buried: 2 JAN 2000 00:00:00 6 feet under"
+           "Go To Family (where this person was a child)"
+           "Go To Family (where this person was a spouse)")))))

   (testing "individual record - with parts missing"
     (with-redefs [data/find-record
                   (constantly {:type :individual})]
-      (let [page (apply str (record {:xref "@I23@" :get-data (constantly 'fake-data)}))]
-        (doseq [x '("Name" "Sex" "Born" "Died" "Buried" "Go To Family")]
-          (is (not (.contains page x))
-              (str "Should not find '" x "' on page.")))))))
+      (let [page (get-page record "@I23@")]
+        (are [text] (page-not-contains? text)
+             "Name" "Sex" "Born" "Died" "Buried" "Go To Family")))))


Test for NPE in job-name->version

Test for NPE in job-name->version

--- test/emender_jenkins/results_test.clj
+++ test/emender_jenkins/results_test.clj
@@ -221,6 +221,11 @@
             "unknown" (job-name->version "test-Red_Hat_Enterprise_Linux-6.beta-Book_Name_1-en-US (preview)")
             "unknown" (job-name->version "test-Red_Hat_Enterprise_Linux-Book_Name_1-en-US (preview)"))))

+(deftest test-job-name->version-3
+    "Check the emender-jenkins.results/job-name->version function."
+    (testing "the emender-jenkins.results/job-name->version function."
+        (is (= "unknown" (job-name->version nil)))))
+
 (deftest test-job-name->book-name-1
     "Check the emender-jenkins.results/job-name->book-name function."
     (testing "the emender-jenkins.results/job-name->book-name function."


Ditto

Ditto

--- src/clojure/clojurewerkz/cassaforte/multi/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/multi/cql.clj
@@ -1,5 +1,5 @@
 (ns clojurewerkz.cassaforte.multi.cql
-  "Key CQL operations interface, prepared statement implementation, convenience functions
+  "Main namespace for working with CQL, prepared statements. Convenience functions
    for key operations built on top of CQL. Includes versions of cassaforte.cql functions that
    take database as an explicit argument.


make-bursts

make-bursts

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@5957 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- clojure/sequence_generator.clj
+++ clojure/sequence_generator.clj
@@ -109,10 +109,21 @@
 (defn burst-valid [e1 e2]
   (and
     (zero? (:wait-time-ms e2))
-    (every? identity
-      (map #(% e1 e2)
-        [:exposure :position :slice :channel])))
-    (not (:autofocus e2)))
+    (let [k [:exposure :position :slice :channel]]
+      (= (select-keys e1 k) (select-keys e2 k)))
+    (not (:autofocus e2))))
+
+(defn make-bursts [events]
+  (let [e1 (first events)
+        ne (next events)
+        [run later] (split-with #(burst-valid e1 %) ne)]
+    (when e1
+      (if run
+        (lazy-cat (list (assoc e1 :task :init-burst))
+                (map #(assoc % :task :collect-burst) run)
+                (make-bursts later))
+        (lazy-cat (list e1) (make-bursts later))))))
+

 (defn generate-acq-sequence [settings]
   (let [{:keys [slices keep-shutter-open-channels keep-shutter-open-slices
@@ -124,6 +135,7 @@
       (process-channel-skip-frames)
       (process-use-autofocus use-autofocus autofocus-skip)
       (process-wait-time interval-ms)
+      (make-bursts)
       )))

 ; Testing:


Make the tests pass

Make the tests pass


Enable line wrapping in the editor

Enable line wrapping in the editor

--- frontend/src/faceboard/views/editor.cljs
+++ frontend/src/faceboard/views/editor.cljs
@@ -100,4 +100,5 @@
                               :lint              true
                               :smartIndent       true
                               :lineNumbers       true
+                              :lineWrapping      true
                               :viewportMargin:   Infinity}))))


ideas

ideas


Remove profiles.clj

Remove profiles.clj

--- profiles.clj
+++ profiles.clj
@@ -1,5 +0,0 @@
-{:uberjar {:aot [uxbox.frontend]}
- :playground
- {:source-paths ["dev"]
-  :main ^:skip-aot playground.core}
- }


CMR-3439 Fixes with-echo-system-token docstring

--- transmit-lib/src/cmr/transmit/config.clj
+++ transmit-lib/src/cmr/transmit/config.clj
@@ -122,7 +122,7 @@
   {:default mock-echo-system-token})

 (defn with-echo-system-token
-  "Returns context with mock-echo-system-token"
+  "Returns context map with ECHO system token assoc'ed under :token key."
   [context]
   (assoc context :token (echo-system-token)))


Fix bug; first paying for a :free plan used wrong container count.

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -448,7 +448,7 @@
                        {:data-success-text "Paid!",
                         :data-loading-text "Paying...",
                         :data-failed-text "Failed!",
-                        :on-click #(raise! owner [:new-plan-clicked {:containers selected-containers
+                        :on-click #(raise! owner [:new-plan-clicked {:containers selected-paid-containers
                                                                      :paid {:template (:id pm/default-template-properties)}
                                                                      :price new-total
                                                                      :description (str "$" new-total "/month, includes " (pluralize selected-containers "container"))}])}


:fire: Remove unused macro.

:fire: Remove unused macro.

--- frontend/src/uxbox/builtins/icons.clj
+++ frontend/src/uxbox/builtins/icons.clj
@@ -8,14 +8,6 @@
 (ns uxbox.builtins.icons
   (:require [rumext.alpha]))

-(defmacro inline-icon
-  [id]
-  (let [href (str "#icon-" (name id))]
-    `(rumext.alpha/html
-      [:svg {:width 500 :height 500}
-       [:use {:xlinkHref ~href}]])))
-
-
 (defmacro icon-xref
   [id]
   (let [href (str "#icon-" (name id))]


Wrapping static files for the local server with file-info so the mime-type is added

--- src/appengine_magic/core_local.clj
+++ src/appengine_magic/core_local.clj
@@ -3,7 +3,8 @@
 (use 'appengine-magic.local-env-helpers
      '[appengine-magic.servlet :only [servlet]]
      '[appengine-magic.swank :only [wrap-swank]]
-     '[ring.middleware.file :only [wrap-file]])
+     '[ring.middleware.file :only [wrap-file]]
+     '[ring.middleware.file-info :only [wrap-file-info]])

 (require '[clojure.string :as str]
          '[appengine-magic.jetty :as jetty]
@@ -39,7 +40,7 @@
     (let [#^String uri (:uri req)]
       (if (.startsWith uri "/WEB-INF")
           (app req)
-          ((wrap-file app war-root) req)))))
+          ((wrap-file-info (wrap-file app war-root)) req)))))

 (defmacro def-appengine-app [app-var-name handler & {:keys [war-root]}]