<commit_before>#!/usr/bin/env bash
set -xeo pipefail

# Note this is a fix for issues with php7.2 where having php-memcached present
# leads to encountering segmentation faults
#
# Ref: https://github.com/owncloud-ci/php/issues/33

export ZEND_DONT_UNLOAD_MODULES=1

if [[ "$(pwd)" == "$(cd "$(dirname "$0")"; pwd -P)" ]]; then
  echo "Can only be executed from project root!"
  exit 1
fi

set_up_external_storage() {
    php occ app:enable files_external
    php occ config:app:set core enable_external_storage --value=yes
    case "${FILES_EXTERNAL_TYPE}" in
    webdav)
      wait-for-it -t 120 webdav:80
      cp tests/drone/configs/config.files_external.webdav-apache.php apps/files_external/tests/config.webdav.php
      FILES_EXTERNAL_TEST_TO_RUN=WebdavTest.php
      ;;
    samba)
      wait-for-it -t 120 samba:445
      cp tests/drone/configs/config.files_external.smb-samba.php apps/files_external/tests/config.smb.php
      FILES_EXTERNAL_TEST_TO_RUN=SmbTest.php
      ;;
    windows)
      wait-for-it -t 120 fsweb.test.owncloud.com:445
      cp tests/drone/configs/config.files_external.smb-windows.php apps/files_external/tests/config.smb.php
      FILES_EXTERNAL_TEST_TO_RUN=SmbTest.php
      ;;
    *)
      echo "Unsupported files external type!"
      exit 1
      ;;
  esac
  FILES_EXTERNAL_TEST_TO_RUN="apps/files_external/tests/Storage/${FILES_EXTERNAL_TEST_TO_RUN}"
}

if [[ "${DB_TYPE}" == "sqlite" || -z "${DB_TYPE}" || "${COVERAGE}" == "true" ]]; then
  GROUP=""
else
  GROUP="--group DB"
fi

# still required to run unit tests for encryption
php occ app:enable encryption

# show a little debug information
php occ app:list

phpunit_cmd="php ./lib/composer/bin/phpunit"
if [[ "${COVERAGE}" == "true" ]]; then<commit_msg>No need to enable encryption app for testing<commit_after>#!/usr/bin/env bash
set -xeo pipefail

# Note this is a fix for issues with php7.2 where having php-memcached present
# leads to encountering segmentation faults
#
# Ref: https://github.com/owncloud-ci/php/issues/33

export ZEND_DONT_UNLOAD_MODULES=1

if [[ "$(pwd)" == "$(cd "$(dirname "$0")"; pwd -P)" ]]; then
  echo "Can only be executed from project root!"
  exit 1
fi

set_up_external_storage() {
    php occ app:enable files_external
    php occ config:app:set core enable_external_storage --value=yes
    case "${FILES_EXTERNAL_TYPE}" in
    webdav)
      wait-for-it -t 120 webdav:80
      cp tests/drone/configs/config.files_external.webdav-apache.php apps/files_external/tests/config.webdav.php
      FILES_EXTERNAL_TEST_TO_RUN=WebdavTest.php
      ;;
    samba)
      wait-for-it -t 120 samba:445
      cp tests/drone/configs/config.files_external.smb-samba.php apps/files_external/tests/config.smb.php
      FILES_EXTERNAL_TEST_TO_RUN=SmbTest.php
      ;;
    windows)
      wait-for-it -t 120 fsweb.test.owncloud.com:445
      cp tests/drone/configs/config.files_external.smb-windows.php apps/files_external/tests/config.smb.php
      FILES_EXTERNAL_TEST_TO_RUN=SmbTest.php
      ;;
    *)
      echo "Unsupported files external type!"
      exit 1
      ;;
  esac
  FILES_EXTERNAL_TEST_TO_RUN="apps/files_external/tests/Storage/${FILES_EXTERNAL_TEST_TO_RUN}"
}

if [[ "${DB_TYPE}" == "sqlite" || -z "${DB_TYPE}" || "${COVERAGE}" == "true" ]]; then
  GROUP=""
else
  GROUP="--group DB"
fi

# show a little debug information
php occ app:list

phpunit_cmd="php ./lib/composer/bin/phpunit"
if [[ "${COVERAGE}" == "true" ]]; then
{'fraction_non_alphanumeric': 0.12775842044134728, 'fraction_numerical': 0.014518002322880372, 'mean_word_length': 3.605614973262032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7220276', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1209, 'n_words': 264}