#1427 - EMR - Return start time of first step

This commit is contained in:
Bert Blommers 2020-02-20 08:59:21 +00:00
parent 954004669a
commit 7205ab7785
3 changed files with 9 additions and 2 deletions

View File

@ -86,6 +86,9 @@ class FakeStep(BaseModel):
self.start_datetime = None
self.state = state
def start(self):
self.start_datetime = datetime.now(pytz.utc)
class FakeCluster(BaseModel):
def __init__(
@ -204,6 +207,8 @@ class FakeCluster(BaseModel):
self.start_cluster()
self.run_bootstrap_actions()
if self.steps:
self.steps[0].start()
@property
def instance_groups(self):

View File

@ -835,7 +835,7 @@ LIST_STEPS_TEMPLATE = """<ListStepsResponse xmlns="http://elasticmapreduce.amazo
{% if step.end_datetime is not none %}
<EndDateTime>{{ step.end_datetime.isoformat() }}</EndDateTime>
{% endif %}
{% if step.ready_datetime is not none %}
{% if step.start_datetime is not none %}
<StartDateTime>{{ step.start_datetime.isoformat() }}</StartDateTime>
{% endif %}
</Timeline>

View File

@ -752,7 +752,9 @@ def test_steps():
# StateChangeReason
x["Status"]["Timeline"]["CreationDateTime"].should.be.a("datetime.datetime")
# x['Status']['Timeline']['EndDateTime'].should.be.a('datetime.datetime')
# x['Status']['Timeline']['StartDateTime'].should.be.a('datetime.datetime')
# Only the first step will have started - we don't know anything about when it finishes, so the second step never starts
if x["Name"] == "My wordcount example":
x["Status"]["Timeline"]["StartDateTime"].should.be.a("datetime.datetime")
x = client.describe_step(ClusterId=cluster_id, StepId=x["Id"])["Step"]
x["ActionOnFailure"].should.equal("TERMINATE_CLUSTER")