From 68fb82b320eb69c53ced1465d92039d068190821 Mon Sep 17 00:00:00 2001 From: Milt Reder Date: Thu, 23 Jun 2022 11:11:19 -0400 Subject: [PATCH 01/13] hack to force JSON get --- src/lib/com/yetanalytics/xapipe/client.clj | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index 19c6eb3..16b6367 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -120,9 +120,10 @@ (def get-request-base {:headers {"x-experience-api-version" "1.0.3"} :method :get - :as :multipart/mixed + :as :json-string-keys ;; :json ;; :multipart/mixed :query-params {:ascending true - :attachments true}}) + ;; :attachments true + }}) (s/def ::more string?) ;; more link @@ -414,7 +415,7 @@ :response (let [{{consistent-through-h "X-Experience-API-Consistent-Through"} :headers - {{:keys [statements more]} :statement-result} + {:strs [statements more] :as statement-result} :body :keys [request-time]} resp ?last-stored (some-> statements @@ -430,7 +431,12 @@ (count statements) ?last-stored) (a/>! out-chan - ret)) + [tag (assoc resp :body {:attachments [] + :statement-result + (cond-> {:statements statements + } + (not-empty more) + (assoc :more more))})])) ;; Handle metrics (metrics/histogram reporter :xapipe/source-request-time From aef4bb0e8a0ad7b190ebdff483049b31b214edfd Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 07:51:02 -0400 Subject: [PATCH 02/13] wip toggle --- src/cli/com/yetanalytics/xapipe/cli.clj | 39 +++++++++++-------- .../com/yetanalytics/xapipe/cli/options.clj | 8 ++-- src/cli/com/yetanalytics/xapipe/main.clj | 5 +-- src/lib/com/yetanalytics/xapipe.clj | 20 ++++------ src/lib/com/yetanalytics/xapipe/client.clj | 25 ++++++------ src/lib/com/yetanalytics/xapipe/job.clj | 6 +-- .../com/yetanalytics/xapipe/job/config.clj | 8 ++-- 7 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/cli/com/yetanalytics/xapipe/cli.clj b/src/cli/com/yetanalytics/xapipe/cli.clj index 6bbeff6..3f0fe1e 100644 --- a/src/cli/com/yetanalytics/xapipe/cli.clj +++ b/src/cli/com/yetanalytics/xapipe/cli.clj @@ -132,6 +132,7 @@ "Actually execute a job, wrapping result Redef this when testing for cooler output" [store job client-opts reporter] + (clojure.pprint/pprint ["testing handle-job" store job client-opts reporter]) (try (let [_ (log/debugf "Running job %s" (:id job)) {:keys [states] @@ -143,8 +144,8 @@ (log/debugf "Adding shutdown hook for job %s" (:id job)) (.addShutdownHook (Runtime/getRuntime) (Thread. ^Runnable - (fn [] - (force-stop-job! stop states)))) + (fn [] + (force-stop-job! stop states)))) (let [_ (log/debugf "Waiting for job %s" (:id job)) {{:keys [status]} :state :as job-result} (-> states @@ -194,6 +195,7 @@ :statement-buffer-size [:statement-buffer-size] :batch-buffer-size [:batch-buffer-size] :batch-timeout [:batch-timeout] + :json-only? [:json-only] ;; Source LRS :source-batch-size [:source :batch-size] @@ -246,22 +248,25 @@ [{:keys [source-url target-url] :as options}] - (reduce-kv - (fn [m k v] - (if-let [path (get option-paths k)] - (if (= :filter (first path)) + (clojure.pprint/pprint ["initial opts" options]) + (let [config (reduce-kv + (fn [m k v] + (if-let [path (get option-paths k)] + (if (= :filter (first path)) ;; filters take collections - (if (not-empty v) - (assoc-in m path v) - m) + (if (not-empty v) + (assoc-in m path v) + m) ;; All other opts are scalar - (assoc-in m path v)) + (assoc-in m path v)) ;; ignore unknown - m)) - {:source {:request-config (parse-lrs-url source-url)} - :target {:request-config (parse-lrs-url target-url)} - :filter {}} - options)) + m)) + {:source {:request-config (parse-lrs-url source-url)} + :target {:request-config (parse-lrs-url target-url)} + :filter {}} + options) + _ (clojure.pprint/pprint ["processed config" config])] + config)) (s/fdef create-job :args (s/cat :options ::opts/all-options) @@ -393,8 +398,8 @@ (defn list-store-jobs [store] (doseq [[page batch] (->> (store/list-jobs store) - (partition-all 100) - (map-indexed vector))] + (partition-all 100) + (map-indexed vector))] (log/infof "Page %d%s" page (with-out-str diff --git a/src/cli/com/yetanalytics/xapipe/cli/options.clj b/src/cli/com/yetanalytics/xapipe/cli/options.clj index c8e44ef..3d32a20 100644 --- a/src/cli/com/yetanalytics/xapipe/cli/options.clj +++ b/src/cli/com/yetanalytics/xapipe/cli/options.clj @@ -54,12 +54,10 @@ `boolean? :else `string?) - arg-spec `#{ - ~(format "--%s" long-command-name) + arg-spec `#{~(format "--%s" long-command-name) ~@(if short-command [short-command] - []) - }] + [])}] `(list ;; actual key spec (s/def ~spec-kw @@ -282,6 +280,8 @@ :parse-fn #(Long/parseLong %) :validate [pos-int? "Must be a positive integer"] :default 200] + [nil "--json-only?" "Only operate in JSON statement mode for data transfer, ignoring Attachments/multipart" + :default false] ;; Filter options [nil "--template-profile-url URL" "Profile URL/location from which to apply statement template filters" :id :filter-template-profile-urls diff --git a/src/cli/com/yetanalytics/xapipe/main.clj b/src/cli/com/yetanalytics/xapipe/main.clj index 9069838..5287b65 100644 --- a/src/cli/com/yetanalytics/xapipe/main.clj +++ b/src/cli/com/yetanalytics/xapipe/main.clj @@ -41,8 +41,7 @@ Delete a Job: ?json-file :json-file ?json-out :json-out :as options} :options - :keys [summary]} (opts/args->options args) - ] + :keys [summary]} (opts/args->options args)] (if help? {:status 0 :message (str @@ -87,7 +86,7 @@ Delete a Job: job/upgrade-job (cond-> ;; If the user has requested force resume we clear - force-resume? + force-resume? (-> (update :state state/clear-errors) (update :state state/set-status :paused))) (job/reconfigure-job diff --git a/src/lib/com/yetanalytics/xapipe.clj b/src/lib/com/yetanalytics/xapipe.clj index 4054ad7..af84660 100644 --- a/src/lib/com/yetanalytics/xapipe.clj +++ b/src/lib/com/yetanalytics/xapipe.clj @@ -293,8 +293,7 @@ target-client-opts] :or {conn-mgr-opts {} source-client-opts {} - target-client-opts {} - }} :client-opts + target-client-opts {}}} :client-opts reporter :reporter :or {reporter (metrics/->NoopReporter)}}] (let [{:keys [id] @@ -313,7 +312,7 @@ target-backoff-opts :backoff-opts :as target-config} :target filter-config :filter - :keys [batch-timeout]} :config + :keys [batch-timeout json-only]} :config :as job-before} (update job :config config/ensure-defaults)] (case status-before @@ -382,6 +381,8 @@ ;; kwargs :backoff-opts source-backoff-opts + :json-only + json-only :conn-opts {:conn-mgr conn-mgr :http-client source-client} @@ -410,7 +411,7 @@ {:state (-> state-before (cond-> ;; If a job is paused, re-init - (= :paused (:status state-before)) + (= :paused (:status state-before)) (state/set-status :init)) (assoc :updated init-stamp))}) states-chan @@ -542,9 +543,7 @@ (log/infof "store result: %s" result))) (def stop-fn stop)) - (clojure.pprint/pprint (stop-fn)) - - ) + (clojure.pprint/pprint (stop-fn))) (comment ;; Same as above, but with redis as a store @@ -605,8 +604,7 @@ (let [result (a/ (if (not-empty ?more) ;; Using More Link - (-> get-request-base + (-> (get-request-base json-only) (assoc :url (format "%s%s" url-base ?more)) (dissoc :query-params)) - (-> get-request-base + (-> (get-request-base json-only) (assoc :url (format "%s%s/statements" url-base @@ -202,7 +203,7 @@ (format "multipart/mixed; boundary=%s" boundary)) (cond-> ;; support token if provided - (not-empty token) + (not-empty token) (assoc :oauth-token token) ;; support basic auth if provided (and (not-empty username) @@ -386,13 +387,14 @@ poll-interval & {:keys [backoff-opts conn-opts - reporter] + reporter + json-only] :or {reporter (metrics/->NoopReporter)}}] (let [backoff-opts (or backoff-opts {:budget 10000 :max-attempt 10}) init-req (get-request - config + (assoc config :json-only json-only) init-params)] (a/go (loop [req init-req @@ -433,8 +435,7 @@ (a/>! out-chan [tag (assoc resp :body {:attachments [] :statement-result - (cond-> {:statements statements - } + (cond-> {:statements statements} (not-empty more) (assoc :more more))})])) ;; Handle metrics @@ -451,7 +452,7 @@ more) (recur (get-request - config + (assoc config :json-only json-only) {} ;; has no effect with more more) next-since)) @@ -476,7 +477,7 @@ (a/ job (assoc :config config) (cond-> - (and - (:pattern filter-cfg) - (not (:pattern filter-state))) + (and + (:pattern filter-cfg) + (not (:pattern filter-state))) (assoc-in [:state :filter :pattern] {}))) (-> job (update :state diff --git a/src/lib/com/yetanalytics/xapipe/job/config.clj b/src/lib/com/yetanalytics/xapipe/job/config.clj index ceea43c..56e965d 100644 --- a/src/lib/com/yetanalytics/xapipe/job/config.clj +++ b/src/lib/com/yetanalytics/xapipe/job/config.clj @@ -87,7 +87,8 @@ statement-buffer-size batch-buffer-size batch-timeout - cleanup-buffer-size] + cleanup-buffer-size + json-only] :or {get-buffer-size 10 batch-timeout 200}}] @@ -114,6 +115,7 @@ :batch-buffer-size batch-buffer-size :batch-timeout batch-timeout :cleanup-buffer-size cleanup-buffer-size + :json-only json-only :source (-> source-config (assoc :batch-size get-batch-size @@ -121,8 +123,8 @@ :poll-interval poll-interval) (assoc-in [:get-params :limit] get-batch-size) (cond-> - ?since (update-in [:get-params :since] t/normalize-stamp) - ?until (update-in [:get-params :until] t/normalize-stamp))) + ?since (update-in [:get-params :since] t/normalize-stamp) + ?until (update-in [:get-params :until] t/normalize-stamp))) :target (assoc target-config :batch-size post-batch-size From afbb97f6409799d24e50e1d096e72178e601681b Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 07:55:37 -0400 Subject: [PATCH 03/13] cleanup --- src/cli/com/yetanalytics/xapipe/cli.clj | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cli/com/yetanalytics/xapipe/cli.clj b/src/cli/com/yetanalytics/xapipe/cli.clj index 3f0fe1e..9d6780a 100644 --- a/src/cli/com/yetanalytics/xapipe/cli.clj +++ b/src/cli/com/yetanalytics/xapipe/cli.clj @@ -132,7 +132,6 @@ "Actually execute a job, wrapping result Redef this when testing for cooler output" [store job client-opts reporter] - (clojure.pprint/pprint ["testing handle-job" store job client-opts reporter]) (try (let [_ (log/debugf "Running job %s" (:id job)) {:keys [states] @@ -248,7 +247,6 @@ [{:keys [source-url target-url] :as options}] - (clojure.pprint/pprint ["initial opts" options]) (let [config (reduce-kv (fn [m k v] (if-let [path (get option-paths k)] @@ -264,8 +262,7 @@ {:source {:request-config (parse-lrs-url source-url)} :target {:request-config (parse-lrs-url target-url)} :filter {}} - options) - _ (clojure.pprint/pprint ["processed config" config])] + options)] config)) (s/fdef create-job From 4a0926f0facb847c59330056bed5e730fb4cbe75 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 07:59:36 -0400 Subject: [PATCH 04/13] more cleanup --- src/cli/com/yetanalytics/xapipe/cli.clj | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/cli/com/yetanalytics/xapipe/cli.clj b/src/cli/com/yetanalytics/xapipe/cli.clj index 9d6780a..8f448ba 100644 --- a/src/cli/com/yetanalytics/xapipe/cli.clj +++ b/src/cli/com/yetanalytics/xapipe/cli.clj @@ -247,23 +247,22 @@ [{:keys [source-url target-url] :as options}] - (let [config (reduce-kv - (fn [m k v] - (if-let [path (get option-paths k)] - (if (= :filter (first path)) + (reduce-kv + (fn [m k v] + (if-let [path (get option-paths k)] + (if (= :filter (first path)) ;; filters take collections - (if (not-empty v) - (assoc-in m path v) - m) + (if (not-empty v) + (assoc-in m path v) + m) ;; All other opts are scalar - (assoc-in m path v)) + (assoc-in m path v)) ;; ignore unknown - m)) - {:source {:request-config (parse-lrs-url source-url)} - :target {:request-config (parse-lrs-url target-url)} - :filter {}} - options)] - config)) + m)) + {:source {:request-config (parse-lrs-url source-url)} + :target {:request-config (parse-lrs-url target-url)} + :filter {}} + options)) (s/fdef create-job :args (s/cat :options ::opts/all-options) From b41873aeab9b878c279e86e0a38d1a85912a82b0 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 10:36:23 -0400 Subject: [PATCH 05/13] changed to request config --- src/cli/com/yetanalytics/xapipe/cli.clj | 2 +- src/cli/com/yetanalytics/xapipe/cli/options.clj | 6 +++--- src/lib/com/yetanalytics/xapipe.clj | 4 +--- src/lib/com/yetanalytics/xapipe/client.clj | 10 +++++++--- src/lib/com/yetanalytics/xapipe/job/config.clj | 4 +--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cli/com/yetanalytics/xapipe/cli.clj b/src/cli/com/yetanalytics/xapipe/cli.clj index 8f448ba..8a1a671 100644 --- a/src/cli/com/yetanalytics/xapipe/cli.clj +++ b/src/cli/com/yetanalytics/xapipe/cli.clj @@ -194,7 +194,6 @@ :statement-buffer-size [:statement-buffer-size] :batch-buffer-size [:batch-buffer-size] :batch-timeout [:batch-timeout] - :json-only? [:json-only] ;; Source LRS :source-batch-size [:source :batch-size] @@ -202,6 +201,7 @@ :get-params [:source :get-params] :source-username [:source :request-config :username] :source-password [:source :request-config :password] + :json-only [:source :request-config :json-only] :source-auth-uri [:source :request-config :oauth-params :auth-uri] :source-client-id [:source :request-config :oauth-params :client-id] :source-client-secret [:source :request-config :oauth-params :client-secret] diff --git a/src/cli/com/yetanalytics/xapipe/cli/options.clj b/src/cli/com/yetanalytics/xapipe/cli/options.clj index 3d32a20..39e3a9c 100644 --- a/src/cli/com/yetanalytics/xapipe/cli/options.clj +++ b/src/cli/com/yetanalytics/xapipe/cli/options.clj @@ -249,7 +249,9 @@ v)) m)))] [nil "--source-username USERNAME" "Source LRS BASIC Auth username"] - [nil "--source-password PASSWORD" "Source LRS BASIC Auth password"]] + [nil "--source-password PASSWORD" "Source LRS BASIC Auth password"] + [nil "--json-only" "Only operate in JSON statement mode for data transfer, ignoring Attachments/multipart (for compatibility issues)" + :default false]] (concat (oauth-opts "source") (backoff-opts "source")))) @@ -280,8 +282,6 @@ :parse-fn #(Long/parseLong %) :validate [pos-int? "Must be a positive integer"] :default 200] - [nil "--json-only?" "Only operate in JSON statement mode for data transfer, ignoring Attachments/multipart" - :default false] ;; Filter options [nil "--template-profile-url URL" "Profile URL/location from which to apply statement template filters" :id :filter-template-profile-urls diff --git a/src/lib/com/yetanalytics/xapipe.clj b/src/lib/com/yetanalytics/xapipe.clj index af84660..08727b7 100644 --- a/src/lib/com/yetanalytics/xapipe.clj +++ b/src/lib/com/yetanalytics/xapipe.clj @@ -312,7 +312,7 @@ target-backoff-opts :backoff-opts :as target-config} :target filter-config :filter - :keys [batch-timeout json-only]} :config + :keys [batch-timeout]} :config :as job-before} (update job :config config/ensure-defaults)] (case status-before @@ -381,8 +381,6 @@ ;; kwargs :backoff-opts source-backoff-opts - :json-only - json-only :conn-opts {:conn-mgr conn-mgr :http-client source-client} diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index b5893e0..96b0dd2 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -39,6 +39,9 @@ (s/def ::username string?) (s/def ::password string?) +;; json-only mode support +(s/def ::json-only boolean?) + ;; token support (s/def ::token string?) @@ -48,6 +51,7 @@ :opt-un [::xapi-prefix ::username ::password + ::json-only ::token ::oauth/oauth-params])) @@ -394,7 +398,7 @@ {:budget 10000 :max-attempt 10}) init-req (get-request - (assoc config :json-only json-only) + config init-params)] (a/go (loop [req init-req @@ -452,7 +456,7 @@ more) (recur (get-request - (assoc config :json-only json-only) + config {} ;; has no effect with more more) next-since)) @@ -477,7 +481,7 @@ (a/ source-config (assoc :batch-size get-batch-size From 2867449a62d98dd4afbcc56b5dcac2c7a969d30b Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 11:10:18 -0400 Subject: [PATCH 06/13] first attempt at separate custom response processing --- src/lib/com/yetanalytics/xapipe/client.clj | 22 +++++---- .../yetanalytics/xapipe/client/json_only.clj | 48 +++++++++++++++++++ 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 src/lib/com/yetanalytics/xapipe/client/json_only.clj diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index 96b0dd2..f983d4d 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -8,11 +8,11 @@ [clojure.spec.gen.alpha :as sgen] [clojure.tools.logging :as log] [com.yetanalytics.xapipe.client.multipart-mixed :as multipart] + [com.yetanalytics.xapipe.client.json-only :as json-only] [com.yetanalytics.xapipe.client.oauth :as oauth] [com.yetanalytics.xapipe.metrics :as metrics] [com.yetanalytics.xapipe.util :as u] [xapi-schema.spec :as xs] - [xapi-schema.spec.resources :as xsr] [com.yetanalytics.xapipe.util.time :as t] [com.yetanalytics.xapipe.spec.common :as cspec]) (:import [org.apache.http.impl.client CloseableHttpClient] @@ -28,6 +28,16 @@ status) (update resp :body slurp)))) +;; Add json-only output coercion +(defmethod client/coerce-response-body :json-only + [_ {:keys [status] :as resp}] + (if (= 200 status) + (json-only/parse-response resp) + (do + (log/warnf "Received json response with non-200 status %d" + status) + (update resp :body slurp)))) + ;; Config needed for all requests (s/def ::url-base string?) @@ -124,7 +134,7 @@ (defn get-request-base [json-only?] {:headers {"x-experience-api-version" "1.0.3"} :method :get - :as (if json-only? :json :multipart/mixed) + :as (if json-only? :json-only :multipart/mixed) :query-params {:ascending true ;; :attachments true }}) @@ -421,7 +431,7 @@ :response (let [{{consistent-through-h "X-Experience-API-Consistent-Through"} :headers - {:strs [statements more] :as statement-result} + {{:keys [statements more]} :statement-result} :body :keys [request-time]} resp ?last-stored (some-> statements @@ -437,11 +447,7 @@ (count statements) ?last-stored) (a/>! out-chan - [tag (assoc resp :body {:attachments [] - :statement-result - (cond-> {:statements statements} - (not-empty more) - (assoc :more more))})])) + ret)) ;; Handle metrics (metrics/histogram reporter :xapipe/source-request-time diff --git a/src/lib/com/yetanalytics/xapipe/client/json_only.clj b/src/lib/com/yetanalytics/xapipe/client/json_only.clj new file mode 100644 index 0000000..8a76855 --- /dev/null +++ b/src/lib/com/yetanalytics/xapipe/client/json_only.clj @@ -0,0 +1,48 @@ +(ns com.yetanalytics.xapipe.client.json-only + "JSON-only statement response handling. Necessary over default JSON parsing + to shim attachments which will not exist" + (:require [cheshire.core :as json] + [clojure.java.io :as io] + [clojure.spec.alpha :as s] + [com.yetanalytics.xapipe.client.multipart-mixed :as mm]) + (:import + [java.io + InputStream + ByteArrayOutputStream])) + +(s/def ::body + (s/keys :req-un + [:xapi.statements.GET.response/statement-result + ::mm/attachments])) + +(s/fdef parse-json-body + :args (s/cat :input-stream #(instance? InputStream %)) + :ret ::body) + +(defn parse-json-body + "Return a statement result and any attachments found" + [^InputStream input-stream] + (let [_statement-headers (.readHeaders input-stream) + result-baos (new ByteArrayOutputStream)] + ;; write the body to the output stream + (.readBodyData input-stream result-baos) + ;; Return the statement result always + (let [ss-result + (with-open [r (io/reader (.toByteArray result-baos))] + (json/parse-stream r))] + {:attachments [] + :statement-result (reduce-kv + (fn [m k v] + (assoc m (keyword k) v)) + {} + ss-result)}))) + +(s/fdef parse-response + :args (s/cat :response map?) + :ret (s/keys :req-un [::body])) + +(defn parse-response + "Parse + close a json body" + [{:keys [body] + :as resp}] + (assoc resp :body (parse-json-body body))) From 47bf698d8e102047080373801ba7b217b9a48f05 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 13:41:28 -0400 Subject: [PATCH 07/13] redid with client coercer --- src/cli/com/yetanalytics/xapipe/main.clj | 1 + src/lib/com/yetanalytics/xapipe/client.clj | 4 +- .../yetanalytics/xapipe/client/json_only.clj | 43 +++++-------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/cli/com/yetanalytics/xapipe/main.clj b/src/cli/com/yetanalytics/xapipe/main.clj index 5287b65..a0767b5 100644 --- a/src/cli/com/yetanalytics/xapipe/main.clj +++ b/src/cli/com/yetanalytics/xapipe/main.clj @@ -145,6 +145,7 @@ Delete a Job: :message (format "Wrote job %s to %s" job-id ?json-out)}) :else (do + (log/infof (if new? "Starting job %s" diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index f983d4d..62a1ff6 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -30,9 +30,9 @@ ;; Add json-only output coercion (defmethod client/coerce-response-body :json-only - [_ {:keys [status] :as resp}] + [req {:keys [status] :as resp}] (if (= 200 status) - (json-only/parse-response resp) + (json-only/parse-response req resp) (do (log/warnf "Received json response with non-200 status %d" status) diff --git a/src/lib/com/yetanalytics/xapipe/client/json_only.clj b/src/lib/com/yetanalytics/xapipe/client/json_only.clj index 8a76855..bcf7f7b 100644 --- a/src/lib/com/yetanalytics/xapipe/client/json_only.clj +++ b/src/lib/com/yetanalytics/xapipe/client/json_only.clj @@ -1,48 +1,27 @@ (ns com.yetanalytics.xapipe.client.json-only "JSON-only statement response handling. Necessary over default JSON parsing to shim attachments which will not exist" - (:require [cheshire.core :as json] - [clojure.java.io :as io] + (:require [clj-http.client :as http-client] [clojure.spec.alpha :as s] - [com.yetanalytics.xapipe.client.multipart-mixed :as mm]) - (:import - [java.io - InputStream - ByteArrayOutputStream])) + [com.yetanalytics.xapipe.client.multipart-mixed :as mm])) (s/def ::body (s/keys :req-un [:xapi.statements.GET.response/statement-result ::mm/attachments])) -(s/fdef parse-json-body - :args (s/cat :input-stream #(instance? InputStream %)) - :ret ::body) - -(defn parse-json-body - "Return a statement result and any attachments found" - [^InputStream input-stream] - (let [_statement-headers (.readHeaders input-stream) - result-baos (new ByteArrayOutputStream)] - ;; write the body to the output stream - (.readBodyData input-stream result-baos) - ;; Return the statement result always - (let [ss-result - (with-open [r (io/reader (.toByteArray result-baos))] - (json/parse-stream r))] - {:attachments [] - :statement-result (reduce-kv - (fn [m k v] - (assoc m (keyword k) v)) - {} - ss-result)}))) - (s/fdef parse-response :args (s/cat :response map?) :ret (s/keys :req-un [::body])) (defn parse-response "Parse + close a json body" - [{:keys [body] - :as resp}] - (assoc resp :body (parse-json-body body))) + [req resp] + (let [{:keys [body]} (http-client/coerce-json-body req resp false)] + (assoc resp :body {:attachments [] + :statement-result + (reduce-kv + (fn [m k v] + (assoc m (keyword k) v)) + {} + body)}))) From f4d2960ccaff8bd5d9bb9b58022da4dbcf8f88f1 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Fri, 11 Aug 2023 16:54:12 -0400 Subject: [PATCH 08/13] attachments query bug --- src/lib/com/yetanalytics/xapipe/client.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index 62a1ff6..a4f48b0 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -136,8 +136,7 @@ :method :get :as (if json-only? :json-only :multipart/mixed) :query-params {:ascending true - ;; :attachments true - }}) + :attachments (not json-only?)}}) (s/def ::more string?) ;; more link From f8043585487226bfec3e1857db38800aa6d6691d Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Mon, 14 Aug 2023 15:04:13 -0400 Subject: [PATCH 09/13] most tests passing --- .../yetanalytics/xapipe/cli/options_test.clj | 18 +++++++++++++----- src/test/com/yetanalytics/xapipe/cli/other.edn | 1 + src/test/com/yetanalytics/xapipe/cli/thing.edn | 1 + .../com/yetanalytics/xapipe/cli/thing2.edn | 2 ++ src/test/com/yetanalytics/xapipe/main_test.clj | 7 +++++-- 5 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 src/test/com/yetanalytics/xapipe/cli/other.edn create mode 100644 src/test/com/yetanalytics/xapipe/cli/thing.edn create mode 100644 src/test/com/yetanalytics/xapipe/cli/thing2.edn diff --git a/src/test/com/yetanalytics/xapipe/cli/options_test.clj b/src/test/com/yetanalytics/xapipe/cli/options_test.clj index 9581a92..689d534 100644 --- a/src/test/com/yetanalytics/xapipe/cli/options_test.clj +++ b/src/test/com/yetanalytics/xapipe/cli/options_test.clj @@ -57,6 +57,7 @@ :source-poll-interval 1000, :get-params {}, :source-backoff-budget 10000, + :json-only false :source-backoff-max-attempt 10} nil @@ -66,6 +67,7 @@ :source-poll-interval 1000, :get-params {}, :source-backoff-budget 10000, + :json-only false :source-backoff-max-attempt 10} ["Failed to validate \"--source-batch-size 0\": Must be a positive integer"] @@ -80,6 +82,7 @@ :get-params {:since "2021-10-26T17:51:06.530464Z" :related_agents true}, :source-backoff-budget 10000, + :json-only false :source-backoff-max-attempt 10} nil)) @@ -129,6 +132,7 @@ :target-backoff-budget 10000, :force-resume false, :redis-prefix "xapipe", + :json-only false :storage :file, :get-buffer-size 10, :target-batch-size 50, @@ -157,9 +161,11 @@ :cleanup-buffer-size 50, :source {:request-config - {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, + {:url-base "http://0.0.0.0:8080", + :xapi-prefix "/xapi" + :json-only false}, :batch-size 50, - :backoff-opts {:budget 10000, :max-attempt 10}, + :backoff-opts {:budget 10000, :max-attempt 10} :poll-interval 1000, :get-params {:limit 50}}, :target @@ -215,6 +221,7 @@ "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" + "--json-only" "false" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" @@ -275,6 +282,7 @@ :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, + :json-only false, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, @@ -291,15 +299,15 @@ :metrics-reporter "prometheus" :prometheus-push-gateway "localhost:1234" :filter-ensure-paths [[["id"]]] - :filter-match-paths [[[["verb"]["id"]] + :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com" "objectType" "Agent"}]] :filter-concept-profile-urls ["http://example.org/profile.jsonld"] :filter-concept-types ["Verb"] - :filter-activity-type-ids [ "http://example.org/profile.jsonld#activity-type"] + :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"] :filter-verb-ids ["http://example.org/profile.jsonld#verb"] - :filter-attachment-usage-types [ "http://example.org/profile.jsonld#aut"] + :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"] :cleanup-buffer-size 1} []) (testing "no defaults" diff --git a/src/test/com/yetanalytics/xapipe/cli/other.edn b/src/test/com/yetanalytics/xapipe/cli/other.edn new file mode 100644 index 0000000..d3ab75c --- /dev/null +++ b/src/test/com/yetanalytics/xapipe/cli/other.edn @@ -0,0 +1 @@ +{:clojure.spec.alpha/problems ({:path [:args :common :help :arg], :pred #{"--help" "-h"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :job-id :arg], :pred #{"--job-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-timeout :arg], :pred #{"--conn-timeout"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-threads :arg], :pred #{"--conn-threads"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-default-per-route :arg], :pred #{"--conn-default-per-route"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-insecure? :arg], :pred #{"--conn-insecure?"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-io-thread-count :arg], :pred #{"--conn-io-thread-count"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :show-job :arg], :pred #{"--show-job"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :list-jobs :arg], :pred #{"--list-jobs"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :delete-job :arg], :pred #{"--delete-job"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :force-resume :arg], :pred #{"--force-resume" "-f"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json :arg], :pred #{"--json"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-file :arg], :pred #{"--json-file"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-out :arg], :pred #{"--json-out"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :storage :arg], :pred #{"--storage" "-s"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-uri :arg], :pred #{"--redis-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-prefix :arg], :pred #{"--redis-prefix"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :file-store-dir :arg], :pred #{"--file-store-dir"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :metrics-reporter :arg], :pred #{"--metrics-reporter"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :prometheus-push-gateway :arg], :pred #{"--prometheus-push-gateway"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :source :source-url :arg], :pred #{"--source-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-batch-size :arg], :pred #{"--source-batch-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-poll-interval :arg], :pred #{"--source-poll-interval"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :get-params :arg], :pred #{"--xapi-get-param" "-p"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-username :arg], :pred #{"--source-username"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-password :arg], :pred #{"--source-password"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :json-only :arg], :pred #{"--json-only"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-auth-uri :arg], :pred #{"--source-auth-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-id :arg], :pred #{"--source-client-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-secret :arg], :pred #{"--source-client-secret"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-scope :arg], :pred #{"--source-scope"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-token :arg], :pred #{"--source-token"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-budget :arg], :pred #{"--source-backoff-budget"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-max-attempt :arg], :pred #{"--source-backoff-max-attempt"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-j-range :arg], :pred #{"--source-backoff-j-range"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-initial :arg], :pred #{"--source-backoff-initial"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :target :target-url :arg], :pred #{"--target-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-batch-size :arg], :pred #{"--target-batch-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-username :arg], :pred #{"--target-username"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-password :arg], :pred #{"--target-password"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-auth-uri :arg], :pred #{"--target-auth-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-id :arg], :pred #{"--target-client-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-secret :arg], :pred #{"--target-client-secret"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-scope :arg], :pred #{"--target-scope"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-token :arg], :pred #{"--target-token"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-budget :arg], :pred #{"--target-backoff-budget"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-max-attempt :arg], :pred #{"--target-backoff-max-attempt"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-j-range :arg], :pred #{"--target-backoff-j-range"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-initial :arg], :pred #{"--target-backoff-initial"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :job :get-buffer-size :arg], :pred #{"--get-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-timeout :arg], :pred #{"--batch-timeout"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-profile-urls :arg], :pred #{"--template-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-ids :arg], :pred #{"--template-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-profile-urls :arg], :pred #{"--pattern-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-ids :arg], :pred #{"--pattern-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-ensure-paths :arg], :pred #{"--ensure-path"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-match-paths :arg], :pred #{"--match-path"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-profile-urls :arg], :pred #{"--concept-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-types :arg], :pred #{"--concept-type"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-activity-type-ids :arg], :pred #{"--activity-type-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-verb-ids :arg], :pred #{"--verb-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-attachment-usage-types :arg], :pred #{"--attachment-usage-type"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :statement-buffer-size :arg], :pred #{"--statement-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-buffer-size :arg], :pred #{"--batch-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :cleanup-buffer-size :arg], :pred #{"--cleanup-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2510 0x4cd64557 "clojure.spec.alpha$regex_spec_impl$reify__2510@4cd64557"], :clojure.spec.alpha/value (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "false" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/fn com.yetanalytics.xapipe.cli.options/args->options, :clojure.spec.alpha/args (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "false" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "options_test.clj", :line 186, :var-scope com.yetanalytics.xapipe.cli.options-test/fn--50260}} \ No newline at end of file diff --git a/src/test/com/yetanalytics/xapipe/cli/thing.edn b/src/test/com/yetanalytics/xapipe/cli/thing.edn new file mode 100644 index 0000000..aa3b3e2 --- /dev/null +++ b/src/test/com/yetanalytics/xapipe/cli/thing.edn @@ -0,0 +1 @@ +{:clojure.spec.alpha/problems ({:path [:args :common :help :arg], :pred #{"--help" "-h"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :job-id :arg], :pred #{"--job-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-timeout :arg], :pred #{"--conn-timeout"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-threads :arg], :pred #{"--conn-threads"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-default-per-route :arg], :pred #{"--conn-default-per-route"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-insecure? :arg], :pred #{"--conn-insecure?"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-io-thread-count :arg], :pred #{"--conn-io-thread-count"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :show-job :arg], :pred #{"--show-job"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :list-jobs :arg], :pred #{"--list-jobs"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :delete-job :arg], :pred #{"--delete-job"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :force-resume :arg], :pred #{"--force-resume" "-f"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json :arg], :pred #{"--json"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-file :arg], :pred #{"--json-file"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-out :arg], :pred #{"--json-out"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :storage :arg], :pred #{"--storage" "-s"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-uri :arg], :pred #{"--redis-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-prefix :arg], :pred #{"--redis-prefix"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :file-store-dir :arg], :pred #{"--file-store-dir"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :metrics-reporter :arg], :pred #{"--metrics-reporter"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :prometheus-push-gateway :arg], :pred #{"--prometheus-push-gateway"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :source :source-url :arg], :pred #{"--source-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-batch-size :arg], :pred #{"--source-batch-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-poll-interval :arg], :pred #{"--source-poll-interval"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :get-params :arg], :pred #{"--xapi-get-param" "-p"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-username :arg], :pred #{"--source-username"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-password :arg], :pred #{"--source-password"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :json-only :arg], :pred #{"--json-only"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-auth-uri :arg], :pred #{"--source-auth-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-id :arg], :pred #{"--source-client-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-secret :arg], :pred #{"--source-client-secret"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-scope :arg], :pred #{"--source-scope"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-token :arg], :pred #{"--source-token"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-budget :arg], :pred #{"--source-backoff-budget"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-max-attempt :arg], :pred #{"--source-backoff-max-attempt"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-j-range :arg], :pred #{"--source-backoff-j-range"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-initial :arg], :pred #{"--source-backoff-initial"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :target :target-url :arg], :pred #{"--target-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-batch-size :arg], :pred #{"--target-batch-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-username :arg], :pred #{"--target-username"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-password :arg], :pred #{"--target-password"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-auth-uri :arg], :pred #{"--target-auth-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-id :arg], :pred #{"--target-client-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-secret :arg], :pred #{"--target-client-secret"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-scope :arg], :pred #{"--target-scope"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-token :arg], :pred #{"--target-token"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-budget :arg], :pred #{"--target-backoff-budget"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-max-attempt :arg], :pred #{"--target-backoff-max-attempt"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-j-range :arg], :pred #{"--target-backoff-j-range"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-initial :arg], :pred #{"--target-backoff-initial"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :job :get-buffer-size :arg], :pred #{"--get-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-timeout :arg], :pred #{"--batch-timeout"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-profile-urls :arg], :pred #{"--template-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-ids :arg], :pred #{"--template-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-profile-urls :arg], :pred #{"--pattern-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-ids :arg], :pred #{"--pattern-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-ensure-paths :arg], :pred #{"--ensure-path"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-match-paths :arg], :pred #{"--match-path"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-profile-urls :arg], :pred #{"--concept-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-types :arg], :pred #{"--concept-type"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-activity-type-ids :arg], :pred #{"--activity-type-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-verb-ids :arg], :pred #{"--verb-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-attachment-usage-types :arg], :pred #{"--attachment-usage-type"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :statement-buffer-size :arg], :pred #{"--statement-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-buffer-size :arg], :pred #{"--batch-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :cleanup-buffer-size :arg], :pred #{"--cleanup-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2510 0x1266199c "clojure.spec.alpha$regex_spec_impl$reify__2510@1266199c"], :clojure.spec.alpha/value (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "true" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/fn com.yetanalytics.xapipe.cli.options/args->options, :clojure.spec.alpha/args (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "true" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "options_test.clj", :line 184, :var-scope com.yetanalytics.xapipe.cli.options-test/fn--50260}} diff --git a/src/test/com/yetanalytics/xapipe/cli/thing2.edn b/src/test/com/yetanalytics/xapipe/cli/thing2.edn new file mode 100644 index 0000000..8d93064 --- /dev/null +++ b/src/test/com/yetanalytics/xapipe/cli/thing2.edn @@ -0,0 +1,2 @@ +expected: (= {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file json-job, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json json-job, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only false, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"} opts) + actual: (not (= {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only false, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"} {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only true, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"})) \ No newline at end of file diff --git a/src/test/com/yetanalytics/xapipe/main_test.clj b/src/test/com/yetanalytics/xapipe/main_test.clj index eeedf4d..2b40d3f 100644 --- a/src/test/com/yetanalytics/xapipe/main_test.clj +++ b/src/test/com/yetanalytics/xapipe/main_test.clj @@ -94,7 +94,8 @@ {:request-config {:url-base (format "http://0.0.0.0:%s" (:port source)), - :xapi-prefix "/xapi"}, + :xapi-prefix "/xapi" + :json-only false}, :get-params {:since "2021-10-25T15:05:00.537746000Z", :until "2021-10-25T15:05:32.595885000Z", @@ -186,6 +187,7 @@ {:request-config {:url-base (format "http://0.0.0.0:%d" (:port source)), + :json-only false :xapi-prefix "/xapi"}, :get-params {:since "2021-10-25T15:05:00.537746000Z", @@ -359,7 +361,8 @@ :source {:request-config {:url-base (format "http://0.0.0.0:%d" - (:port source)), :xapi-prefix "/xapi"}, + (:port source)), :xapi-prefix "/xapi" + :json-only false}, :get-params {:since "2021-10-25T15:05:00.537746000Z", :until "2021-10-25T15:05:32.595885000Z", From 430385696450de9401e52e1bd58644ce978cdce2 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Mon, 14 Aug 2023 15:05:40 -0400 Subject: [PATCH 10/13] extraneous test files --- src/test/com/yetanalytics/xapipe/cli/other.edn | 1 - src/test/com/yetanalytics/xapipe/cli/thing.edn | 1 - src/test/com/yetanalytics/xapipe/cli/thing2.edn | 2 -- 3 files changed, 4 deletions(-) delete mode 100644 src/test/com/yetanalytics/xapipe/cli/other.edn delete mode 100644 src/test/com/yetanalytics/xapipe/cli/thing.edn delete mode 100644 src/test/com/yetanalytics/xapipe/cli/thing2.edn diff --git a/src/test/com/yetanalytics/xapipe/cli/other.edn b/src/test/com/yetanalytics/xapipe/cli/other.edn deleted file mode 100644 index d3ab75c..0000000 --- a/src/test/com/yetanalytics/xapipe/cli/other.edn +++ /dev/null @@ -1 +0,0 @@ -{:clojure.spec.alpha/problems ({:path [:args :common :help :arg], :pred #{"--help" "-h"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :job-id :arg], :pred #{"--job-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-timeout :arg], :pred #{"--conn-timeout"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-threads :arg], :pred #{"--conn-threads"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-default-per-route :arg], :pred #{"--conn-default-per-route"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-insecure? :arg], :pred #{"--conn-insecure?"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-io-thread-count :arg], :pred #{"--conn-io-thread-count"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :show-job :arg], :pred #{"--show-job"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :list-jobs :arg], :pred #{"--list-jobs"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :delete-job :arg], :pred #{"--delete-job"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :force-resume :arg], :pred #{"--force-resume" "-f"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json :arg], :pred #{"--json"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-file :arg], :pred #{"--json-file"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-out :arg], :pred #{"--json-out"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :storage :arg], :pred #{"--storage" "-s"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-uri :arg], :pred #{"--redis-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-prefix :arg], :pred #{"--redis-prefix"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :file-store-dir :arg], :pred #{"--file-store-dir"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :metrics-reporter :arg], :pred #{"--metrics-reporter"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :prometheus-push-gateway :arg], :pred #{"--prometheus-push-gateway"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :source :source-url :arg], :pred #{"--source-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-batch-size :arg], :pred #{"--source-batch-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-poll-interval :arg], :pred #{"--source-poll-interval"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :get-params :arg], :pred #{"--xapi-get-param" "-p"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-username :arg], :pred #{"--source-username"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-password :arg], :pred #{"--source-password"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :json-only :arg], :pred #{"--json-only"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-auth-uri :arg], :pred #{"--source-auth-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-id :arg], :pred #{"--source-client-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-secret :arg], :pred #{"--source-client-secret"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-scope :arg], :pred #{"--source-scope"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-token :arg], :pred #{"--source-token"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-budget :arg], :pred #{"--source-backoff-budget"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-max-attempt :arg], :pred #{"--source-backoff-max-attempt"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-j-range :arg], :pred #{"--source-backoff-j-range"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-initial :arg], :pred #{"--source-backoff-initial"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :target :target-url :arg], :pred #{"--target-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-batch-size :arg], :pred #{"--target-batch-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-username :arg], :pred #{"--target-username"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-password :arg], :pred #{"--target-password"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-auth-uri :arg], :pred #{"--target-auth-uri"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-id :arg], :pred #{"--target-client-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-secret :arg], :pred #{"--target-client-secret"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-scope :arg], :pred #{"--target-scope"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-token :arg], :pred #{"--target-token"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-budget :arg], :pred #{"--target-backoff-budget"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-max-attempt :arg], :pred #{"--target-backoff-max-attempt"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-j-range :arg], :pred #{"--target-backoff-j-range"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-initial :arg], :pred #{"--target-backoff-initial"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :job :get-buffer-size :arg], :pred #{"--get-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-timeout :arg], :pred #{"--batch-timeout"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-profile-urls :arg], :pred #{"--template-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-ids :arg], :pred #{"--template-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-profile-urls :arg], :pred #{"--pattern-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-ids :arg], :pred #{"--pattern-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-ensure-paths :arg], :pred #{"--ensure-path"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-match-paths :arg], :pred #{"--match-path"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-profile-urls :arg], :pred #{"--concept-profile-url"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-types :arg], :pred #{"--concept-type"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-activity-type-ids :arg], :pred #{"--activity-type-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-verb-ids :arg], :pred #{"--verb-id"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-attachment-usage-types :arg], :pred #{"--attachment-usage-type"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :statement-buffer-size :arg], :pred #{"--statement-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-buffer-size :arg], :pred #{"--batch-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :cleanup-buffer-size :arg], :pred #{"--cleanup-buffer-size"}, :val "false", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2510 0x4cd64557 "clojure.spec.alpha$regex_spec_impl$reify__2510@4cd64557"], :clojure.spec.alpha/value (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "false" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/fn com.yetanalytics.xapipe.cli.options/args->options, :clojure.spec.alpha/args (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "false" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "options_test.clj", :line 186, :var-scope com.yetanalytics.xapipe.cli.options-test/fn--50260}} \ No newline at end of file diff --git a/src/test/com/yetanalytics/xapipe/cli/thing.edn b/src/test/com/yetanalytics/xapipe/cli/thing.edn deleted file mode 100644 index aa3b3e2..0000000 --- a/src/test/com/yetanalytics/xapipe/cli/thing.edn +++ /dev/null @@ -1 +0,0 @@ -{:clojure.spec.alpha/problems ({:path [:args :common :help :arg], :pred #{"--help" "-h"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :job-id :arg], :pred #{"--job-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-timeout :arg], :pred #{"--conn-timeout"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-threads :arg], :pred #{"--conn-threads"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-default-per-route :arg], :pred #{"--conn-default-per-route"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-insecure? :arg], :pred #{"--conn-insecure?"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :conn-io-thread-count :arg], :pred #{"--conn-io-thread-count"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :show-job :arg], :pred #{"--show-job"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :list-jobs :arg], :pred #{"--list-jobs"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :delete-job :arg], :pred #{"--delete-job"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :force-resume :arg], :pred #{"--force-resume" "-f"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json :arg], :pred #{"--json"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-file :arg], :pred #{"--json-file"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :json-out :arg], :pred #{"--json-out"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :storage :arg], :pred #{"--storage" "-s"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-uri :arg], :pred #{"--redis-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :redis-prefix :arg], :pred #{"--redis-prefix"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :file-store-dir :arg], :pred #{"--file-store-dir"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :metrics-reporter :arg], :pred #{"--metrics-reporter"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :common :prometheus-push-gateway :arg], :pred #{"--prometheus-push-gateway"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/common-options-args], :in [0 46]} {:path [:args :source :source-url :arg], :pred #{"--source-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-batch-size :arg], :pred #{"--source-batch-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-poll-interval :arg], :pred #{"--source-poll-interval"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :get-params :arg], :pred #{"--xapi-get-param" "-p"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-username :arg], :pred #{"--source-username"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-password :arg], :pred #{"--source-password"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :json-only :arg], :pred #{"--json-only"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-auth-uri :arg], :pred #{"--source-auth-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-id :arg], :pred #{"--source-client-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-client-secret :arg], :pred #{"--source-client-secret"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-scope :arg], :pred #{"--source-scope"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-token :arg], :pred #{"--source-token"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-budget :arg], :pred #{"--source-backoff-budget"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-max-attempt :arg], :pred #{"--source-backoff-max-attempt"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-j-range :arg], :pred #{"--source-backoff-j-range"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :source :source-backoff-initial :arg], :pred #{"--source-backoff-initial"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/source-options-args], :in [0 46]} {:path [:args :target :target-url :arg], :pred #{"--target-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-batch-size :arg], :pred #{"--target-batch-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-username :arg], :pred #{"--target-username"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-password :arg], :pred #{"--target-password"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-auth-uri :arg], :pred #{"--target-auth-uri"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-id :arg], :pred #{"--target-client-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-client-secret :arg], :pred #{"--target-client-secret"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-scope :arg], :pred #{"--target-scope"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-token :arg], :pred #{"--target-token"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-budget :arg], :pred #{"--target-backoff-budget"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-max-attempt :arg], :pred #{"--target-backoff-max-attempt"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-j-range :arg], :pred #{"--target-backoff-j-range"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :target :target-backoff-initial :arg], :pred #{"--target-backoff-initial"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/target-options-args], :in [0 46]} {:path [:args :job :get-buffer-size :arg], :pred #{"--get-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-timeout :arg], :pred #{"--batch-timeout"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-profile-urls :arg], :pred #{"--template-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-template-ids :arg], :pred #{"--template-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-profile-urls :arg], :pred #{"--pattern-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-pattern-ids :arg], :pred #{"--pattern-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-ensure-paths :arg], :pred #{"--ensure-path"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-match-paths :arg], :pred #{"--match-path"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-profile-urls :arg], :pred #{"--concept-profile-url"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-concept-types :arg], :pred #{"--concept-type"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-activity-type-ids :arg], :pred #{"--activity-type-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-verb-ids :arg], :pred #{"--verb-id"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :filter-attachment-usage-types :arg], :pred #{"--attachment-usage-type"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :statement-buffer-size :arg], :pred #{"--statement-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :batch-buffer-size :arg], :pred #{"--batch-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]} {:path [:args :job :cleanup-buffer-size :arg], :pred #{"--cleanup-buffer-size"}, :val "true", :via [:com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/all-args :com.yetanalytics.xapipe.cli.options/job-options-args], :in [0 46]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2510 0x1266199c "clojure.spec.alpha$regex_spec_impl$reify__2510@1266199c"], :clojure.spec.alpha/value (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "true" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/fn com.yetanalytics.xapipe.cli.options/args->options, :clojure.spec.alpha/args (["--help" "--job-id" "foo" "--conn-timeout" "1" "--conn-threads" "1" "--conn-default-per-route" "1" "--conn-insecure?" "--conn-io-thread-count" "1" "--show-job" "--list-jobs" "--delete-job" "foo" "--force-resume" "--json" "{\"id\":\"foo\",\"config\":{\"get-buffer-size\":10,\"statement-buffer-size\":500,\"batch-buffer-size\":10,\"batch-timeout\":200,\"source\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8080\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10},\"poll-interval\":1000,\"get-params\":{\"limit\":50}},\"target\":{\"request-config\":{\"url-base\":\"http://0.0.0.0:8081\",\"xapi-prefix\":\"/xapi\"},\"batch-size\":50,\"backoff-opts\":{\"budget\":10000,\"max-attempt\":10}},\"filter\":{}},\"state\":{\"status\":\"init\",\"cursor\":\"1970-01-01T00:00:00.000000000Z\",\"source\":{\"errors\":[]},\"target\":{\"errors\":[]},\"errors\":[],\"filter\":{}}}\n" "--json-file" "dev-resources/jobs/simple.json" "--storage" "file" "--redis-uri" "redis://0.0.0.0:1111" "--redis-prefix" "my-xapipe" "--file-store-dir" "somedir" "--metrics-reporter" "prometheus" "--prometheus-push-gateway" "localhost:1234" "--source-url" "http://0.0.0.0:8080/xapi" "--source-batch-size" "1" "--source-poll-interval" "1" "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" "--json-only" "true" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" "--source-backoff-initial" "1" "--target-url" "http://0.0.0.0:8081/xapi" "--target-batch-size" "1" "--target-username" "foo" "--target-password" "bar" "--target-backoff-budget" "1" "--target-backoff-max-attempt" "1" "--target-backoff-j-range" "1" "--target-backoff-initial" "1" "--get-buffer-size" "1" "--batch-timeout" "1" "--template-profile-url" "http://example.org/profile.jsonld" "--template-id" "http://example.org/profile.jsonld#foo" "--pattern-profile-url" "http://example.org/profile.jsonld" "--pattern-id" "http://example.org/profile.jsonld#foo" "--statement-buffer-size" "1" "--batch-buffer-size" "1" "--ensure-path" "$.id" "--match-path" "$.verb.id=http://example.com/verb" "--match-path" "$.actor={\"mbox\":\"mailto:bob@example.com\",\"objectType\":\"Agent\"}" "--concept-profile-url" "http://example.org/profile.jsonld" "--concept-type" "Verb" "--activity-type-id" "http://example.org/profile.jsonld#activity-type" "--verb-id" "http://example.org/profile.jsonld#verb" "--attachment-usage-type" "http://example.org/profile.jsonld#aut" "--cleanup-buffer-size" "1"]), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "options_test.clj", :line 184, :var-scope com.yetanalytics.xapipe.cli.options-test/fn--50260}} diff --git a/src/test/com/yetanalytics/xapipe/cli/thing2.edn b/src/test/com/yetanalytics/xapipe/cli/thing2.edn deleted file mode 100644 index 8d93064..0000000 --- a/src/test/com/yetanalytics/xapipe/cli/thing2.edn +++ /dev/null @@ -1,2 +0,0 @@ -expected: (= {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file json-job, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json json-job, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only false, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"} opts) - actual: (not (= {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only false, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"} {:metrics-reporter "prometheus", :source-password "bar", :filter-pattern-profile-urls ["http://example.org/profile.jsonld"], :delete-job "foo", :filter-template-profile-urls ["http://example.org/profile.jsonld"], :source-backoff-max-attempt 1, :target-backoff-max-attempt 1, :source-username "foo", :json-file {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :job-id "foo", :conn-timeout 1, :statement-buffer-size 1, :filter-verb-ids ["http://example.org/profile.jsonld#verb"], :source-backoff-budget 1, :file-store-dir "somedir", :batch-buffer-size 1, :conn-io-thread-count 1, :get-params {:format "exact"}, :conn-threads 1, :filter-template-ids ["http://example.org/profile.jsonld#foo"], :filter-concept-types ["Verb"], :redis-uri "redis://0.0.0.0:1111", :source-url "http://0.0.0.0:8080/xapi", :filter-concept-profile-urls ["http://example.org/profile.jsonld"], :batch-timeout 1, :source-poll-interval 1, :source-batch-size 1, :filter-activity-type-ids ["http://example.org/profile.jsonld#activity-type"], :filter-ensure-paths [[["id"]]], :target-backoff-budget 1, :prometheus-push-gateway "localhost:1234", :conn-insecure? true, :target-username "foo", :target-backoff-j-range 1, :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, :target-password "bar", :target-batch-size 1, :filter-attachment-usage-types ["http://example.org/profile.jsonld#aut"], :show-job true, :help true, :json {:id "foo", :config {:get-buffer-size 10, :statement-buffer-size 500, :batch-buffer-size 10, :batch-timeout 200, :cleanup-buffer-size 50, :source {:request-config {:url-base "http://0.0.0.0:8080", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}, :poll-interval 1000, :get-params {:limit 50}}, :target {:request-config {:url-base "http://0.0.0.0:8081", :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10}}, :filter {}}, :state {:status :init, :cursor "1970-01-01T00:00:00.000000000Z", :source {:errors []}, :target {:errors []}, :errors [], :filter {}}}, :list-jobs true, :filter-match-paths [[[["verb"] ["id"]] "http://example.com/verb"] [[["actor"]] {"mbox" "mailto:bob@example.com", "objectType" "Agent"}]], :source-backoff-initial 1, :cleanup-buffer-size 1, :json-only true, :filter-pattern-ids ["http://example.org/profile.jsonld#foo"], :conn-default-per-route 1, :target-url "http://0.0.0.0:8081/xapi"})) \ No newline at end of file From 5b601bd964baa0d1f3628517ab015cd271224f58 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Mon, 14 Aug 2023 15:40:34 -0400 Subject: [PATCH 11/13] all tests passing --- src/test/com/yetanalytics/xapipe/cli/options_test.clj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/com/yetanalytics/xapipe/cli/options_test.clj b/src/test/com/yetanalytics/xapipe/cli/options_test.clj index 689d534..df5542a 100644 --- a/src/test/com/yetanalytics/xapipe/cli/options_test.clj +++ b/src/test/com/yetanalytics/xapipe/cli/options_test.clj @@ -162,8 +162,7 @@ :source {:request-config {:url-base "http://0.0.0.0:8080", - :xapi-prefix "/xapi" - :json-only false}, + :xapi-prefix "/xapi"}, :batch-size 50, :backoff-opts {:budget 10000, :max-attempt 10} :poll-interval 1000, @@ -221,7 +220,7 @@ "--xapi-get-param" "format=exact" "--source-username" "foo" "--source-password" "bar" - "--json-only" "false" + "--json-only" "--source-backoff-budget" "1" "--source-backoff-max-attempt" "1" "--source-backoff-j-range" "1" @@ -282,7 +281,7 @@ :force-resume true, :redis-prefix "my-xapipe", :source-backoff-j-range 1, - :json-only false, + :json-only true, :storage :file, :get-buffer-size 1, :target-backoff-initial 1, From e8a18cf817c631592d938da2f403013bc3f6d559 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Mon, 14 Aug 2023 15:50:14 -0400 Subject: [PATCH 12/13] estraneous arg --- src/lib/com/yetanalytics/xapipe/client.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/com/yetanalytics/xapipe/client.clj b/src/lib/com/yetanalytics/xapipe/client.clj index a4f48b0..f932165 100644 --- a/src/lib/com/yetanalytics/xapipe/client.clj +++ b/src/lib/com/yetanalytics/xapipe/client.clj @@ -400,8 +400,7 @@ poll-interval & {:keys [backoff-opts conn-opts - reporter - json-only] + reporter] :or {reporter (metrics/->NoopReporter)}}] (let [backoff-opts (or backoff-opts {:budget 10000 From b3a95842155ccb44084f7e4575c432647f8bf7f6 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Mon, 14 Aug 2023 15:55:17 -0400 Subject: [PATCH 13/13] forgot doc line --- doc/options.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/options.md b/doc/options.md index cb4b833..b97e295 100644 --- a/doc/options.md +++ b/doc/options.md @@ -48,6 +48,7 @@ All options: -p, --xapi-get-param KEY=VALUE {} xAPI GET Parameters --source-username USERNAME Source LRS BASIC Auth username --source-password PASSWORD Source LRS BASIC Auth password + --json-only Only operate in JSON statement mode for data transfer, ignoring Attachments/multipart (for compatibility issues) --source-auth-uri URI Source LRS OAuth autentication URI --source-client-id ID Source LRS OAuth client ID --source-client-secret SECRET Source LRS OAuth client secret