Skip to content

Commit

Permalink
Handle missing tests folder gracefully (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
release-github-action[bot] authored Jul 8, 2024
1 parent 4b522de commit d1eedf5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions run_test_script/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ runs:
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
TESTDIR='Tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m"
exit 1
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }}, creating it ###\033[0m"
TESTDIR='tests'
mkdir -p "source/${{ inputs.path }}/${TESTDIR}"
fi
fi
mkdir -p source/${{ inputs.path }}/${TESTDIR}/Output source/${{ inputs.path }}/${TESTDIR}/Reports
Expand Down Expand Up @@ -117,15 +118,16 @@ runs:
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
TESTDIR='Tests'
if [ ! -d "source/${{ inputs.path }}/${TESTDIR}" ]; then
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }} ###\033[0m"
exit 1
echo -e "\033[0;31m### Could not find folder tests or Tests in ${{ inputs.path }}, creating it ###\033[0m"
TESTDIR='tests'
fi
fi
if [ -s data/php/logs/error_log.txt ]; then
echo -e "\033[0;35mPHP error log\033[0m"
cat data/php/logs/error_log.txt
fi
touch data/php/logs/error_log.txt
mkdir -p "source/${{ inputs.path }}/${TESTDIR}/Output"
cp data/php/logs/error_log.txt source/${{ inputs.path }}/${TESTDIR}/Output/
cp data/mysql/mysql/slow_log* source/${{ inputs.path }}/${TESTDIR}/Output/
cp data/mysql/mysql/general_log* source/${{ inputs.path }}/${TESTDIR}/Output/
Expand Down

0 comments on commit d1eedf5

Please sign in to comment.