Skip to content

Commit c5908ef

Browse files
committed
Using "@Medium" group to enforce time limit.
1 parent 196a7a9 commit c5908ef

File tree

36 files changed

+42
-80
lines changed

36 files changed

+42
-80
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
### Changed
9+
- "@medium" group to enforce time limit.
10+
711
## [3.3.0] - 2022-02-20
812
### Added
913
- Time limit.

ci/phpunit.dist.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
beStrictAboutTodoAnnotatedTests="true"
88
verbose="true"
99
colors="true"
10+
enforceTimeLimit="true"
11+
timeoutForMediumTests="6"
1012
>
1113
<coverage processUncoveredFiles="true">
1214
<include>

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
}
2121
],
2222
"require": {
23-
"php": "7.3.*",
24-
"phpunit/php-invoker": "^3.1"
23+
"php": "7.3.*"
2524
}
2625
}

composer.lock

Lines changed: 2 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Community/Training/Easy/ContainerTerminal/CGTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @covers \CyrilVerloop\Codingame\Community\Training\Easy\ContainerTerminal\ContainerTerminal
1414
* @group containerTerminal
15+
* @medium
1516
*/
1617
final class CGTest extends PuzzleTest
1718
{

tests/Community/Training/Easy/RectanglePartition/CGTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @covers \CyrilVerloop\Codingame\Community\Training\Easy\RectanglePartition\RectanglePartition
1414
* @group rectanglePartition
15+
* @medium
1516
*/
1617
final class CGTest extends PuzzleTest
1718
{

tests/Community/Training/Easy/RobotShow/CGTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @covers \CyrilVerloop\Codingame\Community\Training\Easy\RobotShow\RobotShow
1414
* @group robotShow
15+
* @medium
1516
*/
1617
final class CGTest extends PuzzleTest
1718
{

tests/Community/Training/Easy/RockPaperScissorsLizardSpock/CGTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @covers \CyrilVerloop\Codingame\Community\Training\Easy\RockPaperScissorsLizardSpock\RockPaperScissorsLizardSpock
1414
* @group rockPaperScissorsLizardSpock
15+
* @medium
1516
*/
1617
final class CGTest extends PuzzleTest
1718
{

tests/PuzzleTest.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,12 @@
55
namespace CyrilVerloop\Codingame\Tests;
66

77
use PHPUnit\Framework\TestCase;
8-
use SebastianBergmann\Invoker\Invoker;
98

109
/**
1110
* Base class for testing puzzles.
1211
*/
1312
abstract class PuzzleTest extends TestCase
1413
{
15-
// Constants :
16-
17-
/**
18-
* @var int the time limit in seconds.
19-
*/
20-
const TIME_LIMIT = 6;
21-
22-
2314
// Properties :
2415

2516
/** @var \CyrilVerloop\Codingame\Puzzle the puzzle. */
@@ -38,8 +29,7 @@ protected function expectExecuteOutputAnswer(string $filename, string $expectedA
3829
$stdin = fopen($filename, 'r');
3930

4031
$this->expectOutputString($expectedAnswer);
41-
42-
$invoker = new Invoker();
43-
$invoker->invoke([$this->puzzle, "execute"], [$stdin], self::TIME_LIMIT);
32+
33+
$this->puzzle->execute($stdin);
4434
}
4535
}

tests/Training/Easy/ASCIIArt/CGTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @covers \CyrilVerloop\Codingame\Training\Easy\ASCIIArt\ASCIIArt
1414
* @group ASCIIArt
15+
* @medium
1516
*/
1617
final class CGTest extends PuzzleTest
1718
{

0 commit comments

Comments
 (0)