Skip to content

Commit f5149d2

Browse files
committed
refactor(build): Update get_build_steps function signature for clarity and consistency
test(build): Add unittest.main() call to enable test execution from command line
1 parent 77f48b0 commit f5149d2

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

infra/build/functions/build_project.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,22 @@ def get_id(step_type, build):
348348
f'-{build.architecture}')
349349

350350

351-
def get_build_steps(project_name, project_yaml, dockerfile_contents, config):
352-
"""Returns the build steps for a project."""
351+
def get_build_steps( # pylint: disable=too-many-locals, too-many-statements, too-many-branches, too-many-arguments
352+
project_name,
353+
project_yaml,
354+
dockerfile,
355+
config,
356+
additional_env=None,
357+
use_caching=False,
358+
timestamp=None):
359+
"""Returns build steps for project."""
353360

354-
project = Project(project_name, project_yaml, dockerfile_contents)
361+
project = Project(project_name, project_yaml, dockerfile)
355362
return get_build_steps_for_project(project,
356363
config,
357-
additional_env=None,
358-
use_caching=False,
359-
timestamp=None), None
364+
additional_env=additional_env,
365+
use_caching=use_caching,
366+
timestamp=timestamp), None
360367

361368

362369
def get_build_steps_for_project(project,

infra/build/functions/build_project_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,6 @@ def test_get_build_steps_ubuntu_24_04(self, mock_url, mock_get_datetime_now,
150150
project_yaml, dockerfile,
151151
config)
152152
self.assertEqual(build_steps, expected_build_steps)
153+
154+
if __name__ == '__main__':
155+
unittest.main(exit=False)

0 commit comments

Comments
 (0)