Skip to content

Commit

Permalink
TC-47 Test cypress e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Jan 16, 2025
1 parent 7157f9a commit 5d8aeed
Showing 1 changed file with 38 additions and 30 deletions.
68 changes: 38 additions & 30 deletions .github/workflows/universal_workflow_light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ jobs:
github_token: ${{ secrets.enterprise_github_token || github.token }}

cypress:
needs: ['init','install','runscript']
needs: ['init', 'install', 'runscript']
strategy:
matrix:
php: ${{ fromJSON(needs.init.outputs.runscript_matrix_php) }}
Expand Down Expand Up @@ -1164,60 +1164,68 @@ jobs:
logfile: load_testplan_runscript.log
token: ${{ secrets.enterprise_github_token || github.token }}

- name: Set Cypress Variables
run: |

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

View workflow job for this annotation

GitHub Actions / osc_telecash_php82_mysql_80 / actionlint

shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects
echo "cypress_composer_transform=some_value" >> "${GITHUB_ENV}"
echo "cypress_composer_early=false" >> "${GITHUB_ENV}"
echo "cypress_container_name=php" >> "${GITHUB_ENV}"
echo "cypress_container_options=" >> "${GITHUB_ENV}"
echo "cypress_path=/var/www/html" >> "${GITHUB_ENV}"
- name: Convert variables
id: cy
shell: bash
run: |
echo "Debugging environment variables:"
env | grep "^cypress_"
env | grep "^cypress_" || true
echo "Setting outputs..."
# Rest of the script...
${{ needs.init.outputs.debug }}
"${{ needs.init.outputs.debug }}"
set +x
E=$(env|grep -e "^cypress_")
E="$(env | grep -e "^cypress_")"
MATRIX_SCRIPT='osc_telecash:cypress'
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
if [[ "${MATRIX_SCRIPT}" != *":"* ]]; then
echo -e "\033[0;31m Script 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 "cypress_script=${SCRIPT}" >> $GITHUB_OUTPUT
echo "cypress_script=${SCRIPT}" >> "${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="cypress_${PREFIX}_${KEY}"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR="cypress_${KEY}"
fi
echo "cypress_${KEY}=${!VAR}" >> $GITHUB_OUTPUT
export "cypress_${KEY}"="${!VAR}"
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="cypress_${PREFIX}_${KEY}"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR="cypress_${KEY}"
fi
echo "cypress_${KEY}=${!VAR}" >> "${GITHUB_OUTPUT}"
export "cypress_${KEY}=${!VAR}"
done
if [ "${cypress_composer_early}" == 'false' ]; then
echo 'cypress_run_composer_install=true' >> $GITHUB_OUTPUT
if [ "${cypress_composer_early}" = 'false' ]; then
echo 'cypress_run_composer_install=true' >> "${GITHUB_OUTPUT}"
fi
# If cypress_workdir is ~, it will be set to the value of cypress_path
VAR="cypress_${PREFIX}_workdir"
if [[ "${E}" != *"${VAR}"* ]]; then
VAR='cypress_workdir'
VAR='cypress_workdir'
fi
if [ "${!VAR}" == '~' ]; then
echo "cypress_workdir=${cypress_path}" >> $GITHUB_OUTPUT
if [ "${!VAR}" = '~' ]; then
echo "cypress_workdir=${cypress_path}" >> "${GITHUB_OUTPUT}"
else
echo "cypress_workdir=${!VAR}" >> $GITHUB_OUTPUT
echo "cypress_workdir=${!VAR}" >> "${GITHUB_OUTPUT}"
fi
SUFFIX="${PREFIX}_${SCRIPT}-${{ steps.rstn.outputs.matrix_suffix }}"
echo "cypress_suffix=${SUFFIX}" | \
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' >> $GITHUB_OUTPUT
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' >> "${GITHUB_OUTPUT}"
echo "cypress_title=${PREFIX}_${SCRIPT}" | \
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' >> $GITHUB_OUTPUT
sed -E 's#\s|\~|"|,|:|<|>|\||\*|\?|\/|\\#_#g' | \
sed -e 's#\-\-*#-#' -e 's#\_\_*#_#g' >> "${GITHUB_OUTPUT}"
- name: Debug Outputs
run: |
Expand Down

0 comments on commit 5d8aeed

Please sign in to comment.