Skip to content

Commit

Permalink
Only require a label to run tests for koku
Browse files Browse the repository at this point in the history
Other repos should not need the ‘run-konflux-tests’ label in order for tests
to run in Konflux. We can more easily and quickly disable the Jenkins jobs for
those repos.
  • Loading branch information
samdoran committed Nov 15, 2024
1 parent d8a2252 commit 4a8034d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
7 changes: 6 additions & 1 deletion files/bin/deploy-iqe-cji.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@ def run(self) -> None:
display("PR labeled to skip smoke tests")
return

# This allows Konflux tests to run but will skip tests in Jenkins
# Skip Konflux tests unless explicitly labeled.
# This prevents tests from running in both Jenkins and Konflux and can be
# removed when Konflux increases the integration test timeout and
# Jenkins tests are disabled.
#
# https://issues.redhat.com/browse/KONFLUX-5449
if "run-konflux-tests" not in self.pr_labels:
display("PR is not labeled to run tests in Konflux")
return
Expand Down
26 changes: 16 additions & 10 deletions files/bin/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def main() -> None:
components_arg = chain.from_iterable(("--component", component) for component in components)
components_with_resources = os.environ.get("COMPONENTS_W_RESOURCES", "").split()
components_with_resources_arg = chain.from_iterable(("--no-remove-resources", component) for component in components_with_resources)
snapshot_components = set(component.name for component in snapshot.components)
deploy_frontends = os.environ.get("DEPLOY_FRONTENDS") or "false"
deploy_timeout = get_timeout("DEPLOY_TIMEOUT", labels)
extra_deploy_args = os.environ.get("EXTRA_DEPLOY_ARGS", "")
Expand All @@ -179,10 +180,24 @@ def main() -> None:
cred_params = []
no_log_values = []

if "koku" in set(component.name for component in snapshot.components):
if "ok-to-skip-smokes" in labels:
display("PR labeled to skip smoke tests")
return

if "koku" in snapshot_components:
if "smokes-required" in labels and not any(label.endswith("smoke-tests") for label in labels):
sys.exit("Missing smoke tests labels.")

# Skip Konflux tests unless explicitly labeled.
# This prevents tests from running in both Jenkins and Konflux and can be
# removed when Konflux increases the integration test timeout and
# Jenkins tests are disabled.
#
# https://issues.redhat.com/browse/KONFLUX-5449
if "run-konflux-tests" not in labels:
display("PR is not labeled to run tests in Konflux")
return

# Credentials
aws_credentials_eph = os.environ.get("AWS_CREDENTIALS_EPH")
gcp_credentials_eph = os.environ.get("GCP_CREDENTIALS_EPH")
Expand Down Expand Up @@ -220,15 +235,6 @@ def main() -> None:
app_name,
] # fmt: off

if "ok-to-skip-smokes" in labels:
display("PR labeled to skip smoke tests")
return

# This allows Konflux tests to run but will skip tests in Jenkins
if "run-konflux-tests" not in labels:
display("PR is not labeled to run tests in Konflux")
return

display(command, no_log_values)

if args.check:
Expand Down

0 comments on commit 4a8034d

Please sign in to comment.