Skip to content

Commit cce5cf5

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

File tree

5 files changed

+7
-266
lines changed

5 files changed

+7
-266
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/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/EngineTestCase.php

Lines changed: 0 additions & 260 deletions
This file was deleted.

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)