mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #1593 from AlanCoding/fix_processed
Fix bug with non-event model
This commit is contained in:
commit
1413659f5f
@ -930,7 +930,11 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
|
||||
'''
|
||||
if self.status in ACTIVE_STATES:
|
||||
return False # tally of events is only available at end of run
|
||||
return self.emitted_events == self.get_event_queryset().count()
|
||||
try:
|
||||
event_qs = self.get_event_queryset()
|
||||
except NotImplementedError:
|
||||
return True # Model without events, such as WFJT
|
||||
return self.emitted_events == event_qs.count()
|
||||
|
||||
def result_stdout_raw_handle(self, enforce_max_bytes=True):
|
||||
"""
|
||||
|
||||
@ -141,3 +141,16 @@ class TestMetaVars:
|
||||
)
|
||||
data = job.awx_meta_vars()
|
||||
assert data['awx_schedule_id'] == schedule.pk
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_event_processing_not_finished():
|
||||
job = Job.objects.create(emitted_events=2, status='finished')
|
||||
job.event_class.objects.create(job=job)
|
||||
assert not job.event_processing_finished
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_event_model_undefined():
|
||||
wj = WorkflowJob.objects.create(name='foobar', status='finished')
|
||||
assert wj.event_processing_finished
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user