Skip to content

Commit

Permalink
Modify argument name from worker to worker-name
Browse files Browse the repository at this point in the history
  • Loading branch information
rcousens committed Jul 2, 2015
1 parent 985be3c commit 2365f37
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Tests/Functional/RunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testRun()
$this->em->persist($b);
$this->em->flush();

$output = $this->doRun(array('--max-runtime' => 5, '--worker' => 'test'));
$output = $this->doRun(array('--max-runtime' => 5, '--worker-name' => 'test'));
$expectedOutput = "Started Job(id = 1, command = \"a\").\n"
."Job(id = 1, command = \"a\") finished with exit code 1.\n";
$this->assertEquals($expectedOutput, $output);
Expand All @@ -34,7 +34,7 @@ public function testRun()
public function testExitsAfterMaxRuntime()
{
$time = time();
$output = $this->doRun(array('--max-runtime' => 1, '--worker' => 'test'));
$output = $this->doRun(array('--max-runtime' => 1, '--worker-name' => 'test'));
$this->assertEquals('', $output);

$runtime = time() - $time;
Expand All @@ -47,7 +47,7 @@ public function testSuccessfulCommand()
$this->em->persist($job);
$this->em->flush($job);

$this->doRun(array('--max-runtime' => 1, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--worker-name' => 'test'));
$this->assertEquals('finished', $job->getState());
}

Expand All @@ -64,7 +64,7 @@ public function testQueueWithLimitedConcurrentJobs()

$this->em->flush();

$this->doRun(array('--max-runtime' => 15, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 15, '--worker-name' => 'test'));

$output = file_get_contents($outputFile);
unlink($outputFile);
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testSingleRestrictedQueue()
$this->em->persist($c);
$this->em->flush();

$this->doRun(array('--max-runtime' => 1, '--queue' => array('other_queue'), '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--queue' => array('other_queue'), '--worker-name' => 'test'));
$this->assertEquals(Job::STATE_PENDING, $a->getState());
$this->assertEquals(Job::STATE_FINISHED, $b->getState());
$this->assertEquals(Job::STATE_PENDING, $c->getState());
Expand All @@ -150,7 +150,7 @@ public function testMultipleRestrictedQueues()
$this->em->persist($c);
$this->em->flush();

$this->doRun(array('--max-runtime' => 1, '--queue' => array('other_queue', 'yet_another_queue'), '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--queue' => array('other_queue', 'yet_another_queue'), '--worker-name' => 'test'));
$this->assertEquals(Job::STATE_PENDING, $a->getState());
$this->assertEquals(Job::STATE_FINISHED, $b->getState());
$this->assertEquals(Job::STATE_FINISHED, $c->getState());
Expand All @@ -169,7 +169,7 @@ public function testNoRestrictedQueue()
$this->em->persist($c);
$this->em->flush();

$this->doRun(array('--max-runtime' => 1, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--worker-name' => 'test'));
$this->assertEquals(Job::STATE_FINISHED, $a->getState());
$this->assertEquals(Job::STATE_FINISHED, $b->getState());
$this->assertEquals(Job::STATE_FINISHED, $c->getState());
Expand All @@ -185,7 +185,7 @@ public function testRetry()
$this->em->persist($job);
$this->em->flush($job);

$this->doRun(array('--max-runtime' => 12, '--verbose' => null, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 12, '--verbose' => null, '--worker-name' => 'test'));

$this->assertEquals('finished', $job->getState());
$this->assertGreaterThan(0, count($job->getRetryJobs()));
Expand All @@ -201,7 +201,7 @@ public function testJobIsTerminatedIfMaxRuntimeIsExceeded()
$this->em->persist($job);
$this->em->flush($job);

$this->doRun(array('--max-runtime' => 1, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--worker-name' => 'test'));
$this->assertEquals('terminated', $job->getState());
}

Expand All @@ -217,7 +217,7 @@ public function testJobsWithHigherPriorityAreStartedFirst()
$this->em->persist($job);
$this->em->flush();

$output = $this->doRun(array('--max-runtime' => 4, '--worker' => 'test'));
$output = $this->doRun(array('--max-runtime' => 4, '--worker-name' => 'test'));

$this->assertEquals(<<<OUTPUT
Started Job(id = 2, command = "jms-job-queue:successful-cmd").
Expand All @@ -243,7 +243,7 @@ public function testJobsAreStartedInCreationOrderWhenPriorityIsEqual()
$this->em->persist($job);
$this->em->flush();

$output = $this->doRun(array('--max-runtime' => 4, '--worker' => 'test'));
$output = $this->doRun(array('--max-runtime' => 4, '--worker-name' => 'test'));

$this->assertEquals(<<<OUTPUT
Started Job(id = 1, command = "jms-job-queue:successful-cmd").
Expand Down Expand Up @@ -271,7 +271,7 @@ public function testExceptionStackTraceIsSaved()
$this->assertNull($job->getMemoryUsage());
$this->assertNull($job->getMemoryUsageReal());

$this->doRun(array('--max-runtime' => 1, '--worker' => 'test'));
$this->doRun(array('--max-runtime' => 1, '--worker-name' => 'test'));

$this->assertNotNull($job->getStackTrace());
$this->assertNotNull($job->getMemoryUsage());
Expand Down

0 comments on commit 2365f37

Please sign in to comment.