Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,26 @@ def get_commits_from_changes(
@click.option("--tc-url", required=False, help="TeamCity URL")
@click.option("--tc-user", required=False, help="TeamCity User")
@click.option("--tc-password", required=False, help="TeamCity Password")
@click.option("--qualix-host", required=True, help="Tested Qualix host")
@click.option("--qualix-host", required=False, default=None, help="Tested Qualix host")
@click.option(
"--qualix-version", required=False, default=None, help="Tested Qualix version"
)
@click.option("--image-tag", required=False, default=None, help="Tested Qualix image")
def trigger_qualix_auto_tests(
tc_url: Optional[str],
tc_user: Optional[str],
tc_password: Optional[str],
qualix_host: str,
qualix_host: Optional[str],
qualix_version: Optional[str],
image_tag: Optional[str],
):
tc = TC(tc_url, tc_user, tc_password)
current_build = tc.get_current_build()
tests_info = AutoTestsInfo.from_current_build(current_build)
tests_info.qualix_host = qualix_host
tests_info.qualix_version = qualix_version
tests_info.image_tag = image_tag

trigger_tests(tests_info, tc)


Expand Down
2 changes: 2 additions & 0 deletions scripts/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class AutoTestsInfo(BuildEnv):
vcs_url: str
path: PosixPath
qualix_host: Optional[str] = None
qualix_version: Optional[str] = None
image_tag: Optional[str] = None

@classmethod
def from_current_build(cls, build: "Build") -> "AutoTestsInfo":
Expand Down
8 changes: 8 additions & 0 deletions scripts/utils/trigger_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
PARAM_TRIGGERED_BY_URL = "conf.triggered_by_project.url"
PARAM_TRIGGERED_BY_COMMIT = "conf.triggered_by_project.commit_id"
PARAM_QUALIX_HOST = "conf.triggered_by_project.qualix_ip"
PARAM_QUALIX_VERSION = "conf.triggered_by_project.qualix_version"
PARAM_QUALIX_IMAG_TAG = "conf.triggered_by_project.image_tag"


def trigger_tests(tests_info: "AutoTestsInfo", tc: "TC"):
Expand Down Expand Up @@ -113,6 +115,12 @@ def _trigger_auto_tests_build(
if tests_info.qualix_host is not None:
prop[PARAM_QUALIX_HOST] = tests_info.qualix_host

if tests_info.qualix_version is not None:
prop[PARAM_QUALIX_VERSION] = tests_info.qualix_version

if tests_info.image_tag is not None:
prop[PARAM_QUALIX_IMAG_TAG] = tests_info.image_tag

build = tc.trigger_build(
bt.id,
prop,
Expand Down