• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orchestral / dusk-updater / 40462920687

27 Oct 2026 06:44AM UTC coverage: 59.223% (-0.2%) from 59.406%
40462920687

push

github

web-flow
Install the arm64 ChromeDriver on Linux arm64 (#24)

* Install the arm64 ChromeDriver on Linux arm64

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

1 of 2 new or added lines in 1 file covered. (50.0%)

61 of 103 relevant lines covered (59.22%)

1.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/UpdateCommand.php
1
<?php
2

3
namespace Orchestra\DuskUpdater;
4

5
use Orchestra\DuskUpdaterApi\ChromeVersionFinder;
6
use Orchestra\DuskUpdaterApi\OperatingSystem;
7
use RuntimeException;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
use Symfony\Component\Console\Input\InputArgument;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Input\InputOption;
12
use Symfony\Component\Console\Output\OutputInterface;
13

14
/**
15
 * @copyright Originally created by Jonas Staudenmeir: https://github.com/staudenmeir/dusk-updater
16
 */
17
#[AsCommand(name: 'update', description: 'Install the ChromeDriver binary.')]
18
class UpdateCommand extends Command
19
{
20
    /** {@inheritDoc} */
21
    #[\Override]
22
    protected function configure(): void
23
    {
24
        $this->setName('update')
3 ✔
25
            ->setDescription('Install the ChromeDriver binary.')
3 ✔
26
            ->addArgument('version', InputArgument::OPTIONAL)
3 ✔
27
            ->addOption('all', null, InputOption::VALUE_NONE, 'Install a ChromeDriver binary for every OS');
3 ✔
28

29
        parent::configure();
3 ✔
30
    }
31

32
    /** {@inheritDoc} */
33
    #[\Override]
34
    protected function execute(InputInterface $input, OutputInterface $output): int
35
    {
36
        if (\is_null($this->directory)) {
3 ✔
37
            throw new RuntimeException('Unable to update ChromeDriver without --install-dir');
×
38
        }
39

40
        $finder = new ChromeVersionFinder;
3 ✔
41

42
        $version = $finder->findVersionUrl($input->getArgument('version'));
3 ✔
43
        $all = $input->getOption('all');
3 ✔
44
        $currentOS = OperatingSystem::id();
3 ✔
45

46
        foreach (OperatingSystem::all() as $operatingSystem) {
3 ✔
47
            if ($all || ($operatingSystem === $currentOS)) {
3 ✔
48
                if ($all && $operatingSystem === 'linux-arm' && version_compare($version, '153.0', '<')) {
3 ✔
NEW
49
                    continue;
×
50
                }
51

52
                $url = $finder->resolveChromeDriverDownloadUrl($version, $operatingSystem);
3 ✔
53
                $archive = (new Actions\DownloadChromeDriver($this->directory, $version))->handle($url);
3 ✔
54
                $binary = (new Actions\PublishChromeDriver($this->directory, $operatingSystem))->handle($archive);
2 ✔
55
            }
56
        }
57

58
        $output->writeln(\sprintf(
2 ✔
59
            '<info>ChromeDriver %s successfully installed for version %s.</info>', $all ? 'binaries' : 'binary', $version
2 ✔
60
        ));
2 ✔
61

62
        return self::SUCCESS;
2 ✔
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc