Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parallel testing to GitHub action phpunit #187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
php artisan passport:keys

- name: "Run PHPUnit"
run: php artisan test --stop-on-failure --coverage-text --coverage-clover=coverage.xml
run: php artisan test --parallel --stop-on-failure --coverage-text --coverage-clover=coverage.xml

- name: "Upload coverage reports to Codecov"
uses: codecov/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
use Illuminate\Support\Facades\Http;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use Tests\TestCase;
use Tests\TestCaseWithDatabase;

#[CoversClass(SelfHostTelemetryCommand::class)]
#[CoversClass(ApiService::class)]
#[UsesClass(SelfHostTelemetryCommand::class)]
class SelfHostTelemetryCommandTest extends TestCase
class SelfHostTelemetryCommandTest extends TestCaseWithDatabase
{
public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_cloud(): void
{
Expand All @@ -30,9 +30,12 @@ public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_clo
$exitCode = $this->withoutMockingConsoleOutput()->artisan('self-host:telemetry');

// Assert
$this->assertSame(Command::SUCCESS, $exitCode);
$output = Artisan::output();
$this->assertSame('', $output);
if ($exitCode !== Command::SUCCESS) {
dump($output);
}
$this->assertSame(Command::SUCCESS, $exitCode);
}

public function test_telemetry_sends_fails_gracefully_if_response_has_error_status_code(): void
Expand Down
Loading