Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on Windows too #210

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- windows-latest
php-version:
- "7.2"
- "7.3"
Expand All @@ -33,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
Expand Down
6 changes: 5 additions & 1 deletion features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion features/pickle/convert-json.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/Package/PHP/Command/Install/Windows/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,6 +51,7 @@ class Binary
private $extName;
private $extVersion;
private $progress = null;
private $input = null;
private $output = null;
private $extDll = null;

Expand All @@ -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;
Expand Down