Skip to content

Commit

Permalink
fix split into parts
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Oct 6, 2023
1 parent 57a1e76 commit 3071868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions tests/acceptance/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,6 @@ fi

declare -a BEHAT_SUITES

BEHAT_FILTER_SUITE=""
if [[ -f "${BEHAT_FILTER_SUITE_FILE}" ]]
then
BEHAT_FILTER_SUITE=`cat "${BEHAT_FILTER_SUITE_FILE}"`
fi

function get_behat_suites() {
# $1 type of suites to get "api" or "core-api"
# defaults to "api"
Expand All @@ -446,7 +440,7 @@ function get_behat_suites() {
then
TYPE="api"
fi

ALL_SUITES=""
for suite in `find ${BEHAT_FEATURES_DIR}/ -type d -iname ${TYPE}* | sort | rev | cut -d"/" -f1 | rev`
do
Expand All @@ -456,13 +450,12 @@ function get_behat_suites() {
then
ALL_SUITES+="$suite"$'\n'
fi
else
ALL_SUITES+="$suite"$'\n'
fi
done

ALL_SUITES=`echo "${ALL_SUITES}" | tr " " "\n"`

COUNT_ALL_SUITES=`echo "${ALL_SUITES}" | wc -l`
echo "Total suits to run: $COUNT_ALL_SUITES"
COUNT_ALL_SUITES=`echo "${ALL_SUITES}" | tr " " "\n" | wc -l`

#divide the suites letting it round down (could be zero)
MIN_SUITES_PER_RUN=$((${COUNT_ALL_SUITES} / ${DIVIDE_INTO_NUM_PARTS}))
Expand All @@ -487,8 +480,7 @@ function get_behat_suites() {
fi

COUNT_FINISH_AND_TODO_SUITES=$((${SUITES_IN_PREVIOUS_RUNS} + ${SUITES_THIS_RUN}))
BEHAT_SUITES+=(`echo "${ALL_SUITES}" | head -n ${COUNT_FINISH_AND_TODO_SUITES} | tail -n ${SUITES_THIS_RUN}`)
echo "Suites to run in this run: $BEHAT_SUITES"
BEHAT_SUITES+=(`echo "${ALL_SUITES}" | tr " " "\n" | head -n ${COUNT_FINISH_AND_TODO_SUITES} | tail -n ${SUITES_THIS_RUN}`)
}

if [[ -n "${BEHAT_SUITE}" ]]
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ services:
BEHAT_FEATURES_DIR: /mnt/ocis/tests/acceptance/features
BEHAT_YML: /mnt/acceptance/config/behat-core.yml
ACCEPTANCE_TEST_TYPE: core-api
BEHAT_FILTER_SUITE: /mnt/acceptance/filtered-suites-acceptance-2-EOS
BEHAT_FILTER_SUITE_FILE: /mnt/acceptance/filtered-suites-acceptance-2-EOS
volumes:
- shared-volume:/var/tmp
working_dir: /mnt/ocis
Expand Down

0 comments on commit 3071868

Please sign in to comment.