mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
34 lines
631 B
Bash
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
|