Skip to content

Commit

Permalink
Merge branch 'b-7.2.x-root-experiment' into b-7.2.x-prepare_for_v7.2-…
Browse files Browse the repository at this point in the history
…OXDEV-8316
  • Loading branch information
tkcreateit committed Oct 21, 2024
2 parents 1d0153c + 917fc62 commit 56ebd6d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/commit-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker compose exec -T --workdir /var/www/vendor/oxid-esales/module-template php composer static
docker compose exec -T php composer static
32 changes: 19 additions & 13 deletions .github/oxid-esales/module-template.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
install_shop_with_modules:
install:
cache:
prepared_shop: false
git:
repository: 'OXID-eSales/module-template'
ref: &ref '{{ .Github.RefName }}'
shop_url: 'https://github.com/OXID-eSales/module-template.git'
shop_ref: *ref
composer:
root_url: ''
transform: |
{
"require": {
"oxid-esales/oxideshop-ce": "{{ .Data.global.composer.dev_ref }}",
"oxid-esales/twig-component": "{{ .Data.global.composer.dev_ref }}",
"oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}",
"oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}",
"oxid-esales/module-template": "{{ .Data.global.composer.ref_name }}"
},
"repositories": {
"oxid-esales/module-template": {
"type": "git",
"url": "https://github.com/OXID-eSales/module-template.git"
}
"oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}"
}
}
custom_script_container: |
vendor/bin/oe-console oe:database:reset --db-host=mysql --db-port=3306 --db-name=example --db-user=root --db-password=root --force
vendor/bin/oe-console oe:module:install ./
vendor/bin/oe-eshop-doctrine_migration migrations:migrate
vendor/bin/oe-console oe:module:activate oe_moduletemplate
vendor/bin/oe-console oe:theme:activate apex
install_shop_with_modules:
composer:
root_url: ''

runscript: &runscript
matrix:
Expand All @@ -30,7 +36,7 @@ runscript: &runscript
"module_template:tests-codeception"
]
module_template:
path: 'vendor/oxid-esales/module-template'
path: ''

runslim:
<<: *runscript
Expand All @@ -45,7 +51,7 @@ runslim:
sonarcloud:
matrix:
testplan: '["-"]'
strip_path: '/var/www/vendor/oxid-esales/module-template/'
strip_path: '/var/www/'
project_key: 'OXID-eSales_module-template'
project_name: 'oxid-esales/module-template'
organization: 'oxid-esales'
Expand All @@ -54,7 +60,7 @@ sonarcloud:
-Dsonar.scm.provider=git
-Dsonar.sources=src
-Dsonar.tests=tests
-Donar.php.phpstan.reportPaths=coverage-reports/phpstan.report.json
-Dsonar.php.phpstan.reportPaths=coverage-reports/phpstan.report.json
finish:
slack_title: 'Module template ({{ .Data.global.git.shop_ref }}) by {{ .Github.Actor }}'
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"license": [
"GPL-3.0"
],
"prefer-stable": true,
"require": {
"php": "^8.2|^8.3",
"php": "^8.2",
"symfony/filesystem": "^6.3"
},
"minimum-stability": "dev",
Expand All @@ -37,8 +36,13 @@
},
"autoload": {
"psr-4": {
"OxidEsales\\ModuleTemplate\\": "src/",
"OxidEsales\\ModuleTemplate\\Tests\\": "tests/"
"OxidEsales\\ModuleTemplate\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"OxidEsales\\ModuleTemplate\\Tests\\": "tests/",
"OxidEsales\\EshopCommunity\\Tests\\": "./vendor/oxid-esales/oxideshop-ce/tests"
}
},
"scripts": {
Expand All @@ -64,7 +68,7 @@

"tests-unit": "XDEBUG_MODE=coverage vendor/bin/phpunit --config=tests/ --testsuite=Unit --coverage-clover=tests/Reports/coverage_unit_module-template.xml",
"tests-integration": "XDEBUG_MODE=coverage vendor/bin/phpunit --bootstrap=/var/www/source/bootstrap.php --config=tests/ --testsuite=Integration --coverage-clover=tests/Reports/coverage_integration_module-template.xml",
"tests-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --bootstrap=/var/www/source/bootstrap.php --config=tests/ --coverage-html=tests/reports/coverage",
"tests-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --bootstrap=/var/www/source/bootstrap.php --config=tests/ --coverage-html=tests/Reports/CoverageHtml",

"tests-codeception": [
"Composer\\Config::disableProcessTimeout",
Expand All @@ -79,7 +83,7 @@
},
"config": {
"allow-plugins": {
"oxid-esales/oxideshop-composer-plugin": false,
"oxid-esales/oxideshop-composer-plugin": true,
"oxid-esales/oxideshop-unified-namespace-generator": true
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Codeception/Acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ modules:
- \OxidEsales\Codeception\Module\Translation\TranslationsModule:
shop_path: '%SHOP_SOURCE_PATH%'
paths:
- Application/views/apex
- Application/views/admin_twig
- ../vendor/oxid-esales/module-template/views/admin_twig
- ../vendor/oxid-esales/module-template/translations
- 'Application/views/apex'
- 'Application/views/admin_twig'
- '%SOURCE_RELATIVE_PACKAGE_PATH%/translations'
- '%SOURCE_RELATIVE_PACKAGE_PATH%/views/admin_twig'
- \OxidEsales\Codeception\Module\OxideshopModules
step_decorators:
- \Codeception\Step\Retry
10 changes: 6 additions & 4 deletions tests/Codeception/Config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
use OxidEsales\Facts\Facts;
use Symfony\Component\Filesystem\Path;

if ($shopRootPath = getenv('SHOP_ROOT_PATH')){
require_once(Path::join($shopRootPath, 'source', 'bootstrap.php'));
}

$facts = new Facts();

return [
'SHOP_URL' => $facts->getShopUrl(),
'SHOP_SOURCE_PATH' => $facts->getSourcePath(),
'SOURCE_RELATIVE_PACKAGE_PATH' => getSourceRelativePackagePath($facts),
'VENDOR_PATH' => $facts->getVendorPath(),
'DB_NAME' => $facts->getDatabaseName(),
'DB_USERNAME' => $facts->getDatabaseUserName(),
Expand All @@ -39,6 +36,11 @@
'THEME_ID' => getenv('THEME_ID') ?: 'apex',
];

function getSourceRelativePackagePath(Facts $facts): string
{
return str_replace($facts->getShopRootPath(), '..', __DIR__) . '/../../../';
}

function getTemporaryDataDumpFilePath(): string
{
return Path::join(__DIR__, '../Support', '_generated', 'dump.sql');
Expand Down

0 comments on commit 56ebd6d

Please sign in to comment.