Skip to content

Commit

Permalink
TC-47 test cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Dec 23, 2024
1 parent 67354e8 commit 19bea7e
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/oxid-esales/telecash_module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ runscript: &runscript
]
osc_telecash:
path: 'vendor/oxid-solution-catalysts/telecash-module'
custom_script: '$(pwd)/source/vendor/oxid-solution-catalysts/telecash-module/.github/oxid-esales/cypress.sh'

runslim:
<<: *runscript
Expand All @@ -43,6 +42,11 @@ runslim:
"osc_telecash:phpstan-report"
]
cypress: &cypress
osc_telecash:
path: 'vendor/oxid-solution-catalysts/telecash-module'
custom_script: '$(pwd)/source/vendor/oxid-solution-catalysts/telecash-module/.github/oxid-esales/cypress.sh'

sonarcloud:
matrix:
testplan: '["-"]'
Expand Down
174 changes: 174 additions & 0 deletions .github/workflows/universal_workflow_light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,180 @@ jobs:
debug: ${{ inputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}



cypress:
needs: ['init', 'install']
runs-on: ${{ fromJSON(inputs.runs_on) }}
env:
MATRIX_PHP: ${{ matrix.php }}

Check failure on line 1125 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "php" is not defined in object type {}
MATRIX_MYSQL: ${{ matrix.mysql }}

Check failure on line 1126 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "mysql" is not defined in object type {}
steps:
- name: Load cached testplan
id: rstn
uses: OXID-eSales/github-actions/load_cached_testplan@v4
with:
php: ${{ matrix.php }}

Check failure on line 1132 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "php" is not defined in object type {}
mysql: ${{ matrix.mysql }}

Check failure on line 1133 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "mysql" is not defined in object type {}
prefix: '${{ needs.init.outputs.global_title }}'
root_testplan: ${{ needs.init.outputs.testplan }}
matrix_testplan: ''
plan_folder: ${{ inputs.plan_folder }}
cache_name: ${{ needs.init.outputs.init_cache_name }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
cache_bucket: ${{ needs.init.outputs.init_cache_bucket }}
debug: ${{ needs.init.outputs.debug }}

- name: 'Load Testplan'
id: rsltp
uses: 'joernott/load_testplan@v1'
with:
files: '${{steps.rstn.outputs.testplan}}'
set_output: true
set_print: true
set_env: true
yaml: generated_testplan.yaml
loglevel: info
logfile: load_testplan_runslim.log
token: ${{ secrets.enterprise_github_token }}

- name: Convert variables
id: rt
shell: bash
run: |

Check failure on line 1161 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "script" is not defined in object type {}
${{ needs.init.outputs.debug }}
set +x
E=$(env|grep -e "^runslim_")
MATRIX_SCRIPT='${{ matrix.script }}'
if [[ ${MATRIX_SCRIPT} != *":"* ]]; then
echo -e "\033[0;31m ${X} does not contain a ':'. You need to specify scripts as '<prefix>:<script_name>'"
exit 1
fi
IFS=':' read -r -a S <<< "${MATRIX_SCRIPT}"
PREFIX="${S[0]//-/_}"
SCRIPT="${S[1]}"
echo "runslim_script=${SCRIPT}"|tee -a "${GITHUB_OUTPUT}"
for KEY in docker_login load_shop \
container_name container_options container_method \
cache_bucket \
composer_file composer_backup composer_transform composer_update composer_update_options composer_early \
custom_script custom_script_container \
path install_options \
output_prefix coverage_prefix; do
VAR="runslim_${PREFIX}_${KEY}"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR="runslim_${KEY}"
fi
echo "runslim_${KEY}=${!VAR}"
cat >>"${GITHUB_OUTPUT}" <<EOF
runslim_${KEY}<<runslim_${KEY}_delimeter
${!VAR}
runslim_${KEY}_delimeter
EOF
export "runslim_${KEY}"="${!VAR}"
done
if [ "${runslim_composer_early}" == 'false' ]; then
echo 'runslim_run_composer_install=true'| tee -a "${GITHUB_OUTPUT}"
fi
# If runslim_workdir is ~, it will be set to the value of runslim_path
VAR="runslim_${PREFIX}_workdir"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR='runslim_workdir'
fi
if [ "${!VAR}" == '~' ]; then
echo "runslim_workdir=${runslim_path}"| tee -a "${GITHUB_OUTPUT}"
else
echo "runslim_workdir=${!VAR}"| tee -a "${GITHUB_OUTPUT}"
fi
SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}"
echo "runslim_suffix=${SUFFIX}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}"
echo "runslim_title=${PREFIX}_${SCRIPT}"|sed -E 's#"|,|:|<|>|\||\*|\?|\/|\\#_#g' | tee -a "${GITHUB_OUTPUT}"
- name: 'Start shop'
uses: 'OXID-eSales/github-actions/start_shop@v4'
with:
cached_shop: '${{ steps.rt.outputs.runslim_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}'
cache_bucket: ${{ steps.rt.outputs.runslim_cache_bucket }}
cache_endpoint: ${{ secrets.CACHE_ENDPOINT }}
cache_access_key: ${{ secrets.CACHE_ACCESS_KEY }}
cache_secret_key: ${{ secrets.CACHE_SECRET_KEY }}
docker_login: ${{ steps.rt.outputs.runslim_docker_login }}
docker_user: ${{ secrets.DOCKER_HUB_USER }}
docker_token: ${{ secrets.DOCKER_HUB_TOKEN }}
wait_for_selenium: true
debug: ${{ needs.init.outputs.debug }}

- name: 'Modify composer.json'
if: ${{ steps.rt.outputs.runslim_composer_transform != '' && steps.rt.outputs.runslim_composer_early == 'false' }}
uses: 'OXID-eSales/github-actions/composer_merge@v4'
with:
file: 'source/${{ steps.rt.outputs.runslim_path }}/composer.json'
backup: true
transform: |
${{ steps.rt.outputs.runslim_composer_transform }}
update: ${{ steps.rt.outputs.runslim_composer_update }}
update_options: '${{ steps.rt.outputs.runslim_composer_update_options }} -d /var/www/${{ steps.rt.outputs.runslim_path }}'
container_name: ${{ steps.rt.outputs.runslim_container_name }}
container_options: ${{ steps.rt.outputs.runslim_container_options }}
container_method: 'exec'
debug: ${{ needs.init.outputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}

- name: Run composer if there is no transform
if: ${{ steps.rt.outputs.runslim_composer_transform == '' && steps.rt.outputs.runslim_composer_early == 'false' }}
run: |
# run composer
${{ inputs.debug }}
docker compose exec -T \
${{ steps.rt.outputs.runslim_container_options }} \
${{ steps.rt.outputs.runslim_container_name }} \
composer config -g github-oauth.github.com "${{ secrets.enterprise_github_token || github.token }}"
docker compose exec -T \
${{ steps.rt.outputs.runslim_container_options }} \
${{ steps.rt.outputs.runslim_container_name }} \
composer update --no-interaction -d "/var/www/${{ steps.rt.outputs.runslim_path }}"
- name: Run custom scripts
if: ${{ steps.rt.outputs.runslim_custom_script != '' || steps.rt.outputs.runslim_custom_script_container != '' }}
uses: 'OXID-eSales/github-actions/run_custom_scripts@v4'
with:
container_name: ${{ steps.rt.outputs.runslim_container_name }}
container_options: ${{ steps.rt.outputs.runslim_container_options }}
container_method: ${{ steps.rt.outputs.runslim_container_method }}
custom_script: ${{ steps.rt.outputs.runslim_custom_script }}
custom_script_container: ${{ steps.rt.outputs.runslim_custom_script_container }}
debug: ${{ needs.init.outputs.debug }}

- name: Upload coverage report
if: ${{ always() && steps.rt.outputs.runslim_coverage_prefix != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rt.outputs.runslim_coverage_prefix}}-${{steps.rt.outputs.runslim_suffix }}
path: source/${{ steps.rt.outputs.runslim_path }}/tests/Reports/*

- name: 'Stop shop'
if: ${{ always() }}
uses: 'OXID-eSales/github-actions/stop_shop@v4'
with:
debug: ${{ needs.init.outputs.debug }}

- name: 'Write Report'
if: always()
uses: OXID-eSales/github-actions/append_report@v4
with:
prefix: '${{ needs.init.outputs.global_title }}'
priority: '100'
phase: test
job: runslim
title: '${{ steps.rt.outputs.runslim_title }}'
php: ${{matrix.php}}

Check failure on line 1287 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "php" is not defined in object type {}
mysql: ${{matrix.mysql}}

Check failure on line 1288 in .github/workflows/universal_workflow_light.yaml

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

property "mysql" is not defined in object type {}
status: ${{job.status}}
debug: ${{ inputs.debug }}
github_token: ${{ secrets.enterprise_github_token || github.token }}

sonarcloud:
needs: ['init', 'install', 'runscript', 'runslim']
# yamllint disable-line rule:line-length
Expand Down

0 comments on commit 19bea7e

Please sign in to comment.