From f47d8e48ddd231bf3521ac391b24f398aa440bdc Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 17 Jan 2021 17:57:29 +0100 Subject: [PATCH 1/5] Run tests on Windows too --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a46bb2a1..f38f8c36 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ jobs: matrix: os: - ubuntu-latest + - windows-latest php-version: - "7.2" - "7.3" From e12334fd5042c19278efe66759f094119da671f4 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 17 Jan 2021 17:54:28 +0100 Subject: [PATCH 2/5] Fix running tests on Windows --- features/bootstrap/FeatureContext.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index b1795b0b..b06fb36f 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -86,7 +86,11 @@ public function prepare() private function moveToNewPath($path) { - $newWorkingDir = $this->workingDir .'/' . $path; + if ((string) $this->workingDir === '') { + $newWorkingDir = $path; + } else { + $newWorkingDir = $this->workingDir .'/' . $path; + } if (!file_exists($newWorkingDir)) { mkdir($newWorkingDir, 0777, true); From f9bf6f9954029b88306ea22d9ce40355450ffdd9 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 24 Jan 2021 12:25:52 +0100 Subject: [PATCH 3/5] Fix building pickle.phar on Windows --- .github/workflows/test.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f38f8c36..b96141dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,12 +34,20 @@ jobs: run: composer install --prefer-source --optimize-autoloader --ansi --no-interaction --no-dev - name: Install Box run: composer global require 'kherge/box=~2.7' --prefer-source - - name: Build pickle.phar - run: ~/.composer/vendor/bin/box build + - name: Build pickle.phar on Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + "$(composer global config bin-dir --absolute)/box" build + - name: Build pickle.phar on Windows + if: startsWith(matrix.os, 'windows') + run: | + & "$(composer global config bin-dir --absolute)/box.bat" build - name: Install Composer dependencies (including dev, preferring dist) run: composer install --optimize-autoloader --ansi --no-interaction - name: Run Behat - run: PICKLE_BEHAT_PROCESS_TIMEOUT=0 vendor/bin/behat --format=progress + env: + PICKLE_BEHAT_PROCESS_TIMEOUT: 0 + run: vendor/bin/behat --format=progress - name: Download Ocular run: curl -sSLf -o ocular.phar https://scrutinizer-ci.com/ocular.phar - name: Upload code coverage From 8ad307eceeeb2f92e035910ff7aced30c664d614 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 24 Jan 2021 14:26:39 +0100 Subject: [PATCH 4/5] Fix detecting error message on Windows --- features/pickle/convert-json.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/pickle/convert-json.feature b/features/pickle/convert-json.feature index 235ad0ae..40b18c5f 100644 --- a/features/pickle/convert-json.feature +++ b/features/pickle/convert-json.feature @@ -80,7 +80,7 @@ Feature: convert package.xml to composer.json When I run "pickle convert" Then it should fail with: """ - The path '%%TEST_DIR%%/empty-dir' d + empty-dir' doesn't contain package.xml """ Given I am in the ".." path From 868e816a8b99fdb05630dbd5b26f51f310863516 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 24 Jan 2021 14:27:14 +0100 Subject: [PATCH 5/5] Add missing method in Windows install command --- src/Package/PHP/Command/Install/Windows/Binary.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Package/PHP/Command/Install/Windows/Binary.php b/src/Package/PHP/Command/Install/Windows/Binary.php index e61eb17e..3e5b4585 100644 --- a/src/Package/PHP/Command/Install/Windows/Binary.php +++ b/src/Package/PHP/Command/Install/Windows/Binary.php @@ -36,7 +36,8 @@ namespace Pickle\Package\PHP\Command\Install\Windows; -use Symfony\Component\Console\Output\OutputInterface as OutputInterface; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Pickle\Base\Util\FileOps; use Pickle\Engine; use Pickle\Base\Archive; @@ -50,6 +51,7 @@ class Binary private $extName; private $extVersion; private $progress = null; + private $input = null; private $output = null; private $extDll = null; @@ -72,6 +74,11 @@ public function setProgress($progress) $this->progress = $progress; } + public function setInput(InputInterface $input) + { + $this->input = $input; + } + public function setOutput(OutputInterface $output) { $this->output = $output;