From 46034394fa02b1ccbfd7ce10377fc5f70c9e5c91 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 5 Nov 2023 09:06:21 -0500 Subject: [PATCH] chore: adjusts K6 test --- tests/Unit/Binary.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Binary.php b/tests/Unit/Binary.php index 1c4d7be..74e357c 100644 --- a/tests/Unit/Binary.php +++ b/tests/Unit/Binary.php @@ -4,8 +4,18 @@ use Pest\Stressless\ValueObjects\Binary; -it('infers the path from the environment', function (): void { +it('infers the path from the environment on mac OS', function (): void { $binary = Binary::k6(); - expect((string) $binary)->toBe(realpath(__DIR__.'/../../bin/k6-macos-arm64')); -}); + $arch = str_contains(php_uname('m'), 'arm') ? 'arm64' : 'amd64'; + + expect((string) $binary)->toBe(realpath(__DIR__.'/../../bin/k6-macos-'. $arch)); +})->skipOnLinux()->skipOnWindows(); + +it('infers the path from the environment on Linux', function (): void { + $binary = Binary::k6(); + + $arch = str_contains(php_uname('m'), 'arm') ? 'arm64' : 'amd64'; + + expect((string) $binary)->toBe(realpath(__DIR__.'/../../bin/k6-linux-'. $arch)); +})->skipOnMac()->skipOnWindows();