Skip to content

Commit

Permalink
Rename duplicate Downloading Artifacts Progress Report
Browse files Browse the repository at this point in the history
fixes: pulp#1369
Requires PR: pulp/pulpcore#3597
  • Loading branch information
gerrod3 committed Feb 22, 2023
1 parent 46b783f commit 841fa0c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
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

0 comments on commit 841fa0c

Please sign in to comment.