Skip to content

Commit

Permalink
Check if K6 exists, otherwise download it and warn the user that a do…
Browse files Browse the repository at this point in the history
…wnload is in progress
  • Loading branch information
nahime0 committed Nov 7, 2023
1 parent f028f76 commit 82b4e6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Pest\Exceptions\ShouldNotHappen;
use Pest\Stressless\Binaries\K6;
use Pest\Stressless\Printers\Detail;
use Pest\Stressless\Printers\Info;
use Pest\Stressless\Printers\Progress;
use RuntimeException;
use Symfony\Component\Process\Process;
Expand Down Expand Up @@ -49,6 +50,12 @@ public function start(): Result
$duration,
);

if(!K6::exists()) {
$info = new Info();
$info->print("First run...<br>Downloading needed binary...");
K6::download();
}

$process = new Process([
K6::new(), 'run', 'run.js', '--out', "json={$this->session->progressPath()}",
], $basePath.'/bin', [
Expand Down

0 comments on commit 82b4e6a

Please sign in to comment.