#!/usr/bin/env bash # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. set -e trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR # prepare for test suite case $TEST_SUITE in integration) cd dev/tests/integration test_set_list=$(find testsuite/* -maxdepth 1 -mindepth 1 -type d | sort) test_set_count=$(printf "$test_set_list" | wc -l) test_set_size[1]=$(printf "%.0f" $(echo "$test_set_count*0.13" | bc)) #13% test_set_size[2]=$(printf "%.0f" $(echo "$test_set_count*0.30" | bc)) #30% test_set_size[3]=$((test_set_count-test_set_size[1]-test_set_size[2])) #55% echo "Total = ${test_set_count}; Batch #1 = ${test_set_size[1]}; Batch #2 = ${test_set_size[2]}; Batch #3 = ${test_set_size[3]};"; echo "==> preparing integration testsuite on index $INTEGRATION_INDEX with set size of ${test_set_size[$INTEGRATION_INDEX]}" cp phpunit.xml.dist phpunit.xml # remove memory usage tests if from any set other than the first if [[ $INTEGRATION_INDEX > 1 ]]; then echo " - removing testsuite/Magento/MemoryUsageTest.php" perl -pi -0e 's#^\s+