Skip to content

Commit

Permalink
Deterministic reconstruction with no non-lifecycle events (#805)
Browse files Browse the repository at this point in the history
* Deterministic reconstruction with no non-lifecycle events

* got rid of unneeded lifecycle event check

* removed test for dead code path
chakrabortyr authored Feb 25, 2019

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
1 parent 79441e7 commit 668c1ad
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
@@ -101,10 +101,6 @@ protected function transform(array $srcRecord, &$orderId)
}
}

if (!in_array($srcRecord['event_type_id'], $this->_all_event_ids)) {
return array();
}

if ($this->_instance_state === null) {
if (in_array($srcRecord['event_type_id'], $this->_start_event_ids)) {
$this->initInstance($srcRecord);
@@ -137,7 +133,7 @@ protected function getSourceQueryString()
$colCount = count($this->etlSourceQuery->records);
$unionValues = array_fill(0, $colCount, 0);

$sql = "$sql \nUNION ALL\nSELECT " . implode(',', $unionValues) . "\nORDER BY 1 DESC, 2 DESC, 3 ASC";
$sql = "$sql WHERE event_type_id IN (" . implode(',', $this->_all_event_ids) . ")\nUNION ALL\nSELECT " . implode(',', $unionValues) . "\nORDER BY 1 DESC, 2 DESC, 3 ASC, 4 DESC";

return $sql;
}
Original file line number Diff line number Diff line change
@@ -121,15 +121,6 @@ public function testInvalidStart()
$this->assertEquals(array(), $this->fsm->transformHelper($this->event_err_res01));
}

// what happens when we hit a valid start and then invalid end event
public function testValidStartInvalidEnd()
{
$this->fsm->transformHelper($this->event_start_res01);
$event = $this->fsm->transformHelper($this->event_err_res01);

$this->assertEquals(array(), $event);
}

// what happens when we hit the dummy row
public function testZeroEvent()
{

0 comments on commit 668c1ad

Please sign in to comment.