Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix stage tests #2095

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions galaxy_ng/tests/integration/api/test_artifact_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ def test_api_publish(artifact, use_distribution, hub_version, galaxy_client):

if distros["count"] == 0:
repo = gc.get("pulp/api/v3/repositories/ansible/ansible/?name=staging")["results"][0]
r = gc.post("pulp/api/v3/distributions/ansible/ansible/", body={
"repository": repo["pulp_href"],
"name": f"inbound-{artifact.namespace}",
"base_path": f"inbound-{artifact.namespace}",
})
logger.debug("Waiting for upload to be completed")
wait_for_task(gc, r)
try:
r = gc.post("pulp/api/v3/distributions/ansible/ansible/", body={
"repository": repo["pulp_href"],
"name": f"inbound-{artifact.namespace}",
"base_path": f"inbound-{artifact.namespace}",
})
logger.debug("Waiting for upload to be completed")
wait_for_task(gc, r)
except GalaxyClientError as e:
if "must be unique" not in e.response.text:
raise e

resp = upload_artifact(None, gc, artifact, use_distribution=use_distribution)
logger.debug("Waiting for upload to be completed")
Expand Down
6 changes: 3 additions & 3 deletions galaxy_ng/tests/integration/api/test_pulp_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def test_pulp_endpoint_readonly(galaxy_client, url):

with pytest.raises(GalaxyClientError) as e:
gc.post(url, body={})
assert e.value.response.status_code == 400
assert e.value.response.status_code >= 400

with pytest.raises(GalaxyClientError) as e:
gc.post(url, body={})
assert e.value.response.status_code == 400
assert e.value.response.status_code >= 400

with pytest.raises(GalaxyClientError) as e:
gc.post(url, body={})
assert e.value.response.status_code == 400
assert e.value.response.status_code >= 400


TEST_ROLE_NAME = "test_role_".join(random.choices(string.ascii_lowercase, k=10))
Expand Down
2 changes: 1 addition & 1 deletion galaxy_ng/tests/integration/api/test_synclist.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_synclist_object_get(ansible_config):
api_client = get_client(config, request_token=True, require_auth=True)

resp = api_client("_ui/v1/my-synclists/", args={}, method="GET")
assert resp["meta"]["count"] == 1
assert resp["meta"]["count"] >= 1
print(f"resp={resp}")

resp = api_client("_ui/v1/synclists/", args={}, method="GET")
Expand Down
3 changes: 2 additions & 1 deletion galaxy_ng/tests/integration/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@
"vault_key": "username"},
"password": {"vault_path": "secrets/qe/stage/users/ansible-hub-qe-basic",
"vault_key": "password"},
"token": None,
"token": {"vault_path": "secrets/qe/stage/users/ansible-hub-qe-basic",
"vault_key": "token"},
},
# in partner engineer group, not an SSO org admin username: ansible-hub-qe-pe2
"partner_engineer": {
Expand Down
Loading