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

Github Status reporting Test fix #5914

Merged
merged 1 commit into from
Jul 11, 2019
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
6 changes: 3 additions & 3 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def run_build(self, docker, record):
version=self.version, build_pk=self.build['id'], status=BUILD_STATUS_SUCCESS
)
else:
msg = 'Unhandled Build Status'
msg = 'Unhandled Build Status'
log.warning(
LOG_TEMPLATE,
{
Expand Down Expand Up @@ -1813,7 +1813,7 @@ def send_build_status(build_pk, status):
Send Build Status to Git Status API for project external versions.

:param build_pk: Build primary key
:param status: build status failed, pending, or success to be sent.
:param status: build status failed, pending, or success to be sent.
"""
build = Build.objects.get(pk=build_pk)
try:
Expand All @@ -1824,7 +1824,7 @@ def send_build_status(build_pk, status):
)

# send Status report using the API.
service.send_build_status(build, state)
service.send_build_status(build, status)

except RemoteRepository.DoesNotExist:
log.info('Remote repository does not exist for %s', build.project)
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def test_send_build_status_task(self, send_build_status):
external_build = get(
Build, project=self.project, version=external_version
)
tasks.send_build_status(external_build, BUILD_STATUS_SUCCESS)
tasks.send_build_status(external_build.id, BUILD_STATUS_SUCCESS)

send_build_status.assert_called_once_with(external_build, BUILD_STATUS_SUCCESS)

Expand All @@ -353,6 +353,6 @@ def test_send_build_status_task_without_remote_repo(self, send_build_status):
external_build = get(
Build, project=self.project, version=external_version
)
tasks.send_build_status(external_build, BUILD_STATUS_SUCCESS)
tasks.send_build_status(external_build.id, BUILD_STATUS_SUCCESS)

send_build_status.assert_not_called()
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_projects_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_send_external_build_status_with_external_version(self, send_build_statu
send_external_build_status(self.external_version,
self.external_build.id, BUILD_STATUS_SUCCESS)

send_build_status.delay.assert_called_once_with(self.external_build, BUILD_STATUS_SUCCESS)
send_build_status.delay.assert_called_once_with(self.external_build.id, BUILD_STATUS_SUCCESS)

@patch('readthedocs.projects.tasks.send_build_status')
def test_send_external_build_status_with_internal_version(self, send_build_status):
Expand Down