Skip to content

Commit

Permalink
Merge pull request lmc-eu#18 from OndraM/feature/symfony-2.7
Browse files Browse the repository at this point in the history
Upgrade to Symfony 2.7
  • Loading branch information
OndraM committed May 31, 2015
2 parents fafab93 + 7388869 commit 12c13ac
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Changed
- The `logs/results.xml` could now be also accessed locally (the XSLT is now embedded right into the file, so we don't encounter same-origin policy problems).
- Use tagged version 0.6.0 of [php-webdriver](https://github.com/facebook/php-webdriver).
- Upgraded to Symfony 2.7 (causing eg. the `--help` format to change a bit - according to [docopt](http://docopt.org/) standard)

### Fixed
- Properly trigger PHPUnit colored (ANSI) mode when Steward itself is in ANSI mode.
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
"phpunit/phpunit": "4.6.*",
"ext-zip": "*",
"ext-curl": "*",
"symfony/console": "~2.6",
"symfony/process": "~2.6",
"symfony/finder": "~2.6",
"symfony/event-dispatcher": "~2.6",
"symfony/console": "~2.7",
"symfony/process": "~2.7",
"symfony/finder": "~2.7",
"symfony/event-dispatcher": "~2.7",
"nette/reflection": "~2.2",
"nette/utils": "~2.2",
"facebook/webdriver": "~0.6.0",
"clue/graph": "~0.7.1",
"clue/graph": "~0.9.0",
"graphp/algorithms": "^0.8.1",
"florianwolters/component-util-singleton": "0.3.2",
"caseyamcl/configula": "~2.3",
"doctrine/inflector": "~1.0"
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Component/AbstractComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AbstractComponentTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->testCase = $this->getMockBuilder('Lmc\Steward\Test\AbstractTestCase')
$this->testCase = $this->getMockBuilder(AbstractTestCase::class)
->setMethods(null)
->getMock();

Expand Down
2 changes: 1 addition & 1 deletion src-tests/Component/LegacyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LegacyTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->testCase = $this->getMockBuilder('Lmc\Steward\Test\AbstractTestCase')
$this->testCase = $this->getMockBuilder(AbstractTestCase::class)
->setMethods(['getName'])
->getMock();

Expand Down
4 changes: 3 additions & 1 deletion src-tests/Process/Fixtures/MockOrderStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Lmc\Steward\Process\Fixtures;

use Fhaculty\Graph\Algorithm\Tree\OutTree;
use Fhaculty\Graph\Vertex;
use Graphp\Algorithms\Tree\OutTree;
use Lmc\Steward\Process\OptimizeOrderInterface;

class MockOrderStrategy implements OptimizeOrderInterface
Expand All @@ -19,6 +20,7 @@ public function optimize(OutTree $tree)

$i = 0;
$output = [];
/** @var Vertex $vertex */
foreach ($vertices as $vertex) {
$output[$vertex->getId()] = $i++;
}
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Process/MaxTotalDelayStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lmc\Steward\Process;

use Fhaculty\Graph\Algorithm\Tree\OutTree;
use Graphp\Algorithms\Tree\OutTree;
use Fhaculty\Graph\Graph;

class MaxTotalDelayStrategyTest extends \PHPUnit_Framework_TestCase
Expand Down
7 changes: 4 additions & 3 deletions src-tests/Process/ProcessSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Lmc\Steward\Process;

use Graphp\Algorithms\Tree\OutTree;
use Lmc\Steward\Process\Fixtures\MockOrderStrategy;
use Lmc\Steward\Publisher\XmlPublisher;
use Symfony\Component\Console\Output\BufferedOutput;
Expand Down Expand Up @@ -151,9 +152,9 @@ public function testShouldAddAndGetProcess()
$this->assertArrayHasKey('Baz', $processes);

$process = $processes['Baz'];
$this->assertInstanceOf('stdClass', $process);
$this->assertInstanceOf(\stdClass::class, $process);
$this->assertEquals(ProcessSet::PROCESS_STATUS_QUEUED, $process->status);
$this->assertInstanceOf('Symfony\Component\Process\Process', $process->process);
$this->assertInstanceOf(Process::class, $process->process);
$this->assertEquals('Foo', $process->delayAfter);
$this->assertEquals(5, $process->delayMinutes);
$this->assertNull($process->finishedTime);
Expand Down Expand Up @@ -294,7 +295,7 @@ public function testShouldBuildGraphTreeFromProcessDependencies()


$tree = $this->set->buildTree();
$this->assertInstanceOf('Fhaculty\Graph\Algorithm\Tree\OutTree', $tree);
$this->assertInstanceOf(OutTree::class, $tree);

$this->assertEquals(2, $tree->getHeight()); // 2, because single vertex graph has height 0
$root = $tree->getVertexRoot();
Expand Down
10 changes: 5 additions & 5 deletions src-tests/Publisher/XmlPublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public function testShouldAddTestResultToEmptyFile()
$fullXml = simplexml_load_file($fileName);
$xml = $fullXml[0];

$this->assertInstanceOf('\SimpleXMLElement', $xml->testcase);
$this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase);
$this->assertEquals('testCaseNameFoo', $xml->testcase['name']);

$this->assertInstanceOf('\SimpleXMLElement', $xml->testcase->test);
$this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase->test);
$this->assertEquals(1, count($xml->testcase->test));

$this->assertEquals('testNameBar', $xml->testcase->test['name']);
Expand Down Expand Up @@ -135,7 +135,7 @@ public function testShouldUpdateTestStatusWhenTestIsDone($params)
$xml = simplexml_load_file($fileName)[0];

// still only one test result is present
$this->assertInstanceOf('\SimpleXMLElement', $xml->testcase->test);
$this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase->test);
$this->assertEquals(1, count($xml->testcase->test));

// the status is now updated and result is set
Expand All @@ -159,7 +159,7 @@ public function testShouldAddTestcaseResultToEmptyFile()
/** @var \SimpleXMLElement $xml */
$xml = simplexml_load_file($fileName)[0];

$this->assertInstanceOf('\SimpleXMLElement', $xml->testcase);
$this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase);
$this->assertEquals('testCaseNameFoo', $xml->testcase['name']);
$this->assertEquals('queued', $xml->testcase['status']);
$this->assertEmpty($xml->testcase->test['result']);
Expand Down Expand Up @@ -189,7 +189,7 @@ public function testShouldUpdateTestcaseStatusWhenDone($params)
/** @var \SimpleXMLElement $xml */
$xml = simplexml_load_file($fileName)[0];

$this->assertInstanceOf('\SimpleXMLElement', $xml->testcase);
$this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase);
$this->assertEquals('testCaseNameFoo', $xml->testcase['name']);
$this->assertEquals('done', $xml->testcase['status']);
$this->assertEquals('passed', $xml->testcase['result']);
Expand Down
3 changes: 3 additions & 0 deletions src/Console/Command/RunTestsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ protected function configure()
'Publish test results to test storage'
);

$this->addUsage('staging firefox');
$this->addUsage('--group=foo --group=bar --exclude-group=baz -vvv development phantomjs');

$this->getDispatcher()->dispatch(CommandEvents::CONFIGURE, new BasicConsoleEvent($this));
}

Expand Down
6 changes: 4 additions & 2 deletions src/Process/MaxTotalDelayStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace Lmc\Steward\Process;

use Fhaculty\Graph\Algorithm\ShortestPath\Dijkstra;
use Fhaculty\Graph\Algorithm\Tree\OutTree;
use Graphp\Algorithms\ShortestPath\Dijkstra;
use Graphp\Algorithms\Tree\OutTree;
use Fhaculty\Graph\Vertex;

class MaxTotalDelayStrategy implements OptimizeOrderInterface
{
Expand All @@ -24,6 +25,7 @@ public function optimize(OutTree $tree)

// for each vertex (process) get maximum total weight of its subtree (longest distance)
$subTreeMaxDistances = [];
/** @var Vertex $childVertex */
foreach ($children as $childVertex) {
$alg = new Dijkstra($childVertex);
// get map with distances to all linked reachable vertexes
Expand Down
2 changes: 1 addition & 1 deletion src/Process/OptimizeOrderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lmc\Steward\Process;

use Fhaculty\Graph\Algorithm\Tree\OutTree;
use Graphp\Algorithms\Tree\OutTree;

/**
* Interface for optimizers of tests order.
Expand Down
2 changes: 1 addition & 1 deletion src/Process/ProcessSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lmc\Steward\Process;

use Fhaculty\Graph\Algorithm\Tree\OutTree;
use Graphp\Algorithms\Tree\OutTree;
use Fhaculty\Graph\Graph;
use Lmc\Steward\Publisher\AbstractPublisher;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down

0 comments on commit 12c13ac

Please sign in to comment.