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

Rename duplicate Downloading Artifacts Progress Report #1370

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions CHANGES/1369.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Renamed duplicate 'Downloading Artifacts' sync progress report message to 'Downloading Docs Blob'.
6 changes: 5 additions & 1 deletion pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
DeclarativeArtifact,
DeclarativeContent,
DeclarativeVersion,
GenericDownloader,
QueryExistingArtifacts,
QueryExistingContents,
RemoteArtifactSaver,
Expand Down Expand Up @@ -1016,7 +1017,7 @@ async def run(self):
pb.total = pb.done


class DocsBlobDownloader(ArtifactDownloader):
class DocsBlobDownloader(GenericDownloader):
"""
Stage for downloading docs_blob.

Expand All @@ -1028,6 +1029,9 @@ class DocsBlobDownloader(ArtifactDownloader):
kwargs: unused keyword arguments passed along to :class:`~pulpcore.plugin.stages.Stage`.
"""

PROGRESS_REPORTING_MESSAGE = "Downloading Docs Blob"
PROGRESS_REPORTING_CODE = "sync.downloading.docs_blob"

async def _handle_content_unit(self, d_content):
"""Handle one content unit.

Expand Down
33 changes: 33 additions & 0 deletions pulp_ansible/tests/functional/api/collection/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,36 @@ def test_last_synced_metadata_time(
)
repository = ansible_repo_api_client.read(repository.pulp_href)
assert repository.last_synced_metadata_time is None


@pytest.mark.parallel
def test_sync_progress_report(
ansible_repo_api_client,
ansible_repo,
ansible_collection_remote_factory,
monitor_task,
):
"""Checks that the progress report messages are correct."""
remote = ansible_collection_remote_factory(
url="https://galaxy.ansible.com",
requirements_file="collections:\n - robertdebock.ansible_development_environment",
sync_dependencies=False,
signed_only=False,
)
body = {"remote": remote.pulp_href}
task = monitor_task(ansible_repo_api_client.sync(ansible_repo.pulp_href, body).task)

progress_reports = task.progress_reports
assert len(progress_reports) == 4
messages = {pr.message for pr in progress_reports}

assert messages == {
"Parsing CollectionVersion Metadata",
"Downloading Artifacts",
"Downloading Docs Blob",
"Associating Content",
}

for pr in progress_reports:
if pr.message == "Parsing CollectionVersion Metadata":
assert pr.total == pr.done