4 ## Setup a test site based on source code in the Jenkins workspace
5 ## and run the test suite.
7 ## To configure a Jenkins job which runs tests and produces code-coverage,
8 ## put something like this in the job configuration:
10 ## [ -d "${WORKSPACE}/build" ] && rm -rf "${WORKSPACE}/build"
11 ## mkdir -p "${WORKSPACE}/build" "${WORKSPACE}/build/CodeCoverage"
12 ## ${WORKSPACE}/civicrm/tools/scripts/phpunit-jenkins \
14 ## --coverage-clover "${WORKSPACE}/build/CodeCoverage/clover.xml" \
15 ## --coverage-html "${WORKSPACE}/build/CodeCoverage/" \
16 ## --log-junit "${WORKSPACE}/build/junit.xml" \
19 ## To configure a Jenkins job which run tests but omits code-coverage:
21 ## [ -d "${WORKSPACE}/build" ] && rm -rf "${WORKSPACE}/build"
22 ## mkdir -p "${WORKSPACE}/build"
23 ## ${WORKSPACE}/civicrm/tools/scripts/phpunit-jenkins \
25 ## --log-junit "${WORKSPACE}/build/junit.xml" \
29 if [ -z "$EXECUTOR_NUMBER" -o -z "$WORKSPACE" ]; then
30 echo "This script requires the following environment variables:"
31 echo "EXECUTOR_NUMBER"
37 OUTPUT
="${WORKSPACE}/build"
38 DRUPAL_ROOT
="/var/www/drupal"
39 SITE_URL
="jenkins-${EXECUTOR_NUMBER}.localhost"
40 SITE_DB
="jenkins_${EXECUTOR_NUMBER}"
41 export CIVICRM_LOCALES
=en_US
,fr_FR
44 bash
"${WORKSPACE}/civicrm/tools/scripts/mk-drupal-test-site" "${SITE_URL}" "${SITE_DB}" "${DRUPAL_ROOT}" "${WORKSPACE}/civicrm/"
47 pushd "${DRUPAL_ROOT}/sites/${SITE_URL}/modules/civicrm/tools"
48 .
/scripts
/phpunit
"$@"
49 # --process-isolation \