Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
chr-stian committed Mar 3, 2024
1 parent 31ee07d commit 0b53c89
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
10 changes: 5 additions & 5 deletions galaxy_ng/tests/integration/api/test_artifact_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -302,17 +302,17 @@ 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.
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(
Expand Down
6 changes: 4 additions & 2 deletions galaxy_ng/tests/integration/api/test_collection_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -496,14 +497,15 @@ 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):
"""
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")

Expand Down
Original file line number Diff line number Diff line change
@@ -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 ...
Expand Down
10 changes: 5 additions & 5 deletions galaxy_ng/tests/integration/api/test_synclist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/

Expand Down

0 comments on commit 0b53c89

Please sign in to comment.