diff --git a/CHANGES/1369.bugfix b/CHANGES/1369.bugfix new file mode 100644 index 000000000..f8b0f6b1f --- /dev/null +++ b/CHANGES/1369.bugfix @@ -0,0 +1 @@ +Renamed duplicate 'Downloading Artifacts' sync progress report message to 'Downloading Docs Blob'. diff --git a/pulp_ansible/app/tasks/collections.py b/pulp_ansible/app/tasks/collections.py index 277bd6533..e40ccc15f 100644 --- a/pulp_ansible/app/tasks/collections.py +++ b/pulp_ansible/app/tasks/collections.py @@ -42,6 +42,7 @@ DeclarativeArtifact, DeclarativeContent, DeclarativeVersion, + GenericDownloader, QueryExistingArtifacts, QueryExistingContents, RemoteArtifactSaver, @@ -1016,7 +1017,7 @@ async def run(self): pb.total = pb.done -class DocsBlobDownloader(ArtifactDownloader): +class DocsBlobDownloader(GenericDownloader): """ Stage for downloading docs_blob. @@ -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. diff --git a/pulp_ansible/tests/functional/api/collection/test_sync.py b/pulp_ansible/tests/functional/api/collection/test_sync.py index a6c05ae11..3ba960fb3 100644 --- a/pulp_ansible/tests/functional/api/collection/test_sync.py +++ b/pulp_ansible/tests/functional/api/collection/test_sync.py @@ -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