Skip to content

Instantly share code, notes, and snippets.

@stronk7
Created September 14, 2020 09:05
Show Gist options
  • Save stronk7/381d9218cac076ea6c3daca18df03ff0 to your computer and use it in GitHub Desktop.
Save stronk7/381d9218cac076ea6c3daca18df03ff0 to your computer and use it in GitHub Desktop.
Simple wrapper over moodle-ci-runner for easy launch phpunit/behat dockerised runs locally
#!/opt/local/bin/bash
export WORKSPACE=/tmp/ws
export CODEDIR=/Users/stronk7/git_moodle/ci-tests
export BUILD_ID=cirunner
export PHP_VERSION=${PHP_VERSION:-7.3}
export DBTYPE=${DBTYPE:-pgsql}
export TESTTORUN=${TESTTORUN:-phpunit}
if [[ "$TESTTORUN" == "phpunit" ]]; then
export TESTSUITE=${TESTSUITE:-}
export TAGS=${TAGS:-}
elif [[ "$TESTTORUN" == "behat" ]]; then
export BEHAT_TOTAL_RUNS=${BEHAT_TOTAL_RUNS:-1}
export BEHAT_NUM_RERUNS=${BEHAT_NUM_RERUNS:-5}
export APP_VERSION=${APP_VERSION:-latest}
export BROWSER=${BROWSER:-chrome}
export BEHAT_SUITE=default
export TAGS=${TAGS:-@core_auth}
export NAME="${NAME:-}"
elif [[ "$TESTTORUN" == "postcommit" ]]; then
echo "TODO!"
fi
# Remove stuff that should not be there
rm -fr ${CODEDIR}/vendor ${CODEDIR}/node_modules
# Create the workspace dir to put results
mkdir -p "${WORKSPACE}"
. /Users/stronk7/git_moodle/moodle-ci-runner/runner/master/run.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment