Files
wp-graphql-woocommerce/bin/codecept
T

34 lines
631 B
Bash

#!/usr/bin/env bash
set -eu
declare work_dir=$(pwd)
if [ 'run' = "$1" ]; then
declare no_exit="--no-exit";
fi
cd $PROJECT_DIR
echo "Running 'codecept $@' in Docker..."
~/.composer/vendor/bin/codecept $@ --env docker --no-redirect $no_exit
if [ 'run' = "$1" ]; then
declare test_output="tests/_output";
if [ -n "$(ls $test_output )" ]; then
echo 'Setting result files permissions'.
chmod 777 -R ${test_output}/*
fi
# Check results and exit accordingly.
if [ -f "$test_output/failed" ]; then
echo "Uh oh, some went wrong." >> /dev/stderr
exit 1
else
echo "Woohoo! It's working!"
exit 0
fi
fi
cd $work_dir