Skip to content

Commit

Permalink
Add process option
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Nov 3, 2023
1 parent 431d3f2 commit a6290ff
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/ibexabehat
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CONFIG=''
OTHER_OPTIONS=''
MODE='parallel'
STRICT='--strict'
PROCESS=''
GROUP_COUNT=1
GROUP_OFFSET=0

Expand All @@ -40,6 +41,7 @@ Options:
\t -s, --suite=SUITE; Behat tests suite;
\t -t, --tags=TAGS; Behat tags filter;
\t --non-strict; Run Behat in non-strict mode;
\t --process=N; Number of parallel processes, default: available CPUs;
\t --group-count; Split the tests into multiple groups
\t --group-offset; Use together with --group-count, get Scenarios for a group
" | column -t -s ";"
Expand All @@ -57,7 +59,7 @@ behat(){
}

fastest(){
get_behat_features | "$COMPOSER_RUNTIME_BIN_DIR/fastest" --ansi -o -v "$COMPOSER_RUNTIME_BIN_DIR/behat {} ${CONFIG} ${PROFILE}${SUITE}${TAGS}--no-interaction --colors -vv ${STRICT} ${OTHER_OPTIONS}"
get_behat_features | "$COMPOSER_RUNTIME_BIN_DIR/fastest" $PROCESS --ansi -o -v "$COMPOSER_RUNTIME_BIN_DIR/behat {} ${CONFIG} ${PROFILE}${SUITE}${TAGS}--no-interaction --colors -vv ${STRICT} ${OTHER_OPTIONS}"
}

# Fastest option 'list-features' gives us the list of all features from given context in random order, which are later
Expand All @@ -82,6 +84,7 @@ case $i in
-t=*|--tags=*) TAGS="--tags=${i#*=} ";;
-c=*|--config=*) CONFIG="--config=${i#*=}";;
--non-strict) STRICT='';;
--process=*) PROCESS="--process=${i#*=}";;
--group-count=*) GROUP_COUNT=${i#*=};;
--group-offset=*) GROUP_OFFSET=${i#*=};;
-h|--help) usage; exit 1;;
Expand Down
43 changes: 43 additions & 0 deletions patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/bin/ibexabehat b/bin/ibexabehat
index 691b8e9..35d6eb3 100755
--- a/bin/ibexabehat
+++ b/bin/ibexabehat
@@ -24,6 +24,7 @@ CONFIG=''
OTHER_OPTIONS=''
MODE='parallel'
STRICT='--strict'
+PROCESS=''
GROUP_COUNT=1
GROUP_OFFSET=0

@@ -40,6 +41,7 @@ Options:
\t -s, --suite=SUITE; Behat tests suite;
\t -t, --tags=TAGS; Behat tags filter;
\t --non-strict; Run Behat in non-strict mode;
+\t -p, --process=M; Number of parallel processes, default: available CPUs;
\t --group-count; Split the tests into multiple groups
\t --group-offset; Use together with --group-count, get Scenarios for a group
" | column -t -s ";"
@@ -57,7 +59,7 @@ behat(){
}

fastest(){
- get_behat_features | "$COMPOSER_RUNTIME_BIN_DIR/fastest" --ansi -o -v
"$COMPOSER_RUNTIME_BIN_DIR/behat {} ${CONFIG} ${PROFILE}${SUITE}${TAGS}--no-interaction --colors -vv
${STRICT} ${OTHER_OPTIONS}"
+ get_behat_features | "$COMPOSER_RUNTIME_BIN_DIR/fastest" $PROCESS --ansi -o -v
"$COMPOSER_RUNTIME_BIN_DIR/behat {} ${CONFIG} ${PROFILE}${SUITE}${TAGS}--no-interaction --colors -vv
${STRICT} ${OTHER_OPTIONS}"
}

# Fastest option 'list-features' gives us the list of all features from given context in random order,
which are later
@@ -81,6 +83,7 @@ case $i in
-s=*|--suite=*) SUITE="--suite=${i#*=} ";;
-t=*|--tags=*) TAGS="--tags=${i#*=} ";;
-c=*|--config=*) CONFIG="--config=${i#*=}";;
+ -p=*|--process=*) PROCESS="--process=${i#*=}";;
--non-strict) STRICT='';;
--group-count=*) GROUP_COUNT=${i#*=};;
--group-offset=*) GROUP_OFFSET=${i#*=};;

0 comments on commit a6290ff

Please sign in to comment.