Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Merge f64b34e into 464d5b3
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBasti committed Jan 30, 2020
2 parents 464d5b3 + f64b34e commit c21b280
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion example.test.env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ replace_registry:
# Config of the instance tested to alter package names.
alter_package_name:
# namespace in which package names should be altered
namespace: integration-tests
namespace: integration-tests-with-suffix
# oauth token for integration-tests-with-suffix namespace
quay_oauth_token: <quay application token>
# Robot account in *namespace* with *Creator* team role.
user: <robot account>
# Token for the robot account in the *namespace*.
Expand All @@ -58,6 +60,8 @@ alter_package_name:
suffix: "-test-suffix"
# name of the package used for testing
package: int-test
csv_annotations:
test: "package.int-test-test-suffix"
# Config of the instance tested to check if Greenwave policies are met for the
# NVR
greenwave:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
from tests.integration.utils import test_env, make_bundle, is_yaml_file


def check_csv_annotations(quay_bundle, expected_annotations):
"""
Test if bundle contains expected annotations
"""

for name, value in expected_annotations.items():
annotations = quay_bundle['metadata']['annotations']
assert name in annotations
assert annotations[name] == value


def has(suffix, manifest_path):
"""
Tell if 'suffix' can be found in YAML files under 'manifest_path'.
Expand Down Expand Up @@ -67,6 +78,8 @@ def test_alter_package_name_during_nvr_push(suffix_omps, suffix_quay, koji, tmp_

assert quay_bundle["packageName"] == config["package"] + config["suffix"]

check_csv_annotations(quay_bundle, config["csv_annotations"])


@pytest.mark.skipif(
not test_env.get("alter_package_name"),
Expand Down Expand Up @@ -103,5 +116,6 @@ def test_alter_package_name_during_archive_push(suffix_omps, suffix_quay, tmp_pa
)
)
)

assert quay_bundle["packageName"] == config["package"] + config["suffix"]

check_csv_annotations(quay_bundle, config["csv_annotations"])
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def suffix_quay():
if config:
quay = QuayAppRegistry(test_env["quay_app_registry_api"],
test_env["quay_api"],
test_env["quay_oauth_token"])
config["quay_oauth_token"])
quay.login_to_cnr(config["user"],
config["password"])

Expand Down

0 comments on commit c21b280

Please sign in to comment.