Skip to content

Commit

Permalink
Improves the download_content_unit test fixture.
Browse files Browse the repository at this point in the history
This change also modifies the CONTENT_PATH_PREFIX that is used for the Pulp under test in GHA workflows.

fixes: #5010
  • Loading branch information
dkliban authored and mdellweg committed Apr 4, 2024
1 parent 1f9d329 commit a3f2211
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ VARSYAML

cat >> vars/main.yaml << VARSYAML
pulp_env: {}
pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"], "orphan_protection_time": 0}
pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"], "content_path_prefix": "/somewhere/else/", "orphan_protection_time": 0}
pulp_scheme: https
pulp_default_container: ghcr.io/pulp/pulp-ci-centos9:latest
VARSYAML
Expand Down
1 change: 1 addition & 0 deletions CHANGES/5010.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved the `download_content_unit` test fixture.
13 changes: 8 additions & 5 deletions pulpcore/tests/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,11 @@ def pulp_content_origin(pulp_settings):
return pulp_settings.CONTENT_ORIGIN


@pytest.fixture(scope="session")
def pulp_content_origin_with_prefix(pulp_settings):
return pulp_settings.CONTENT_ORIGIN + pulp_settings.CONTENT_PATH_PREFIX[:-1]


@pytest.fixture(scope="session")
def pulp_api_v3_path(pulp_settings, pulp_domain_enabled):
if pulp_domain_enabled:
Expand Down Expand Up @@ -1243,7 +1248,7 @@ def _add_to_filesystem_cleanup(path):


@pytest.fixture(scope="session")
def download_content_unit(pulp_domain_enabled, pulp_content_origin):
def download_content_unit(pulp_domain_enabled, pulp_content_origin_with_prefix):
def _download_content_unit(base_path, content_path, domain="default"):
async def _get_response(url):
async with aiohttp.ClientSession() as session:
Expand All @@ -1252,16 +1257,14 @@ async def _get_response(url):

if pulp_domain_enabled:
url_fragments = [
pulp_content_origin,
"pulp/content",
pulp_content_origin_with_prefix,
domain,
base_path,
content_path,
]
else:
url_fragments = [
pulp_content_origin,
"pulp/content",
pulp_content_origin_with_prefix,
base_path,
content_path,
]
Expand Down
1 change: 1 addition & 0 deletions template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pulp_settings:
allowed_import_paths:
- /tmp
orphan_protection_time: 0
content_path_prefix: /somewhere/else/
pulp_settings_azure:
domain_enabled: true
pulp_settings_gcp: null
Expand Down

0 comments on commit a3f2211

Please sign in to comment.