From 0b53c899dd64765de616ea74aa209611bcc88f0b Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 3 Mar 2024 14:27:12 +0100 Subject: [PATCH] fix test No-Issue --- .../tests/integration/api/test_artifact_upload.py | 10 +++++----- .../tests/integration/api/test_collection_signing.py | 6 ++++-- .../integration/api/test_cross_repository_search.py | 9 +++++---- galaxy_ng/tests/integration/api/test_synclist.py | 10 +++++----- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/galaxy_ng/tests/integration/api/test_artifact_upload.py b/galaxy_ng/tests/integration/api/test_artifact_upload.py index 34f81c0adf..5c485379d9 100644 --- a/galaxy_ng/tests/integration/api/test_artifact_upload.py +++ b/galaxy_ng/tests/integration/api/test_artifact_upload.py @@ -12,7 +12,7 @@ from galaxykit.collections import upload_artifact, get_collection_from_repo, get_collection, \ get_ui_collection from galaxykit.utils import wait_for_task, GalaxyClientError -from ..utils.iqe_utils import require_signature_for_approval +from ..utils.iqe_utils import require_signature_for_approval, is_ephemeral_env from ..utils import ( CapturingGalaxyError, @@ -302,9 +302,9 @@ def test_long_field_values(galaxy_client, field): @pytest.mark.importer @pytest.mark.min_hub_version("4.6dev") @pytest.mark.all -@pytest.mark.skipif(require_signature_for_approval(), reason="This test needs refactoring to " - "work with signatures required " - "on move.") +@pytest.mark.skipif(require_signature_for_approval() or is_ephemeral_env(), + reason="This test needs refactoring to work with signatures" + " required on move.") def test_ansible_requires(ansible_config, spec, galaxy_client): """ Test handling of POSTs to the artifact endpoint neglecting to submit a file. @@ -312,7 +312,7 @@ def test_ansible_requires(ansible_config, spec, galaxy_client): Also verifies that the collections endpoint properly returns a `requires_ansible` field, and that the returned field matches the collection metadata. """ - + # GALAXY_SIGNATURE_UPLOAD_ENABLED="false" in ephemeral env gc = galaxy_client("partner_engineer") _, requires_ansible, result = spec artifact = build_collection( diff --git a/galaxy_ng/tests/integration/api/test_collection_signing.py b/galaxy_ng/tests/integration/api/test_collection_signing.py index 32493a8835..a1e1c544c0 100644 --- a/galaxy_ng/tests/integration/api/test_collection_signing.py +++ b/galaxy_ng/tests/integration/api/test_collection_signing.py @@ -14,7 +14,8 @@ from orionutils.generator import build_collection -from galaxy_ng.tests.integration.utils.iqe_utils import require_signature_for_approval +from galaxy_ng.tests.integration.utils.iqe_utils import require_signature_for_approval, \ + is_ephemeral_env from galaxy_ng.tests.integration.constants import SLEEP_SECONDS_ONETIME from galaxy_ng.tests.integration.utils import ( build_collection as galaxy_build_collection, @@ -496,7 +497,7 @@ def test_upload_signature(require_auth, flags, galaxy_client, settings): assert collection["signatures"][0]["signing_service"] is None -@pytest.mark.skipif(not require_signature_for_approval(), +@pytest.mark.skipif(not require_signature_for_approval() or is_ephemeral_env(), reason="GALAXY_REQUIRE_SIGNATURE_FOR_APPROVAL is required to be enabled") def test_move_with_no_signing_service_not_superuser_signature_required( flags, galaxy_client, settings): @@ -504,6 +505,7 @@ def test_move_with_no_signing_service_not_superuser_signature_required( Test signature validation on the pulp {repo_href}/move_collection_version/ api when signatures are required. """ + # GALAXY_SIGNATURE_UPLOAD_ENABLED="false" in ephemeral env if not settings.get("GALAXY_REQUIRE_CONTENT_APPROVAL"): pytest.skip("GALAXY_REQUIRE_CONTENT_APPROVAL is required to be enabled") diff --git a/galaxy_ng/tests/integration/api/test_cross_repository_search.py b/galaxy_ng/tests/integration/api/test_cross_repository_search.py index 173f6ea572..23df38baec 100644 --- a/galaxy_ng/tests/integration/api/test_cross_repository_search.py +++ b/galaxy_ng/tests/integration/api/test_cross_repository_search.py @@ -1,17 +1,18 @@ import pytest from galaxykit.repositories import search_collection -from ..utils.iqe_utils import require_signature_for_approval +from ..utils.iqe_utils import require_signature_for_approval, is_ephemeral_env from ..utils import get_client, SocialGithubClient @pytest.mark.min_hub_version("4.7dev") @pytest.mark.all -@pytest.mark.skipif(require_signature_for_approval(), reason="This test needs refactoring to " - "work with signatures required " - "on move.") +@pytest.mark.skipif(require_signature_for_approval() or is_ephemeral_env(), + reason="This test needs refactoring to work with signatures" + " required on move.") def test_x_repo_search_acl_basic_user(uncertifiedv2, galaxy_client): """Check if admin and basic user can perform x-repo searches""" + # GALAXY_SIGNATURE_UPLOAD_ENABLED="false" in ephemeral env gc_admin = galaxy_client("admin") # Enumerate published collection info ... diff --git a/galaxy_ng/tests/integration/api/test_synclist.py b/galaxy_ng/tests/integration/api/test_synclist.py index ac2d7a4a59..d63c7b1a79 100644 --- a/galaxy_ng/tests/integration/api/test_synclist.py +++ b/galaxy_ng/tests/integration/api/test_synclist.py @@ -3,7 +3,7 @@ import pytest from orionutils.generator import build_collection -from ..utils.iqe_utils import require_signature_for_approval +from ..utils.iqe_utils import require_signature_for_approval, is_ephemeral_env from ..constants import USERNAME_PUBLISHER from ..utils import get_client, set_certification, wait_for_task @@ -85,15 +85,15 @@ def test_synclist_object_edit(ansible_config, upload_artifact): @pytest.mark.synclist @pytest.mark.deployment_cloud @pytest.mark.slow_in_cloud -@pytest.mark.skipif(require_signature_for_approval(), reason="This test needs refactoring to " - "work with signatures required " - "on move.") +@pytest.mark.skipif(require_signature_for_approval() or is_ephemeral_env(), + reason="This test needs refactoring to work with signatures" + " required on move.") def test_edit_synclist_see_in_excludes(ansible_config, upload_artifact, settings, galaxy_client): """Edit SyncList object to exclude a collection, confirm see in content/{SyncList.name}/v3/excludes/ confirm no change to content/{SyncList.name}/v3/collections/ """ - + # GALAXY_SIGNATURE_UPLOAD_ENABLED="false" in ephemeral env # NOTE: on stage env, a toggle action does: # PUT https://console.stage.redhat.com/api/automation-hub/_ui/v1/my-synclists/1/