Skip to content

Commit

Permalink
Merge branch 'release/4.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan goswami committed Jun 5, 2024
2 parents df38531 + d0f159f commit 32cbf3d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 34 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,31 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug

- name: Install google-chrome-stable
run: |
# Remove existing google chrome and install required version.
sudo dpkg -r google-chrome-stable
CHROME_VERSION_STRING="114.0.5735.198-1"
wget --no-verbose -O /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION_STRING}_amd64.deb" \
&& sudo apt install -y /tmp/chrome.deb \
&& sudo rm /tmp/chrome.deb
sudo echo "CHROME_BIN=/usr/bin/google-chrome" | sudo tee -a /etc/environment
# Download and unpack chromedriver.
CHROME_DRIVER_VERSION_STRING="114.0.5735.90"
CHROMEDRIVER_ARCHIVE="chromedriver_linux64.zip"
CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION_STRING}/${CHROMEDRIVER_ARCHIVE}"
CHROMEDRIVER_DIR="/usr/local/share/chromedriver-linux64"
CHROMEDRIVER_BIN="$CHROMEDRIVER_DIR/chromedriver"
sudo rm -rf $CHROMEDRIVER_DIR
sudo mkdir $CHROMEDRIVER_DIR
echo "Installing chromedriver version"
wget --no-verbose -O /tmp/$CHROMEDRIVER_ARCHIVE $CHROMEDRIVER_URL
sudo unzip -qq /tmp/$CHROMEDRIVER_ARCHIVE -d $CHROMEDRIVER_DIR
sudo chmod +x $CHROMEDRIVER_BIN
sudo ln -sf "$CHROMEDRIVER_BIN" /usr/bin/
sudo echo "CHROMEWEBDRIVER=$CHROMEDRIVER_DIR" | sudo tee -a /etc/environment
# Commenting out to use the latest chrome and chromedriver versions.
# - name: Install google-chrome-stable
# run: |
# # Remove existing google chrome and install required version.
# sudo dpkg -r google-chrome-stable
# CHROME_VERSION_STRING="114.0.5735.198-1"
# wget --no-verbose -O /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION_STRING}_amd64.deb" \
# && sudo apt install -y /tmp/chrome.deb \
# && sudo rm /tmp/chrome.deb
# sudo echo "CHROME_BIN=/usr/bin/google-chrome" | sudo tee -a /etc/environment
#
# # Download and unpack chromedriver.
# CHROME_DRIVER_VERSION_STRING="114.0.5735.90"
# CHROMEDRIVER_ARCHIVE="chromedriver_linux64.zip"
# CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION_STRING}/${CHROMEDRIVER_ARCHIVE}"
# CHROMEDRIVER_DIR="/usr/local/share/chromedriver-linux64"
# CHROMEDRIVER_BIN="$CHROMEDRIVER_DIR/chromedriver"
# sudo rm -rf $CHROMEDRIVER_DIR
# sudo mkdir $CHROMEDRIVER_DIR
# echo "Installing chromedriver version"
# wget --no-verbose -O /tmp/$CHROMEDRIVER_ARCHIVE $CHROMEDRIVER_URL
# sudo unzip -qq /tmp/$CHROMEDRIVER_ARCHIVE -d $CHROMEDRIVER_DIR
# sudo chmod +x $CHROMEDRIVER_BIN
# sudo ln -sf "$CHROMEDRIVER_BIN" /usr/bin/
# sudo echo "CHROMEWEBDRIVER=$CHROMEDRIVER_DIR" | sudo tee -a /etc/environment

- name: Before install
run: |
Expand Down
1 change: 0 additions & 1 deletion .idea/orca.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.9.0
v4.10.0
2 changes: 1 addition & 1 deletion src/Domain/Tool/Phploc/PhplocFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function execute(string $path): void {
$args[] = '--suffix=' . $extension;
}
$args[] = '.';
$this->processRunner->runOrcaVendorBin($args, $path);
$this->processRunner->runOrcaVendorBin($args, $path, TRUE);
}

}
12 changes: 8 additions & 4 deletions src/Helper/Process/ProcessRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ public function __construct(FixturePathHandler $fixture_path_handler, SymfonySty
* @param string|null $cwd
* The working directory, or NULL to use the working dir of the current PHP
* process.
* @param bool $allow_failure
* Allow the process to fail.
*
* @return int
* The exit status code.
*
* @throws \Symfony\Component\Process\Exception\ProcessFailedException
* If the process is unsuccessful.
*/
public function run(Process $process, ?string $cwd = NULL): int {
public function run(Process $process, ?string $cwd = NULL, bool $allow_failure = FALSE): int {
$this->output->writeln(sprintf('> %s', $process->getCommandLine()));

if ($cwd) {
Expand All @@ -90,7 +92,7 @@ public function run(Process $process, ?string $cwd = NULL): int {
$this->output->write($buffer);
});

if (!$process->isSuccessful()) {
if (!$allow_failure && !$process->isSuccessful()) {
$process->disableOutput();
throw new ProcessFailedException($process);
}
Expand Down Expand Up @@ -194,13 +196,15 @@ public function runOrca(array $command): int {
* name.
* @param string|null $cwd
* The working directory, or NULL to use the fixture directory.
* @param bool $allow_failure
* Allow the process to fail.
*
* @return int
* The exit status code.
*/
public function runOrcaVendorBin(array $command, ?string $cwd = NULL): int {
public function runOrcaVendorBin(array $command, ?string $cwd = NULL, bool $allow_failure = FALSE): int {
$process = $this->createOrcaVendorBinProcess($command);
return $this->run($process, $cwd);
return $this->run($process, $cwd, $allow_failure);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Domain/Tool/Phploc/PhplocFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp(): void {
->willReturnArgument();
$this->processRunner = $this->prophesize(ProcessRunner::class);
$this->processRunner
->runOrcaVendorBin(Argument::any(), Argument::any())
->runOrcaVendorBin(Argument::cetera())
->willReturn(0);
}

Expand Down Expand Up @@ -57,7 +57,7 @@ public function testCommand($path): void {
'--suffix=.profile',
'--suffix=.engine',
'.',
], $path)
], $path, TRUE)
->shouldBeCalledOnce();

$phploc->execute($path);
Expand Down

0 comments on commit 32cbf3d

Please sign in to comment.