-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallel_cukes.sh
executable file
·43 lines (35 loc) · 983 Bytes
/
parallel_cukes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Parallel cucumber test launcher
# Note that the RVM has to be started first as a pre-requisite
# Authors:
# Ruifeng Ma <ruifengm@sg.ibm.com>
# Date:
# 2016-May-03
OPTIONS=$(getopt -o hd: -l help,cuke_dir: -- "$@")
if [ $? -ne 0 ]; then
echo "getopt error"
exit 1
fi
eval set -- $OPTIONS
while true; do
case "$1" in
-h | --help) printf "This is a parallel cucumber test launcher.\n\nTrigger it by\n./parallel_cukes.sh -d <cucumber_direcotry>\nor\n./parallel_cukes.sh --cuke_dir <cucumber_direcotry>\n\n" ;;
-d | --cuke_dir)
CUKE_DIR="$2"
cd $CUKE_DIR
echo "Current directory: "
# pwd
echo $CUKE_DIR
source /etc/profile.d/rvm.sh
echo "Started RVM version: "
rvm -v
bundle exec parallel_cucumber $CUKE_DIR/features/parallel_tests/ -o "-p default"; shift ;;
--) shift ; break ;;
*) echo "unknown option: $1" ; exit 1 ;;
esac
shift
done
if [ $# -ne 0 ]; then
echo "unknown option(s): $@"
exit 1
fi