Skip to content

Commit

Permalink
TIP-771: Improve environments settings and configure tests framework
Browse files Browse the repository at this point in the history
  • Loading branch information
anaelChardan committed Jul 18, 2017
1 parent 1170954 commit 1727725
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 9 deletions.
28 changes: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,37 @@ list:
@echo "Akeneo PIM Migration tool available targets:"
@echo ""
@echo " $(YELLOW)fix-style$(RESTORE) > run the PHP-CS-FIXER"
@echo " $(YELLOW)phpspec$(RESTORE) > run All PHPSpec"
@echo " $(YELLOW)phpunit$(RESTORE) > run All PHPUnit"
@echo " $(YELLOW)enter$(RESTORE) > enter in the PHP container"
@echo ""
@echo ""
@echo " $(YELLOW)install$(RESTORE) > install vendors"
@echo " $(YELLOW)update(RESTORE) > update vendors"
@echo " $(YELLOW)run$(RESTORE) > run the tool"
@echo " $(YELLOW)clean$(RESTORE) > removes the vendors"
@echo " $(YELLOW)composer$(RESTORE) > run composer"
@echo " $(YELLOW)install$(RESTORE) > install vendors"
@echo " $(YELLOW)update$(RESTORE) > update vendors"
@echo " $(YELLOW)run$(RESTORE) > run the tool"
@echo " $(YELLOW)clean$(RESTORE) > removes the vendors"

.PHONY: fix-style
fix-style:
docker-compose run php vendor/bin/php-cs-fixer fix --config=./.php_cs.php

.PHONY: enter
enter:
docker-compose run php /bin/bash

.PHONY: phpspec
phpspec:
docker-compose run php ./vendor/bin/phpspec run ${ARGS}

.PHONY: phpunit
phpunit:
docker-compose run php ./vendor/bin/phpunit ${ARGS}

.PHONY: composer
composer:
docker-compose run php composer ${ARGS}

.PHONY: install
install:
docker-compose run php composer install
Expand Down
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@
],
"autoload": {
"psr-4": {
"Akeneo\\PimMigration\\": "src/"
"Akeneo\\PimMigration\\": "src/",
"integration\\Akeneo\\PimMigration\\": "tests/integration",
"resources\\Akeneo\\PimMigration\\": "tests/resources",
"spec\\Akeneo\\PimMigration\\": "tests/spec"
}
},
"require": {
"php": ">=7.1.0",
"phpseclib/phpseclib": "~2.0",
"symfony/config": "3.3.4",
"symfony/console": "3.3.4",
"symfony/dependency-injection": "3.3.4"
"symfony/dependency-injection": "3.3.4",
"symfony/filesystem": "3.3.4"
},
"require-dev": {
"phpspec/phpspec": "3.0.*",
"phpunit/phpunit": "5.4.*",
"sebastian/exporter": "^3.1",
"phpspec/phpspec": "3.4.*",
"phpunit/phpunit": "6.2.*",
"friendsofphp/php-cs-fixer": "2.3.2"
},
"minimum-stability": "stable"
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ version: '2'

services:
php:
image: akeneo/php:php-7.1
image: akeneo/php:7.1
environment:
COMPOSER_HOME: /home/docker/.composer
PHP_IDE_CONFIG: 'serverName=php-migration-cli'
XDEBUG_CONFIG: 'remote_host=xxx.xxx.xxx.xxx'
PHP_XDEBUG_ENABLED: 1
user: docker
volumes:
- ./:/home/docker/migration
Expand Down
6 changes: 6 additions & 0 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
suites:
migration:
psr4_prefix: Akeneo\PimMigration
namespace: Akeneo\PimMigration
src_path: %paths.config%/src
spec_path: %paths.config%/tests
16 changes: 16 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Integration tests">
<directory suffix="Integration.php">./tests/integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src/</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 1727725

Please sign in to comment.