Skip to content

Commit 71c5796

Browse files
authored
release/v0.1.2 (#14)
* update engine version * Adding test for volt test to check different os * wsl not working in ci * confirm that the volt test engine working
1 parent 63fec26 commit 71c5796

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-latest, windows-latest, macos-latest]
19+
os: [ubuntu-latest, macos-latest]
2020
php: [8.0 ,8.1 ,8.2, 8.3, 8.4]
2121
steps:
2222
- uses: actions/checkout@v4

src/Platform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Platform
66
{
77
private const BINARY_NAME = 'volt-test';
88

9-
private const ENGINE_CURRENT_VERSION = 'v0.0.1';
9+
private const ENGINE_CURRENT_VERSION = 'v0.1.0';
1010
private const BASE_DOWNLOAD_URL = 'https://github.com/volt-test/binaries/releases/download';
1111
private const SUPPORTED_PLATFORMS = [
1212
'linux-amd64' => 'volt-test-linux-amd64',

tests/VoltTestTest.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use VoltTest\Exceptions\ErrorHandler;
7+
use VoltTest\VoltTest;
8+
9+
class VoltTestTest extends TestCase
10+
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
// Ensure error handlers are registered at the start of each test
15+
ErrorHandler::register();
16+
}
17+
18+
protected function tearDown(): void
19+
{
20+
// Clean up error handlers after each test
21+
ErrorHandler::unregister();
22+
parent::tearDown();
23+
}
24+
25+
public function testVoltTest()
26+
{
27+
$voltTest = new VoltTest("test");
28+
$voltTest->setVirtualUsers(1);
29+
30+
// Create first scenario
31+
$scenario1 = $voltTest->scenario("Test Scenario")->setWeight(100);
32+
$scenario1->step("Step 1")
33+
->get('https://www.google.com')
34+
->setThinkTime('1s')
35+
->validateStatus('success', 200);
36+
37+
$scenario1->step("Step 2")
38+
->get('https://www.google.com')
39+
->setThinkTime('1s')
40+
->validateStatus('success', 200);
41+
42+
$result = $voltTest->run(true);
43+
44+
// Verify response time metrics
45+
$avgResponseTime = $result->getAvgResponseTime();
46+
var_dump($avgResponseTime);
47+
if ($avgResponseTime !== null) {
48+
$this->assertStringContainsString('ms', $avgResponseTime, "Average response time should contain 'ms'");
49+
}
50+
51+
}
52+
}

0 commit comments

Comments
 (0)