<commit_before>#!/usr/bin/env bash

composer install

OC_PATH=../../
OCC=${OC_PATH}occ
BEHAT=vendor/bin/behat

SCENARIO_TO_RUN=$1
HIDE_OC_LOGS=$2

function env_alt_home_enable {
	$OCC app:enable testing
	$OCC config:app:set testing enable_alt_user_backend --value yes
}

function env_alt_home_clear {
	$OCC app:disable testing
}

function env_encryption_enable {
	$OCC app:enable encryption
	$OCC encryption:enable
}

function env_encryption_disable {
	$OCC encryption:disable
	$OCC app:disable encryption
}

# avoid port collision on jenkins - use $EXECUTOR_NUMBER
if [ -z "$EXECUTOR_NUMBER" ]; then
    EXECUTOR_NUMBER=0
fi
PORT=$((8080 + $EXECUTOR_NUMBER))
echo $PORT
php -S localhost:$PORT -t ../.. &
PHPPID=$!
echo $PHPPID

PORT_FED=$((8180 + $EXECUTOR_NUMBER))
echo $PORT_FED
php -S localhost:$PORT_FED -t ../.. &
PHPPID_FED=$!
echo $PHPPID_FED

export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
export TEST_SERVER_FED_URL="http://localhost:$PORT_FED/ocs/"

#Enable external storage app
$OCC app:enable files_external

mkdir -p work/local_storage
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage` 

ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | awk {'print $5'}`

$OCC files_external:option $ID_STORAGE enable_sharing true

if test "$OC_TEST_ALT_HOME" = "1"; then
	env_alt_home_enable
fi

# Enable encryption if requested
if test "$OC_TEST_ENCRYPTION_ENABLED" = "1"; then
	env_encryption_enable
	BEHAT_FILTER_TAGS="~@no_encryption"
fi
<commit_msg>Make sure we could create the work folder in int tests<commit_after>#!/usr/bin/env bash

composer install

OC_PATH=../../
OCC=${OC_PATH}occ
BEHAT=vendor/bin/behat

SCENARIO_TO_RUN=$1
HIDE_OC_LOGS=$2

function env_alt_home_enable {
	$OCC app:enable testing
	$OCC config:app:set testing enable_alt_user_backend --value yes
}

function env_alt_home_clear {
	$OCC app:disable testing
}

function env_encryption_enable {
	$OCC app:enable encryption
	$OCC encryption:enable
}

function env_encryption_disable {
	$OCC encryption:disable
	$OCC app:disable encryption
}

# avoid port collision on jenkins - use $EXECUTOR_NUMBER
if [ -z "$EXECUTOR_NUMBER" ]; then
    EXECUTOR_NUMBER=0
fi
PORT=$((8080 + $EXECUTOR_NUMBER))
echo $PORT
php -S localhost:$PORT -t ../.. &
PHPPID=$!
echo $PHPPID

PORT_FED=$((8180 + $EXECUTOR_NUMBER))
echo $PORT_FED
php -S localhost:$PORT_FED -t ../.. &
PHPPID_FED=$!
echo $PHPPID_FED

export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
export TEST_SERVER_FED_URL="http://localhost:$PORT_FED/ocs/"

#Enable external storage app
$OCC app:enable files_external

mkdir -p work/local_storage || { echo "Unable to create work folder" >&2; exit 1; }
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage` 

ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | awk {'print $5'}`

$OCC files_external:option $ID_STORAGE enable_sharing true

if test "$OC_TEST_ALT_HOME" = "1"; then
	env_alt_home_enable
fi

# Enable encryption if requested
if test "$OC_TEST_ENCRYPTION_ENABLED" = "1"; then
	env_encryption_enable
	BEHAT_FILTER_TAGS="~@no_encryption"
fi

{'fraction_non_alphanumeric': 0.11690363349131122, 'fraction_numerical': 0.009478672985781991, 'mean_word_length': 5.779443254817987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '4519122', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1174, 'n_words': 267}