From 8e013fe2be2836ddf33d6142a4329e69e1b18c87 Mon Sep 17 00:00:00 2001 From: elwafa Date: Sun, 26 Jan 2025 00:42:49 +0200 Subject: [PATCH 1/3] Fix Parsing duration --- src/TestResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestResult.php b/src/TestResult.php index d6d398a..9d8e052 100644 --- a/src/TestResult.php +++ b/src/TestResult.php @@ -50,7 +50,7 @@ private function parseOutput(): void private function parseMainMetrics(): void { // Duration - if (preg_match('/Duration:\s+([\d.]+s)/', $this->rawOutput, $matches)) { + if (preg_match('/Duration:\s+([^\n]+)/', $this->rawOutput, $matches)) { $this->parsedResults['duration'] = $matches[1]; } From fc1e55b2e11a062855995eeefe63c3359b65cb10 Mon Sep 17 00:00:00 2001 From: elwafa Date: Sun, 26 Jan 2025 00:52:32 +0200 Subject: [PATCH 2/3] test result --- src/TestResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestResult.php b/src/TestResult.php index 9d8e052..6fb370b 100644 --- a/src/TestResult.php +++ b/src/TestResult.php @@ -50,7 +50,7 @@ private function parseOutput(): void private function parseMainMetrics(): void { // Duration - if (preg_match('/Duration:\s+([^\n]+)/', $this->rawOutput, $matches)) { + if (preg_match('/Duration:\s+([^\n]+)', $this->rawOutput, $matches)) { $this->parsedResults['duration'] = $matches[1]; } From 013a08bd59afbe6b4f237960c651a7f561579ac6 Mon Sep 17 00:00:00 2001 From: elwafa Date: Sun, 26 Jan 2025 00:56:37 +0200 Subject: [PATCH 3/3] Making duration accept ms|s|m|h --- src/TestResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestResult.php b/src/TestResult.php index 6fb370b..ebef8fa 100644 --- a/src/TestResult.php +++ b/src/TestResult.php @@ -50,7 +50,7 @@ private function parseOutput(): void private function parseMainMetrics(): void { // Duration - if (preg_match('/Duration:\s+([^\n]+)', $this->rawOutput, $matches)) { + if (preg_match('/Duration:\s+([\d.]+(?:ms|s|m|hr))/', $this->rawOutput, $matches)) { $this->parsedResults['duration'] = $matches[1]; }