Skip to content

Commit

Permalink
fix: Only use prefix options when variable is set
Browse files Browse the repository at this point in the history
Pull request #74 from DSD-DBS/fix-ci-template
  • Loading branch information
ewuerger authored Jun 25, 2024
2 parents 40048db + a34541e commit f6e4be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ci-templates/gitlab/synchronise_elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ capella2polarion_synchronise_elements:
--polarion-project-id=${CAPELLA2POLARION_PROJECT_ID:?} \
--capella-model="${CAPELLA2POLARION_MODEL_JSON:?}" \
--synchronize-config=${CAPELLA2POLARION_CONFIG:?} \
--type-prefix="${CAPELLA2POLARION_TYPE_PREFIX:?}" \
--role-prefix="${CAPELLA2POLARION_ROLE_PREFIX:?}" \
${CAPELLA2POLARION_TYPE_PREFIX:+--type-prefix="$CAPELLA2POLARION_TYPE_PREFIX"} \
${CAPELLA2POLARION_ROLE_PREFIX:+--role-prefix="$CAPELLA2POLARION_ROLE_PREFIX"} \
synchronize
10 changes: 4 additions & 6 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,7 @@ def test_create_links_no_new_links_with_errors(
expected = (
"Link creation for \"<FakeModelObject 'Fake 2' (uuid2)>\" failed:"
"\n\tRequested attribute: non_existent_attr"
"\n\tAssertionError assert False"
"\n\t--------"
"\n\t"
)

work_item_obj_2 = data_models.CapellaWorkItem(
Expand Down Expand Up @@ -517,7 +516,7 @@ def error():

assert not links
assert len(caplog.messages) == 1
assert caplog.messages[0] == expected
assert caplog.messages[0].startswith(expected)
assert len(base_object.mc.converter_session["uuid2"].errors) == 3

@staticmethod
Expand All @@ -528,8 +527,7 @@ def test_create_links_with_new_links_and_errors(
"Link creation for \"<FakeModelObject 'Fake 2' (uuid2)>\" "
"partially successful. Some links were not created:"
"\n\tRequested attribute: non_existent_attr"
"\n\tAssertionError assert False"
"\n\t--------"
"\n\t"
)

work_item_obj_2 = data_models.CapellaWorkItem(
Expand Down Expand Up @@ -594,7 +592,7 @@ def error():

assert links == [expected_link]
assert len(caplog.messages) == 1
assert caplog.messages[0] == expected
assert caplog.messages[0].startswith(expected)

@staticmethod
def test_create_links_from_ElementList(base_object: BaseObjectContainer):
Expand Down

0 comments on commit f6e4be2

Please sign in to comment.