@@ -299,6 +299,51 @@ def test_create_codefresh_configuration_tests():
299299 shutil .rmtree (BUILD_MERGE_DIR )
300300
301301
302+ def test_create_codefresh_configuration_app_without_base_build_dependency ():
303+ """An app that has a Dockerfile but no build dependencies on task images must still
304+ be included in the build steps. Previously the apps directory was iterated only if
305+ task-images was non-empty, so apps with no base build dependency were silently skipped."""
306+ values = create_helm_chart (
307+ [CLOUDHARNESS_ROOT , RESOURCES ],
308+ output_path = OUT ,
309+ include = ['accounts' ],
310+ exclude = ['events' ],
311+ domain = "my.local" ,
312+ namespace = 'test' ,
313+ env = 'dev' ,
314+ local = False ,
315+ tag = 1 ,
316+ registry = 'reg'
317+ )
318+ try :
319+ root_paths = preprocess_build_overrides (
320+ root_paths = [CLOUDHARNESS_ROOT , RESOURCES ],
321+ helm_values = values ,
322+ merge_build_path = BUILD_MERGE_DIR
323+ )
324+
325+ build_included = [app ['harness' ]['name' ]
326+ for app in values ['apps' ].values () if 'harness' in app ]
327+
328+ assert values .get ('task-images' ) == {} or 'task-images' not in values , \
329+ "Precondition: accounts must not pull in any task images for this test to be meaningful"
330+
331+ cf = create_codefresh_deployment_scripts (root_paths , include = build_included ,
332+ envs = ['dev' ],
333+ base_image_name = values ['name' ],
334+ helm_values = values , save = False )
335+
336+ all_build_steps = {}
337+ for step_name in [STEP_0 , STEP_1 , STEP_2 , STEP_3 ]:
338+ if step_name in cf ['steps' ]:
339+ all_build_steps .update (cf ['steps' ][step_name ].get ('steps' , {}))
340+
341+ assert 'accounts' in all_build_steps , \
342+ f"accounts must be included in the build steps even when no base build dependency is specified. Got: { list (all_build_steps .keys ())} "
343+ finally :
344+ shutil .rmtree (BUILD_MERGE_DIR , ignore_errors = True )
345+
346+
302347def test_create_codefresh_configuration_nobuild ():
303348 values = create_helm_chart (
304349 [RESOURCES ],
0 commit comments