Skip to content
Merged
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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
php: [8.0 ,8.1 ,8.2, 8.3, 8.4]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion src/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Platform
{
private const BINARY_NAME = 'volt-test';

private const ENGINE_CURRENT_VERSION = 'v0.0.1';
private const ENGINE_CURRENT_VERSION = 'v0.1.0';
private const BASE_DOWNLOAD_URL = 'https://github.com/volt-test/binaries/releases/download';
private const SUPPORTED_PLATFORMS = [
'linux-amd64' => 'volt-test-linux-amd64',
Expand Down
52 changes: 52 additions & 0 deletions tests/VoltTestTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

namespace Tests;

use PHPUnit\Framework\TestCase;
use VoltTest\Exceptions\ErrorHandler;
use VoltTest\VoltTest;

class VoltTestTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
// Ensure error handlers are registered at the start of each test
ErrorHandler::register();
}

protected function tearDown(): void
{
// Clean up error handlers after each test
ErrorHandler::unregister();
parent::tearDown();
}

public function testVoltTest()
{
$voltTest = new VoltTest("test");
$voltTest->setVirtualUsers(1);

// Create first scenario
$scenario1 = $voltTest->scenario("Test Scenario")->setWeight(100);
$scenario1->step("Step 1")
->get('https://www.google.com')
->setThinkTime('1s')
->validateStatus('success', 200);

$scenario1->step("Step 2")
->get('https://www.google.com')
->setThinkTime('1s')
->validateStatus('success', 200);

$result = $voltTest->run(true);

// Verify response time metrics
$avgResponseTime = $result->getAvgResponseTime();
var_dump($avgResponseTime);
if ($avgResponseTime !== null) {
$this->assertStringContainsString('ms', $avgResponseTime, "Average response time should contain 'ms'");
}

}
}