Commit 7ae3e7e
authored
DBOS Instance (#309)
This PR is a **_major breaking change_** to the DBOS public API surface
area. We are removing the global singleton and most of the static
methods on `DBOS` in favor of using DBOS as an instance. We had already
done the work to ensure that everything worked with `DBOS.Instance`
directly. However, the combination of static and instance APIs made for
a poor developer experience, so we've decided to remove the static API
entirely.
Mostly, this PR is test work since nearly all the tests used the static
API. Updating all the tests allowed us to make a couple other changes -
in particular, using
[`@AutoClose`](https://docs.junit.org/6.0.3/writing-tests/built-in-extensions.html#AutoClose)
to simplify test cleanup and using
[TestContainers](https://testcontainers.com/) for database isolation.
The combination of DBOS Instance and TestContainers enables us to run
tests in parallel, bringing a test run down to 6 minutes from 15.
> Major thanks to @hannosgit who did the original TestContainers work!
In addition to the Java work, this PR updates the Kotlin DBOSExtension
class. The previous DBOSExtension primarily provided top level Kotlin
functions for DBOS static methods. Now, the DBOSExtension simply wraps
`DBOS.startWorkflow` and `DBOS.runStep` to support [Kotlin trailing
lambdas
syntax](https://kotlinlang.org/docs/lambdas.html#passing-trailing-lambdas).
We also added a Kotlin test!
fixes #3061 parent f797601 commit 7ae3e7e
77 files changed
Lines changed: 4637 additions & 5423 deletions
File tree
- .github/workflows
- transact-cli/src/test/java/dev/dbos/transact/cli
- transact/src
- main
- java/dev/dbos/transact
- execution
- kotlin/dev/dbos/transact
- test
- java/dev/dbos/transact
- admin
- client
- conductor
- config
- database
- execution
- invocation
- issues
- json
- migrations
- notifications
- queue
- scheduled
- step
- utils
- workflow
- kotlin/dev/dbos/transact
- resources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 23 | | |
37 | 24 | | |
38 | | - | |
| 25 | + | |
39 | 26 | | |
40 | 27 | | |
41 | 28 | | |
42 | 29 | | |
43 | | - | |
| 30 | + | |
44 | 31 | | |
45 | 32 | | |
46 | 33 | | |
47 | 34 | | |
48 | 35 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 36 | + | |
59 | 37 | | |
60 | 38 | | |
61 | 39 | | |
| |||
72 | 50 | | |
73 | 51 | | |
74 | 52 | | |
75 | | - | |
| 53 | + | |
76 | 54 | | |
77 | 55 | | |
78 | 56 | | |
| |||
Lines changed: 39 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | 11 | | |
15 | | - | |
16 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | | - | |
| 22 | + | |
| 23 | + | |
26 | 24 | | |
27 | 25 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 26 | + | |
41 | 27 | | |
42 | 28 | | |
43 | 29 | | |
44 | 30 | | |
45 | | - | |
46 | | - | |
47 | 31 | | |
48 | 32 | | |
49 | 33 | | |
50 | 34 | | |
51 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
52 | 41 | | |
53 | 42 | | |
54 | | - | |
55 | 43 | | |
56 | 44 | | |
57 | 45 | | |
| |||
60 | 48 | | |
61 | 49 | | |
62 | 50 | | |
63 | | - | |
64 | | - | |
65 | 51 | | |
66 | 52 | | |
67 | 53 | | |
68 | 54 | | |
69 | 55 | | |
70 | 56 | | |
71 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
72 | 63 | | |
73 | 64 | | |
74 | | - | |
75 | 65 | | |
76 | 66 | | |
77 | 67 | | |
78 | 68 | | |
79 | 69 | | |
80 | 70 | | |
81 | | - | |
82 | 71 | | |
83 | 72 | | |
84 | 73 | | |
85 | 74 | | |
86 | 75 | | |
87 | | - | |
88 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
96 | | - | |
97 | | - | |
98 | 92 | | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
102 | | - | |
103 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 110 | + | |
121 | 111 | | |
122 | 112 | | |
123 | | - | |
| 113 | + | |
124 | 114 | | |
125 | 115 | | |
126 | 116 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
Lines changed: 20 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | | - | |
| 13 | + | |
| 14 | + | |
17 | 15 | | |
| 16 | + | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 30 | + | |
45 | 31 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
49 | 36 | | |
50 | | - | |
| 37 | + | |
51 | 38 | | |
52 | 39 | | |
53 | 40 | | |
54 | | - | |
55 | | - | |
| 41 | + | |
| 42 | + | |
56 | 43 | | |
57 | 44 | | |
58 | 45 | | |
| |||
63 | 50 | | |
64 | 51 | | |
65 | 52 | | |
66 | | - | |
| 53 | + | |
67 | 54 | | |
68 | 55 | | |
69 | 56 | | |
70 | 57 | | |
71 | 58 | | |
72 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
73 | 64 | | |
74 | 65 | | |
75 | | - | |
| 66 | + | |
76 | 67 | | |
77 | 68 | | |
0 commit comments