Skip to content

Commit 16f2d5f

Browse files
author
mping
committed
bump deps, add assert
1 parent f1ea3fe commit 16f2d5f

8 files changed

Lines changed: 78 additions & 1148 deletions

File tree

deps.edn

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
{:paths ["src" "target"]
22
:test-paths ["test"]
33

4-
:deps {org.clojure/clojure {:mvn/version "1.11.4"}
5-
thheller/shadow-cljs {:mvn/version "2.28.11"}
6-
com.taoensso/telemere {:mvn/version "1.0.0-RC1"}
7-
com.taoensso/nippy {:mvn/version "3.4.2"}
8-
;;stuff
9-
net.cgrand/macrovich {:mvn/version "0.2.2"}
10-
funcool/promesa {:mvn/version "11.0.678"}
11-
metosin/malli {:mvn/version "0.16.4"}
12-
thedavidmeister/cljc-md5 {:mvn/version "0.0.2"}}
4+
:deps {org.clojure/clojure {:mvn/version "1.12.1"}
5+
thheller/shadow-cljs {:mvn/version "2.28.11"}
6+
com.taoensso/telemere {:mvn/version "1.1.0"}
7+
com.taoensso/nippy {:mvn/version "3.6.0"}
8+
io.opentelemetry/opentelemetry-api {:mvn/version "1.53.0"}
9+
io.opentelemetry/opentelemetry-sdk {:mvn/version "1.53.0"}
10+
;;stuff
11+
net.cgrand/macrovich {:mvn/version "0.2.2"}
12+
funcool/promesa {:mvn/version "11.0.678"}
13+
metosin/malli {:mvn/version "0.19.1"}
14+
thedavidmeister/cljc-md5 {:mvn/version "0.0.2"}
15+
missionary/missionary {:mvn/version "b.46"}}
1316

14-
:aliases {:dev {:extra-paths ["dev" "test"]
15-
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
16-
:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}
17-
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
18-
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
19-
com.lambdaisland/kaocha-cljs {:mvn/version "1.5.154"}
20-
ch.qos.logback/logback-classic {:mvn/version "1.5.12"}
21-
tortue/spy {:mvn/version "2.15.0"}
22-
nubank/matcher-combinators {:mvn/version "3.9.1"}
23-
com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.4.0"}}}
24-
:fdb {:extra-deps {org.foundationdb/fdb-java {:mvn/version "7.1.31"}
25-
me.vedang/clj-fdb {:mvn/version "0.3.0"}}}
17+
:aliases {:dev {:extra-paths ["dev" "test"]
18+
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
19+
:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}
20+
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
21+
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
22+
com.lambdaisland/kaocha-cljs {:mvn/version "1.5.154"}
23+
ch.qos.logback/logback-classic {:mvn/version "1.5.18"}
24+
tortue/spy {:mvn/version "2.15.0"}
25+
nubank/matcher-combinators {:mvn/version "3.9.2"}
26+
com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.6.2"}}}
27+
:fdb {:extra-deps {org.foundationdb/fdb-java {:mvn/version "7.1.31"}
28+
me.vedang/clj-fdb {:mvn/version "0.3.0"}}}
2629

27-
:jdbc {:extra-deps {com.github.seancorfield/next.jdbc {:mvn/version "1.3.939"}
28-
org.postgresql/postgresql {:mvn/version "42.7.3"}
29-
migratus/migratus {:mvn/version "1.5.6"}}}
30-
:doc {:extra-paths ["doc"]}
31-
:cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.11.132"}
32-
thheller/shadow-cljs {:mvn/version "2.28.12"}
33-
hiccups/hiccups {:mvn/version "0.3.0"}}}
30+
:jdbc {:extra-deps {com.github.seancorfield/next.jdbc {:mvn/version "1.3.1048"}
31+
org.postgresql/postgresql {:mvn/version "42.7.7"}
32+
migratus/migratus {:mvn/version "1.6.4"}}}
33+
:doc {:extra-paths ["doc"]}
34+
:cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.12.42"}
35+
thheller/shadow-cljs {:mvn/version "3.2.0"}
36+
hiccups/hiccups {:mvn/version "0.3.0"}}}
3437

35-
:build {:extra-paths ["build"]
36-
:deps {io.github.clojure/tools.build {:mvn/version "0.10.4"}}
37-
:ns-default build}
38+
:build {:extra-paths ["build"]
39+
:deps {io.github.clojure/tools.build {:mvn/version "0.10.10"}}
40+
:ns-default build}
3841

39-
:test {:main-opts ["-m" "kaocha.runner"]}}}
42+
:test {:main-opts ["-m" "kaocha.runner"]}}}

docker/fdb.cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker:docker@172.19.0.2:4500
1+
docker:docker@172.18.0.3:4500

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
},
3030
"dependencies": {
3131
"serialize-error": "^11.0.0",
32-
"ws": "^8.15.1"
32+
"ws": "^8.18.3"
3333
}
3434
}

src/intemporal/workflow.cljc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
#?(:clj (set! *warn-on-reflection* true))
1313

14+
;;;;
15+
;; logging/tracing
16+
17+
1418
;;;;
1519
;; runtime
1620

@@ -23,8 +27,15 @@
2327
(defn current-env
2428
"Returns the workflow execution environment for the current thread"
2529
[]
30+
(assert (some? internal/*env*) "No workflow env detected, should only be called within a workflow function")
2631
internal/*env*)
2732

33+
(defn workflow-id
34+
"Returns the current workflow uuid"
35+
[]
36+
(assert (some? internal/*env*) "No workflow env detected, should only be called within a workflow function")
37+
(-> internal/*env* :root))
38+
2839
;;;;
2940
;; worker
3041
(defprotocol ITaskExecutor

test/intemporal/test_utils.cljc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#?(:clj (:require [intemporal.store :as store]
99
[intemporal.workflow.internal :as in]
1010
[promesa.core :as p]
11+
[taoensso.telemere :as t]
1112
[taoensso.telemere :as telemere]
1213
[net.cgrand.macrovich :as macros]
1314
[clojure.pprint :as pprint]))

test/intemporal/workflow_test.cljc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
MyActivities
3737
(foo [this a] [:proto a]))
3838

39-
(defn-workflow my-workflow [i]
39+
(defn-workflow my-workflow [atm]
40+
(reset! atm (w/workflow-id))
41+
4042
(let [sf (stub-function activity-fn)
4143
pr (stub-protocol MyActivities {})
4244
sfr (sf 1)
@@ -54,10 +56,12 @@
5456
(deftest workflow-happy-path-test
5557
(testing "workflow"
5658
(let [mstore (store/make-store)
57-
stop-worker (w/start-worker! mstore {:protocols {`MyActivities (->MyActivitiesImpl)}})]
59+
stop-worker (w/start-worker! mstore {:protocols {`MyActivities (->MyActivitiesImpl)}})
60+
uuid-store (atom nil)]
5861

5962
(with-result [v (w/with-env {:store mstore}
60-
(my-workflow 1))]
63+
(my-workflow uuid-store))]
64+
6165
(testing "workflow result"
6266
(is (= [:root [:sub :nested] [:proto :pr]]
6367
v)))
@@ -72,8 +76,11 @@
7276

7377
(tu/print-tables mstore)
7478

79+
(testing "workflow uuid"
80+
(is (every? #(= @uuid-store %) (map :root evts))))
81+
7582
(testing "workflow events"
76-
(is (match? {:type :intemporal.workflow/invoke :sym 'intemporal.workflow-test/my-workflow- :args [1]} w1))
83+
(is (match? {:type :intemporal.workflow/invoke :sym 'intemporal.workflow-test/my-workflow- :args [uuid-store]} w1))
7784
(is (match? {:type :intemporal.workflow/success :sym 'intemporal.workflow-test/my-workflow-} w2)))
7885

7986
(testing "activity events"
@@ -92,12 +99,15 @@
9299
(let [tasks (store/list-tasks mstore)
93100
;; due to promises,
94101
;; the order of execution is not exactly the same between clj/cljs
95-
#?(:clj [w1 a1 n1 p1]
96-
:cljs [w1 a1 p1 n1]) tasks]
102+
#?(:clj [w1]
103+
:cljs [w1]) tasks]
97104
(tu/print-tables mstore)
98105

99106
(testing "workflow task"
100-
(is (match? {:type :workflow :sym 'intemporal.workflow-test/my-workflow- :state :success} w1)))))
107+
(is (match? {:type :workflow :sym 'intemporal.workflow-test/my-workflow- :state :success} w1)))
108+
109+
(testing "workflow uuid"
110+
(is (every? #(= @uuid-store %) (map :id tasks))))))
101111

102112
(stop-worker)))))
103113

0 commit comments

Comments
 (0)