Skip to content

Commit 33eb25e

Browse files
committed
fix: rename integration tests so they actually get run
1 parent 96c9332 commit 33eb25e

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,8 @@ jobs:
5151
- name: Start server
5252
run: (php -S localhost:8000 -t ./tests/Server &) || /bin/true
5353

54+
- name: Wait for server bootup
55+
run: sleep 3
56+
5457
- name: Execute tests
5558
run: vendor/bin/phpunit

tests/EngineTestCase.php renamed to tests/Core/EngineTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @see https://github.com/roach-php/roach
1212
*/
1313

14-
namespace RoachPHP\Tests;
14+
namespace RoachPHP\Tests\Core;
1515

1616
use RoachPHP\Core\Engine;
1717
use RoachPHP\Core\Run;
@@ -33,14 +33,15 @@
3333
use RoachPHP\Support\Configurable;
3434
use RoachPHP\Testing\Concerns\InteractsWithRequestsAndResponses;
3535
use RoachPHP\Testing\FakeLogger;
36+
use RoachPHP\Tests\IntegrationTestCase;
3637
use Symfony\Component\EventDispatcher\EventDispatcher;
3738

3839
/**
3940
* @internal
4041
*
4142
* @group integration
4243
*/
43-
final class EngineTestCase extends IntegrationTestCase
44+
final class EngineTest extends IntegrationTestCase
4445
{
4546
use InteractsWithRequestsAndResponses;
4647

tests/Downloader/Middleware/ExecuteJavascriptMiddlewareTestCase.php renamed to tests/Downloader/Middleware/ExecuteJavascriptMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* @internal
2525
*/
26-
final class ExecuteJavascriptMiddlewareTestCase extends IntegrationTestCase
26+
final class ExecuteJavascriptMiddlewareTest extends IntegrationTestCase
2727
{
2828
use InteractsWithRequestsAndResponses;
2929

tests/Downloader/Middleware/RobotsTxtMiddlewareTestCase.php renamed to tests/Downloader/Middleware/RobotsTxtMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* @internal
3535
*/
36-
final class RobotsTxtMiddlewareTestCase extends IntegrationTestCase
36+
final class RobotsTxtMiddlewareTest extends IntegrationTestCase
3737
{
3838
use InteractsWithRequestsAndResponses;
3939

tests/IntegrationTestCase.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ protected function setUp(): void
2929
$this->skipIfServerNotRunning();
3030

3131
try {
32-
\unlink(__DIR__ . '/Server/tmp/crawled.json');
32+
@\unlink(__DIR__ . '/Server/tmp/crawled.json');
3333
} catch (Throwable) {
3434
}
3535
}
3636

3737
protected function skipIfServerNotRunning(): void
3838
{
39-
try {
40-
\file_get_contents("{$this->serverUrl}/ping");
41-
} catch (Throwable) {
39+
if (false === @\file_get_contents("{$this->serverUrl}/ping")) {
4240
self::markTestSkipped('Skipping integration test. Server not running.');
4341
}
4442
}

0 commit comments

Comments
 (0)