Skip to content

Commit

Permalink
skip if ocp (ansible#2096)
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
chr-stian authored Mar 14, 2024
1 parent 62e1476 commit b548186
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
8 changes: 6 additions & 2 deletions galaxy_ng/tests/integration/api/test_load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from galaxy_ng.tests.integration.conftest import is_hub_4_7_or_higher
from galaxy_ng.tests.integration.utils.iqe_utils import sign_collection_on_demand
from galaxy_ng.tests.integration.utils.iqe_utils import sign_collection_on_demand, is_ocp_env
from galaxy_ng.tests.integration.utils.repo_management_utils import create_repo_and_dist, \
upload_new_artifact
from galaxykit.collections import deprecate_collection, \
Expand Down Expand Up @@ -98,11 +98,15 @@ def test_load_data(self, galaxy_client, data, ansible_config):
move_or_copy_collection(gc, artifact.namespace, artifact.name,
artifact.version, "staging",
destination=collection["repository"])
if collection["signed"]:
if collection["signed"] and not is_ocp_env():
logger.debug("Signing collection")
sign_collection_on_demand(
gc, "ansible-default", collection["repository"],
artifact.namespace, artifact.name, artifact.version)
if collection["signed"] and is_ocp_env():
# FIXME
logger.debug("Not Signing collection, collection signing not enabled"
"on ocp environment")
if collection["deprecated"]:
logger.debug("Deprecating collection")
deprecate_collection(gc, collection["namespace"], artifact.name,
Expand Down
26 changes: 15 additions & 11 deletions galaxy_ng/tests/integration/api/test_verify_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from galaxy_ng.tests.integration.conftest import is_hub_4_7_or_higher
from galaxy_ng.tests.integration.utils.iqe_utils import is_upgrade_from_aap23_hub46, \
galaxy_auto_sign_collections, is_upgrade_from_aap22_hub45
galaxy_auto_sign_collections, is_upgrade_from_aap22_hub45, is_ocp_env
from galaxy_ng.tests.integration.utils.repo_management_utils import search_collection_endpoint
from galaxykit.collections import collection_info
from galaxykit.groups import get_group_id
Expand Down Expand Up @@ -69,20 +69,24 @@ def test_verify_data_collections(self, galaxy_client, data, ansible_config):
assert actual_col["version"] == expected_col["version"]
assert actual_col["name"] == expected_name
assert actual_col["namespace"]["name"] == expected_col["namespace"]
if not galaxy_auto_sign_collections():
if expected_col["signed"]:
assert len(actual_col["signatures"]) > 0
if not is_ocp_env():
# FIXME: remove the above conditional when content signing is enabled
if not galaxy_auto_sign_collections():
if expected_col["signed"]:
assert len(actual_col["signatures"]) > 0
else:
assert len(actual_col["signatures"]) == 0
else:
assert len(actual_col["signatures"]) == 0
else:
assert len(actual_col["signatures"]) > 0
assert len(actual_col["signatures"]) > 0
if is_hub_4_7_or_higher(ansible_config):
_, actual_col = search_collection_endpoint(gc, name=expected_name)
assert actual_col[0]["is_deprecated"] == expected_col["deprecated"]
if galaxy_auto_sign_collections():
assert actual_col[0]["is_signed"] is True
else:
assert actual_col[0]["is_signed"] == expected_col["signed"]
if not is_ocp_env():
# FIXME: remove the above conditional when content signing is enabled
if galaxy_auto_sign_collections():
assert actual_col[0]["is_signed"] is True
else:
assert actual_col[0]["is_signed"] == expected_col["signed"]
assert actual_col[0]["cv_name"] == expected_name
assert actual_col[0]["cv_version"] == expected_col["version"]
assert actual_col[0]["repo_name"] == expected_col["repository"]
Expand Down
5 changes: 5 additions & 0 deletions galaxy_ng/tests/integration/utils/iqe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ def avoid_docker_limit_rate():
return avoid_limit_rate in ('true', 'True', 1, '1', True)


def is_upgrade_from_aap24_hub47():
upgrade = os.getenv("UPGRADE_FROM_AAP24_HUB47", False)
return upgrade in ('true', 'True', 1, '1', True)


def is_upgrade_from_aap23_hub46():
upgrade = os.getenv("UPGRADE_FROM_AAP23_HUB46", False)
return upgrade in ('true', 'True', 1, '1', True)
Expand Down

0 comments on commit b548186

Please sign in to comment.