1111from cloudharness_utils .constants import *
1212from .helm import KEY_APPS , KEY_TASK_IMAGES
1313from .utils import find_dockerfiles_paths , get_app_relative_to_base_path , guess_build_dependencies_from_dockerfile , \
14- get_image_name , get_template , dict_merge , app_name_from_path
14+ get_image_name , get_template , dict_merge , app_name_from_path , clean_path
1515from cloudharness_utils .testing .api import get_api_filename , get_schemathesis_command , get_urls_from_api_file
1616
1717logging .getLogger ().setLevel (logging .INFO )
@@ -92,9 +92,9 @@ def e2e_test_environment(app_config: ApplicationHarnessConfig, app_domain: str =
9292 def codefresh_steps_from_base_path (base_path , build_step , fixed_context = None , include = build_included , publish = True ):
9393
9494 for dockerfile_path in find_dockerfiles_paths (base_path ):
95- app_relative_to_root = relpath (dockerfile_path , '.' )
96- app_relative_to_base = get_app_relative_to_base_path (base_path , dockerfile_path )
97- app_name = app_name_from_path (app_relative_to_base )
95+ dockerfile_relative_to_root = relpath (dockerfile_path , '.' )
96+ dockerfile_relative_to_base = get_app_relative_to_base_path (base_path , dockerfile_path )
97+ app_name = app_name_from_path (dockerfile_relative_to_base )
9898 app_key = app_name .replace ("-" , "_" )
9999 app_config : ApplicationHarnessConfig = app_key in helm_values .apps and helm_values .apps [
100100 app_key ].harness
@@ -115,7 +115,7 @@ def codefresh_steps_from_base_path(base_path, build_step, fixed_context=None, in
115115 build = codefresh_app_build_spec (
116116 app_name = app_name ,
117117 app_context_path = relpath (
118- fixed_context , '.' ) if fixed_context else app_relative_to_root ,
118+ fixed_context , '.' ) if fixed_context else dockerfile_relative_to_root ,
119119 dockerfile_path = join (
120120 relpath (
121121 dockerfile_path , root_path ) if fixed_context else '' ,
@@ -146,8 +146,8 @@ def codefresh_steps_from_base_path(base_path, build_step, fixed_context=None, in
146146
147147 if CD_API_TEST_STEP in steps and app_config and app_config .test .api .enabled :
148148 tests_path = join (
149- base_path , app_relative_to_base , "test" , API_TESTS_DIRNAME )
150- api_filename = get_api_filename (app_relative_to_base )
149+ base_path , dockerfile_relative_to_base , "test" , API_TESTS_DIRNAME )
150+ api_filename = get_api_filename (dockerfile_relative_to_base )
151151 if app_config .subdomain :
152152 server_urls = get_urls_from_api_file (
153153 os .path .join (root_path , APPS_PATH , api_filename ))
@@ -156,8 +156,8 @@ def codefresh_steps_from_base_path(base_path, build_step, fixed_context=None, in
156156 app_domain = get_app_domain (
157157 app_config ) + app_domain
158158 steps [CD_API_TEST_STEP ]['scale' ][f"{ app_name } _api_test" ] = dict (
159- volumes = api_test_volumes (
160- app_relative_to_root ),
159+ volumes = api_test_volumes (clean_path (
160+ dockerfile_relative_to_root ) ),
161161 environment = e2e_test_environment (
162162 app_config , app_domain ),
163163 commands = api_tests_commands (
@@ -166,13 +166,13 @@ def codefresh_steps_from_base_path(base_path, build_step, fixed_context=None, in
166166
167167 if CD_E2E_TEST_STEP in steps and app_config and app_config .test .e2e .enabled :
168168 tests_path = join (
169- base_path , app_relative_to_base , "test" , E2E_TESTS_DIRNAME )
169+ base_path , dockerfile_relative_to_base , "test" , E2E_TESTS_DIRNAME )
170170
171171 if app_config .subdomain :
172172
173173 steps [CD_E2E_TEST_STEP ]['scale' ][f"{ app_name } _e2e_test" ] = dict (
174174 volumes = e2e_test_volumes (
175- app_relative_to_root , app_name ),
175+ clean_path ( dockerfile_relative_to_root ) , app_name ),
176176 environment = e2e_test_environment (app_config )
177177 )
178178
0 commit comments