-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
205 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
# This plan should be used before ~/defaults/component.yml. That template uses | ||
# the variables below to fill all the settings for the installation into | ||
# /var/www directly without installing a shop. | ||
install: &install | ||
method: script | ||
script: 'source/.github/oxid-esales/install.sh' | ||
git: | ||
ref: '{{ .Data.global.git.default_ref }}' | ||
composer: | ||
early: 'skip' | ||
root_url: '' | ||
transform: | | ||
{ | ||
"preferred-install": { | ||
"oxid-esales/*": "source", | ||
"oxid-professional-services/*": "source", | ||
"ddoe/*": "source" | ||
}, | ||
"require": { | ||
"oxid-esales/twig-component": "dev-{{ .Data.global.git.safe_ref_name }}", | ||
"oxid-esales/twig-admin-theme": "{{ .Data.global.composer.dev_ref }}", | ||
"oxid-esales/apex-theme": "{{ .Data.global.composer.dev_ref }}", | ||
"twig/twig": "v3.8.0" | ||
} | ||
} | ||
output: | ||
files: | | ||
docker-compose.yml | ||
source/composer.json* | ||
source/composer.lock | ||
source/source/config.inc.php | ||
source/vendor/oxid-esales/oxideshop-ce/source/config.inc.php | ||
data/php/logs/error_log.txt | ||
global: | ||
# The organisation part of the composer package name <org>/<name> | ||
org: 'oxid-esales' | ||
# The name part of the composer package, also used in other places | ||
name: 'twig-component' | ||
# The repository organisation/name to check out | ||
repo: 'OXID-eSales/twig-component' | ||
install_shop_with_modules: *install | ||
|
||
# These tests are run for all PHP/MySQL combinations specified when calling | ||
# the workflow | ||
runscript: | ||
runscript: &runscript | ||
matrix: | ||
# A string containing a valid json array of scripts to execute | ||
# The scripts follow the pattern "<prefix>:<composer_alias>" for scripts | ||
# defined in composer.json and "<prefix>:~/<shell_script>" for shell | ||
# scripts located in tests/Scripts | ||
# If you want to see the tests output, make sure to generate it in tests/Output | ||
script: '["component:~/unit.sh","component:~/integration.sh"]' | ||
script: | | ||
[ | ||
"twig:~/unit.sh", | ||
"twig:~/integration.sh" | ||
] | ||
twig: | ||
path: 'vendor/oxid-esales/twig-component' | ||
|
||
sonarcloud: | ||
# Remove the next two lines if you want to feed the results of your tests | ||
# to sonarcloud. You need to make sure that your scripts generate an xml | ||
# coverage file in tests/Reports, e.g. by adding | ||
# --coverage-clover=tests/Reports/coverage_phpunit_integration.xml to them. | ||
matrix: | ||
testplan: 'skip' | ||
# If you want to enable sonarcloud, you need to fill out the | ||
# settings for project_key and project_name. You can get them from | ||
# https://sonarcloud.io/organizations/oxid-esales/projects. The defaults for | ||
# organization and parameters should be OK for most cases, so you don't need | ||
# to overwrite them here. | ||
project_key: '???' | ||
project_name: '???' | ||
|
||
finish: | ||
slack_title: 'Twig Component ({{ .Data.github.RefName }}) by {{ .Github.Actor }}' | ||
slack_compact: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"name": "oxid-esales/twig-component", | ||
"description": "The component supports Twig template engine.", | ||
"license": [ | ||
"proprietary" | ||
], | ||
"type": "oxideshop-component", | ||
"keywords": [ | ||
"oxid", | ||
"component", | ||
"eShop" | ||
], | ||
"homepage": "https://www.oxid-esales.com", | ||
"require": { | ||
"php": ">=8.1", | ||
"twig/twig": "3.8.0" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"OxidEsales\\Twig\\": "src", | ||
"OxidEsales\\Twig\\Tests\\": "tests" | ||
"name": "oxid-esales/twig-component", | ||
"description": "The component supports Twig template engine.", | ||
"license": [ | ||
"proprietary" | ||
], | ||
"type": "oxideshop-component", | ||
"keywords": [ | ||
"oxid", | ||
"component", | ||
"eShop" | ||
], | ||
"homepage": "https://www.oxid-esales.com", | ||
"require": { | ||
"php": ">=8.0", | ||
"twig/twig": "3.8.0" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"OxidEsales\\Twig\\": "src", | ||
"OxidEsales\\Twig\\Tests\\": "tests" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,67 @@ | ||
#!/bin/bash | ||
set -e | ||
vendor/bin/phpunit \ | ||
-c phpunit.xml \ | ||
export XDEBUG_MODE=coverage | ||
PHPUNIT="vendor/bin/phpunit" | ||
if [ ! -f "${PHPUNIT}" ]; then | ||
PHPUNIT="/var/www/${PHPUNIT}" | ||
if [ ! -f "${PHPUNIT}" ]; then | ||
echo -e "\033[0;31mCould not find phpunit in vendor/bin or /var/www/vendor/bin\033[0m" | ||
exit 1 | ||
fi | ||
fi | ||
BOOTSTRAP="../../../tests/bootstrap.php" | ||
if [ ! -f "${BOOTSTRAP}" ]; then | ||
BOOTSTRAP="../oxideshop-ce/tests" | ||
if [ ! -f "${BOOTSTRAP}" ]; then | ||
echo -e "\033[0;31mCould not find bootstrap.php in ../../../tests or ../oxideshop-ce/tests\033[0m" | ||
exit 1 | ||
fi | ||
fi | ||
"${PHPUNIT}" \ | ||
-c tests/phpunit.xml \ | ||
--bootstrap "${BOOTSTRAP}" \ | ||
--coverage-clover=tests/Reports/coverage_phpunit_integration.xml \ | ||
tests/Integration 2>&1 \ | ||
| tee tests/Output/integration_tests.txt | ||
RESULT=$? | ||
echo "phpunit exited with error code ${RESULT}" | ||
if [ ! -s "tests/Output/integration_tests.txt" ]; then | ||
echo -e "\033[0;31mLog file is empty! Seems like no tests have been run!\033[0m" | ||
RESULT=1 | ||
fi | ||
cat >failure_pattern.tmp <<EOF | ||
fail | ||
\\.\\=\\= | ||
Warning | ||
Notice | ||
Deprecated | ||
Fatal | ||
Error | ||
DID NOT FINISH | ||
Test file ".+" not found | ||
Cannot open file | ||
No tests executed | ||
Could not read | ||
Warnings: [1-9][0-9]* | ||
Errors: [1-9][0-9]* | ||
Failed: [1-9][0-9]* | ||
Deprecations: [1-9][0-9]* | ||
Risky: [1-9][0-9]* | ||
EOF | ||
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp | ||
while read -r LINE ; do | ||
if [ -n "${LINE}" ]; then | ||
if grep -q -E "${LINE}" "tests/Output/integration_tests.txt"; then | ||
echo -e "\033[0;31m integration test failed matching pattern ${LINE}\033[0m" | ||
grep -E "${LINE}" "tests/Output/integration_tests.txt" | ||
RESULT=1 | ||
else | ||
echo -e "\033[0;32m integration test passed matching pattern ${LINE}" | ||
fi | ||
fi | ||
done <failure_pattern.tmp | ||
if [[ ! -s "tests/Reports/coverage_phpunit_integration.xml" ]]; then | ||
echo -e "\033[0;31m coverage report tests/Reports/coverage_phpunit_integration.xml is empty\033[0m" | ||
RESULT=1 | ||
fi | ||
exit ${RESULT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,68 @@ | ||
#!/bin/bash | ||
set -e | ||
vendor/bin/phpunit \ | ||
-c phpunit.xml \ | ||
export XDEBUG_MODE=coverage | ||
PHPUNIT="vendor/bin/phpunit" | ||
if [ ! -f "${PHPUNIT}" ]; then | ||
PHPUNIT="/var/www/${PHPUNIT}" | ||
if [ ! -f "${PHPUNIT}" ]; then | ||
echo -e "\033[0;31mCould not find phpunit in vendor/bin or /var/www/vendor/bin\033[0m" | ||
exit 1 | ||
fi | ||
fi | ||
BOOTSTRAP="../../../tests/bootstrap.php" | ||
if [ ! -f "${BOOTSTRAP}" ]; then | ||
BOOTSTRAP="../oxideshop-ce/tests" | ||
if [ ! -f "${BOOTSTRAP}" ]; then | ||
echo -e "\033[0;31mCould not find bootstrap.php in ../../../tests or ../oxideshop-ce/tests\033[0m" | ||
exit 1 | ||
fi | ||
fi | ||
"${PHPUNIT}" \ | ||
-c tests/phpunit.xml \ | ||
--bootstrap "${BOOTSTRAP}" \ | ||
--coverage-clover=tests/Reports/coverage_phpunit_unit.xml \ | ||
--log-junit tests/Reports/phpunit-unit.xml \ | ||
tests/Unit 2>&1 \ | ||
| tee tests/Output/unit_tests.txt | ||
RESULT=$? | ||
echo "phpunit exited with error code ${RESULT}" | ||
if [ ! -s "tests/Output/unit_tests.txt" ]; then | ||
echo -e "\033[0;31mLog file is empty! Seems like no tests have been run!\033[0m" | ||
RESULT=1 | ||
fi | ||
cat >failure_pattern.tmp <<EOF | ||
fail | ||
\\.\\=\\= | ||
Warning | ||
Notice | ||
Deprecated | ||
Fatal | ||
Error | ||
DID NOT FINISH | ||
Test file ".+" not found | ||
Cannot open file | ||
No tests executed | ||
Could not read | ||
Warnings: [1-9][0-9]* | ||
Errors: [1-9][0-9]* | ||
Failed: [1-9][0-9]* | ||
Deprecations: [1-9][0-9]* | ||
Risky: [1-9][0-9]* | ||
EOF | ||
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp | ||
while read -r LINE ; do | ||
if [ -n "${LINE}" ]; then | ||
if grep -q -E "${LINE}" "tests/Output/unit_tests.txt"; then | ||
echo -e "\033[0;31m unit test failed matching pattern ${LINE}\033[0m" | ||
grep -E "${LINE}" "tests/Output/unit_tests.txt" | ||
RESULT=1 | ||
else | ||
echo -e "\033[0;32m unit test passed matching pattern ${LINE}" | ||
fi | ||
fi | ||
done <failure_pattern.tmp | ||
if [[ ! -s "tests/Reports/coverage_phpunit_unit.xml" ]]; then | ||
echo -e "\033[0;31m coverage report tests/Reports/coverage_phpunit_unit.xml is empty\033[0m" | ||
RESULT=1 | ||
fi | ||
exit ${RESULT} |