1+ // Tests v2 `openfn project pull` and `openfn project deploy` loop against a mock Lightning
2+
13import test from 'ava' ;
24import path from 'node:path' ;
35import fs from 'node:fs/promises' ;
@@ -71,7 +73,7 @@ test.serial('pull, change and re-deploy', async (t) => {
7173
7274 // deploy
7375 const { stdout, stderr } = await run (
74- `openfn project deploy --no-confirm -- log-json -l debug`
76+ `openfn project deploy --log-json -l debug`
7577 ) ;
7678 t . falsy ( stderr ) ;
7779
@@ -99,9 +101,7 @@ test.serial('pull, change and re-deploy twice', async (t) => {
99101
100102 // first deploy
101103 await fs . writeFile ( exprPath , 'fn(s => ({ ...s, v: 1 }))' ) ;
102- const first = await run (
103- `openfn project deploy --no-confirm --log-json -l debug`
104- ) ;
104+ const first = await run ( `openfn project deploy --log-json -l debug` ) ;
105105 t . falsy ( first . stderr ) ;
106106 assertLog ( t , extractLogs ( first . stdout ) , / U p d a t e d p r o j e c t / ) ;
107107
@@ -112,7 +112,7 @@ test.serial('pull, change and re-deploy twice', async (t) => {
112112 // second deploy after another update
113113 await fs . writeFile ( exprPath , 'fn(s => ({ ...s, v: 2 }))' ) ;
114114 const { stdout, stderr } = await run (
115- `openfn project deploy --no-confirm -- log-json -l debug`
115+ `openfn project deploy --log-json -l debug`
116116 ) ;
117117 t . falsy ( stderr ) ;
118118 const logs = extractLogs ( stdout ) ;
@@ -140,9 +140,7 @@ test.serial('deploy and pull to check version history', async (t) => {
140140 await fs . writeFile ( exprPath , 'fn(s => ({ ...s, v: 1 }))' ) ;
141141
142142 // deploy then pull
143- const { stderr } = await run (
144- `openfn project deploy --no-confirm --log-json -l debug`
145- ) ;
143+ const { stderr } = await run ( `openfn project deploy --log-json -l debug` ) ;
146144 t . falsy ( stderr ) ;
147145 await run ( `openfn project pull ${ projectId } --log-json -l debug` ) ;
148146
@@ -174,7 +172,7 @@ test.serial('deploy then pull, change one workflow, deploy', async (t) => {
174172
175173 // deploy
176174 const { stdout, stderr } = await run (
177- `openfn project deploy --no-confirm -- log-json -l debug`
175+ `openfn project deploy --log-json -l debug`
178176 ) ;
179177 t . falsy ( stderr ) ;
180178 const logs = extractLogs ( stdout ) ;
@@ -215,7 +213,7 @@ test.serial('Remove a whole workflow', async (t) => {
215213
216214 // deploy
217215 const { stdout, stderr } = await run (
218- `openfn project deploy --no-confirm -- log-json -l debug`
216+ `openfn project deploy --log-json -l debug`
219217 ) ;
220218 t . falsy ( stderr ) ;
221219
@@ -262,7 +260,7 @@ steps:
262260 await rimraf ( path . join ( tmpDir , 'workflows/my-workflow/my-job.js' ) ) ;
263261
264262 const { stdout, stderr } = await run (
265- `openfn project deploy --no-confirm -- log-json -l debug`
263+ `openfn project deploy --log-json -l debug`
266264 ) ;
267265 t . falsy ( stderr ) ;
268266
@@ -317,7 +315,7 @@ steps:
317315 ) ;
318316
319317 const { stdout, stderr } = await run (
320- `openfn project deploy --no-confirm -- log-json -l debug`
318+ `openfn project deploy --log-json -l debug`
321319 ) ;
322320 t . falsy ( stderr ) ;
323321
@@ -372,9 +370,7 @@ test.serial.skip(
372370 await fs . writeFile ( exprPath , "post('http://success.org')" ) ;
373371
374372 // deploy
375- const { stdout, stderr } = await run (
376- `openfn project deploy --no-confirm -l debug`
377- ) ;
373+ const { stdout, stderr } = await run ( `openfn project deploy -l debug` ) ;
378374 console . log ( stdout ) ;
379375 t . falsy ( stderr ) ;
380376 const logs = extractLogs ( stdout ) ;
@@ -400,9 +396,7 @@ test.serial('warn when local and remote workflows have diverged', async (t) => {
400396 // base
401397 await run ( `openfn project pull ${ projectId } --log-json -l debug` ) ;
402398 await fs . writeFile ( exprPath , 'fn(s => ({ ...s, v: 1 }))' ) ;
403- const firstDeploy = await run (
404- `openfn project deploy --no-confirm --log-json -l debug`
405- ) ;
399+ const firstDeploy = await run ( `openfn project deploy --log-json -l debug` ) ;
406400 assertLog ( t , extractLogs ( firstDeploy . stdout ) , / U p d a t e d p r o j e c t / ) ;
407401
408402 // remote changed from base
@@ -424,7 +418,7 @@ test.serial('warn when local and remote workflows have diverged', async (t) => {
424418
425419 // deploy with divergence
426420 const { stdout, err } = await run (
427- `openfn project deploy --no-confirm -- log-json -l debug`
421+ `openfn project deploy --log-json -l debug`
428422 ) ;
429423 t . truthy ( err ) ;
430424 const logs = extractLogs ( stdout ) ;
@@ -448,7 +442,7 @@ test.serial('deploy a pulled v2 state file as a new project', async (t) => {
448442
449443 // deploy that exact file back as a duplicate
450444 const { stdout, stderr } = await run (
451- `openfn project deploy ${ pulledPath } --new --name my-duplicate --no-confirm -- log-json -l debug`
445+ `openfn project deploy ${ pulledPath } --new --name my-duplicate --log-json -l debug`
452446 ) ;
453447 t . falsy ( stderr ) ;
454448
@@ -506,7 +500,7 @@ test.serial(
506500
507501 // deploy main's pulled file, but target staging instead of main
508502 const { stdout, stderr } = await run (
509- `openfn project deploy ${ mainPath } staging --no-confirm -- log-json -l debug`
503+ `openfn project deploy ${ mainPath } staging --log-json -l debug`
510504 ) ;
511505 t . falsy ( stderr ) ;
512506 assertLog ( t , extractLogs ( stdout ) , / U p d a t e d p r o j e c t / ) ;
@@ -553,7 +547,7 @@ test.serial(
553547 await fs . writeFile ( resourcesPath , jsonToYaml ( before ) ) ;
554548
555549 const { stdout, stderr } = await run (
556- `openfn project deploy --no-confirm -- log-json -l debug`
550+ `openfn project deploy --log-json -l debug`
557551 ) ;
558552 t . falsy ( stderr ) ;
559553
@@ -596,7 +590,7 @@ workflows:
596590 await fs . writeFile ( exportedPath , specYaml ) ;
597591
598592 const { stdout, stderr } = await run (
599- `openfn project deploy ${ exportedPath } --name my-duplicate --no-confirm -- log-json -l debug`
593+ `openfn project deploy ${ exportedPath } --name my-duplicate --log-json -l debug`
600594 ) ;
601595 t . falsy ( stderr ) ;
602596
@@ -659,7 +653,7 @@ test.serial(
659653 await fs . writeFile ( resourcesPath , jsonToYaml ( before ) ) ;
660654
661655 const { stdout, stderr } = await run (
662- `openfn project deploy --no-confirm -- log-json -l debug`
656+ `openfn project deploy --log-json -l debug`
663657 ) ;
664658 t . falsy ( stderr ) ;
665659
0 commit comments