Skip to content

Commit

Permalink
Merge pull request #338 from dpfaffenbauer/fix-tests
Browse files Browse the repository at this point in the history
update tests
  • Loading branch information
dpfaffenbauer authored Jul 13, 2022
2 parents 9ecb74c + a02a8ae commit 0db1762
Show file tree
Hide file tree
Showing 14 changed files with 143 additions and 214 deletions.
62 changes: 51 additions & 11 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ jobs:
runs-on: ubuntu-latest
env:
APP_ENV: "test"
IM_SKIP_DB_SETUP: "1"
PIMCORE_INSTALL_ADMIN_USERNAME: "admin"
PIMCORE_INSTALL_ADMIN_PASSWORD: "admin"
PIMCORE_INSTALL_MYSQL_HOST_SOCKET: "127.0.0.1"
PIMCORE_INSTALL_MYSQL_USERNAME: "root"
PIMCORE_INSTALL_MYSQL_PASSWORD: "root"
PIMCORE_INSTALL_MYSQL_DATABASE: "data_defs_test"
PIMCORE_INSTALL_MYSQL_PORT: "3306"
PIMCORE_KERNEL_CLASS: 'Kernel'
PIMCORE_CLASS_DIRECTORY: 'var/tmp/behat/var/classes'
PIMCORE_WRITE_TARGET_STATICROUTES: 'settings-store'
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/data_defs_test"

services:
mysql:
image: mysql:5.7
database:
image: "mariadb:10.5"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: data_defs_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}"
strategy:
matrix:
php: [8.0]
pimcore: [^10.0, ^10.1]
php: [ 8.0 ]
pimcore: [ ^10.2, ^10.3, ^10.4, 10.x-dev ]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,11 +51,9 @@ jobs:
- name: Check PHP Version
run: php -v

- name: Verify MySQL connection
- name: Setup DB
run: |
mysql --version
sudo apt-get install -y mysql-client
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot -proot -e "SHOW DATABASES"
mysql --host 127.0.0.1 --port ${{ job.services.database.ports['3306'] }} -uroot -proot -e "CREATE DATABASE coreshop_test CHARSET=utf8mb4;"
- name: Get composer cache directory
id: composer-cache
Expand All @@ -55,16 +66,45 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies highest
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader
- name: Cache clear
run: bin/console cache:clear

- name: Assets Install
run: bin/console assets:install --symlink

- name: Install Pimcore
run: PIMCORE_KERNEL_CLASS=Kernel vendor/bin/pimcore-install --ignore-existing-config --env=test --skip-database-config

- name: Install DataDefinitions
run: bin/console pimcore:bundle:install DataDefinitionsBundle

- name: Run Behat
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p default

- name: Upload Behat logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: "Behat logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.pimcore }})"
path: etc/build/
if-no-files-found: ignore

- name: Upload Pimcore logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: "Pimcore logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.pimcore }})"
path: var/log/
if-no-files-found: ignore
87 changes: 47 additions & 40 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,67 @@ jobs:
env:
APP_ENV: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/data_defs_test"

strategy:
matrix:
php: [ 8.0 ]
pimcore: [ ^10.2, 10.x-dev ]
database: [ 'mysql:8.0' ]
dependencies: [ highest, lowest ]

services:
mysql:
image: mysql:5.7
database:
image: "${{ matrix.database }}"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: data_defs_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}"
strategy:
matrix:
php: [8.0]
pimcore: [^10.0, ^10.1]

name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}, DB ${{ matrix.database }}, Deps ${{ matrix.dependencies }}"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, gd, simpleXML, dom, exif, fileinfo, iconv, mbstring, mysqli, pdo_mysql, zip, zlib
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
extensions: intl, gd, simpleXML, dom, exif, fileinfo, iconv, mbstring, mysqli, pdo_mysql, zip, zlib

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Verify MySQL connection
run: |
mysql --version
sudo apt-get install -y mysql-client
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot -proot -e "SHOW DATABASES"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Validate composer.json and composer.lock
run: composer validate
- if: matrix.dependencies == 'highest'
name: Install dependencies highest
run: |
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader
- name: Composer install
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- if: matrix.dependencies == 'lowest'
name: Install dependencies lowest
run: |
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader --prefer-lowest
- name: Validate YAML
run: bin/console lint:yaml src --parse-tags
- name: Validate YAML
run: bin/console lint:yaml src --parse-tags

- name: STAN
run: |
cp -f config/packages/stan/config.yaml config/packages/dev/config.yaml
bin/console cache:clear --env=dev
vendor/bin/phpstan analyse -c phpstan.neon src -l 3
- name: STAN
run: |
cp -f config/packages/stan/config.yaml config/packages/dev/config.yaml
bin/console cache:clear --env=dev
vendor/bin/phpstan analyse -c phpstan.neon src -l 3
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ var/classes
var/config
test.csv
web
public
docker-compose.yaml
test-commands.txt
.docker
81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,31 @@
"php": ">=8.0",
"ext-json": "*",
"box/spout": "^3.0",
"league/csv": "^9.7",
"coreshop/pimcore-bundle": "^3.0",
"coreshop/resource-bundle": "^3.0",
"coreshop/rule-bundle": "^3.0",
"coreshop/pimcore-bundle": "^3.0",
"pimcore/pimcore": "^10.0",
"jms/serializer": "^3.17.1",
"league/csv": "^9.7",
"nyholm/psr7": "^1.5",
"pimcore/pimcore": "^10.2",
"psr/http-client-implementation": "^1.0",
"psr/http-factory-implementation": "^1.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"behat/behat": "^3.8",
"friends-of-behat/symfony-extension": "^2.2.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-doctrine": "^0.12",
"phpstan/phpstan-symfony": "^0.12",
"phpstan/phpstan-webmozart-assert": "^0.12"
"friends-of-behat/symfony-extension": "^2.1",
"phpstan/phpstan": "^1.5.4",
"phpstan/phpstan-doctrine": "^1.3.2",
"phpstan/phpstan-symfony": "^1.1.8",
"phpstan/phpstan-webmozart-assert": "^1.1.2"
},
"conflict": {

"guzzlehttp/psr7": "< 2.0"
},
"suggest": {
"dpfaffenbauer/process-manager": "Allows to start Imports/Exports from within Pimcore UI and also tracks Status of current processes."
"dpfaffenbauer/process-manager": "Allows to start Imports/Exports from within Pimcore UI and also tracks Status of current processes.",
"guzzlehttp/psr7": "For downloading external data like Images"
},
"autoload": {
"psr-4": {
Expand Down
Empty file added etc/build/.gitkeep
Empty file.
5 changes: 1 addition & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
parameters:
autoload_files:
- %currentWorkingDirectory%/vendor/pimcore/pimcore/lib/helper-functions.php

reportUnmatchedIgnoredErrors: false

symfony:
container_xml_path: var/cache/dev/KernelDevDebugContainer.xml

excludes_analyse:
excludePaths:
# Makes PHPStan crash
- '**/DependencyInjection/Configuration.php'
- '**/Migrations/Version*.php'
Expand Down
38 changes: 0 additions & 38 deletions public/app.php

This file was deleted.

Loading

0 comments on commit 0db1762

Please sign in to comment.