@@ -175,22 +175,24 @@ def test_workflow_commands(config: DBOSConfig) -> None:
175175 db_url = config ["system_database_url" ]
176176 else :
177177 db_url = (
178- sa .make_url (config ["application_database_url " ])
178+ sa .make_url (config ["system_database_url " ])
179179 .set (database = "dbos_toolbox" )
180180 .render_as_string (hide_password = False )
181181 )
182182 with tempfile .TemporaryDirectory () as temp_path :
183183 env = os .environ .copy ()
184- env ["DBOS_DATABASE_URL " ] = db_url
184+ env ["DBOS_SYSTEM_DATABASE_URL " ] = db_url
185185 subprocess .check_call (
186186 ["dbos" , "init" , "--template" , "dbos-toolbox" ],
187187 cwd = temp_path ,
188188 env = env ,
189189 )
190- subprocess .check_call (["dbos" , "reset" , "-y" , "-D" , db_url ], cwd = temp_path )
190+ subprocess .check_call (
191+ ["dbos" , "reset" , "-y" , "--sys-db-url" , db_url ], cwd = temp_path
192+ )
191193
192194 # Get some workflows enqueued on the toolbox, then kill the toolbox
193- process = subprocess .Popen (["dbos " , "start " ], cwd = temp_path , env = env )
195+ process = subprocess .Popen (["python3 " , "main.py " ], cwd = temp_path , env = env )
194196 try :
195197 session = requests .Session ()
196198 for i in range (10 ):
@@ -209,25 +211,25 @@ def test_workflow_commands(config: DBOSConfig) -> None:
209211 time .sleep (1 ) # So the queued workflows can start
210212 finally :
211213 # Because the toolbox steps sleep for 5 seconds, all the steps should be PENDING
212- os .kill (process .pid , signal .SIGINT )
214+ os .kill (process .pid , signal .SIGKILL )
213215 process .wait ()
214216
215217 # Verify the output is valid JSON
216218 output = subprocess .check_output (
217- ["dbos" , "workflow" , "list" , "--db-url" , db_url ], cwd = temp_path
219+ ["dbos" , "workflow" , "list" , "--sys- db-url" , db_url ], cwd = temp_path
218220 )
219221 data = json .loads (output )
220222 assert isinstance (data , list ) and len (data ) == 10
221223
222224 # Verify the output is valid JSON
223225 output = subprocess .check_output (
224- ["dbos" , "workflow" , "queue" , "list" , "--db-url" , db_url ], cwd = temp_path
226+ ["dbos" , "workflow" , "queue" , "list" , "--sys- db-url" , db_url ], cwd = temp_path
225227 )
226228 workflows = json .loads (output )
227229 assert isinstance (workflows , list ) and len (workflows ) == 10
228230 for wf in workflows :
229231 output = subprocess .check_output (
230- ["dbos" , "workflow" , "get" , wf ["workflow_id" ], "--db-url" , db_url ],
232+ ["dbos" , "workflow" , "get" , wf ["workflow_id" ], "--sys- db-url" , db_url ],
231233 cwd = temp_path ,
232234 )
233235 get_wf_data = json .loads (output )
@@ -237,7 +239,7 @@ def test_workflow_commands(config: DBOSConfig) -> None:
237239 # workflow ID is a preffix to each step ID
238240 wf_id = "-" .join (workflows [0 ]["workflow_id" ].split ("-" )[:- 1 ])
239241 get_steps_output = subprocess .check_output (
240- ["dbos" , "workflow" , "steps" , wf_id , "--db-url" , db_url ], cwd = temp_path
242+ ["dbos" , "workflow" , "steps" , wf_id , "--sys- db-url" , db_url ], cwd = temp_path
241243 )
242244 get_steps_data = json .loads (get_steps_output )
243245 assert isinstance (get_steps_data , list )
@@ -310,8 +312,7 @@ def test_workflow_commands(config: DBOSConfig) -> None:
310312
311313 # verify the forked workflow data with get command
312314 output = subprocess .check_output (
313- ["dbos" , "workflow" , "get" , custom_fork_id , "--db-url" , db_url ],
314- cwd = temp_path ,
315+ ["dbos" , "workflow" , "get" , custom_fork_id ], cwd = temp_path , env = env
315316 )
316317 custom_fork_get_data = json .loads (output )
317318 assert isinstance (custom_fork_get_data , dict )
@@ -339,15 +340,9 @@ def test_workflow_commands(config: DBOSConfig) -> None:
339340
340341 # verify the forked workflow data with get command and check application version
341342 output = subprocess .check_output (
342- [
343- "dbos" ,
344- "workflow" ,
345- "get" ,
346- version_fork_data ["workflow_id" ],
347- "--db-url" ,
348- db_url ,
349- ],
343+ ["dbos" , "workflow" , "get" , version_fork_data ["workflow_id" ]],
350344 cwd = temp_path ,
345+ env = env ,
351346 )
352347 version_fork_get_data = json .loads (output )
353348 assert isinstance (version_fork_get_data , dict )
@@ -379,8 +374,7 @@ def test_workflow_commands(config: DBOSConfig) -> None:
379374
380375 # verify the forked workflow data with get command and check both ID and application version
381376 output = subprocess .check_output (
382- ["dbos" , "workflow" , "get" , custom_fork_id2 , "--db-url" , db_url ],
383- cwd = temp_path ,
377+ ["dbos" , "workflow" , "get" , custom_fork_id2 ], cwd = temp_path , env = env
384378 )
385379 combined_fork_get_data = json .loads (output )
386380 assert isinstance (combined_fork_get_data , dict )
0 commit comments