mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
Namechange events_processed -> event_processing_finished
from PR review, also adding tests to assert that the value is passed from the stdout_handle to the UnifiedJob object on finalization of job run in tasks.py
This commit is contained in:
@@ -35,7 +35,7 @@ from awx.main.models import (
|
||||
|
||||
from awx.main import tasks
|
||||
from awx.main.queue import CallbackQueueDispatcher
|
||||
from awx.main.utils import encrypt_field, encrypt_value
|
||||
from awx.main.utils import encrypt_field, encrypt_value, OutputEventFilter
|
||||
|
||||
|
||||
|
||||
@@ -305,6 +305,15 @@ class TestGenericRun(TestJobExecution):
|
||||
]:
|
||||
assert c in self.task.update_model.call_args_list
|
||||
|
||||
def test_event_count(self):
|
||||
with mock.patch.object(self.task, 'get_stdout_handle') as mock_stdout:
|
||||
handle = OutputEventFilter(lambda event_data: None)
|
||||
handle._event_ct = 334
|
||||
mock_stdout.return_value = handle
|
||||
self.task.run(self.pk)
|
||||
|
||||
assert self.task.update_model.call_args[-1]['emitted_events'] == 334
|
||||
|
||||
def test_artifact_cleanup(self):
|
||||
path = tempfile.NamedTemporaryFile(delete=False).name
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user