Skip to content

Commit 7c835b9

Browse files
committed
Add support to restrict manual ToBiB runs
PHPUnit: - by --filter - by --testsuite Behat: - by --tags - by --name (first attempt)
1 parent 965739e commit 7c835b9

File tree

1 file changed

+42
-0
lines changed
  • tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls

1 file changed

+42
-0
lines changed

tracker_automations/bulk_prelaunch_jobs/criteria/list_of_mdls/jobs.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@
88
# Set the runner if not specified.
99
runner="${runner:-STABLE}"
1010

11+
# Some issue must be specified.
12+
if [[ -z ${issueslist} ]]; then
13+
echo "Error: Need to specify one or multiple (comma separated) MDL issues in $issueslist"
14+
exit 1
15+
fi
16+
17+
# We don't allow both phpunit_filter and behat_tags together
18+
# (because they both use the very same TAGS env variable)
19+
if [[ -n ${phpunit_filter} ]] && [[ -n ${behat_tags} ]]; then
20+
echo "ERROR: Cannot use phpunit_filter and behat_tags together"
21+
exit 1
22+
fi
23+
24+
# Calculate the PHPUnit options (filter, testsuite) to use.
25+
phpunit_options=
26+
if [[ -n ${phpunit_filter} ]]; then
27+
phpunit_options="--filter ${phpunit_filter}"
28+
fi
29+
if [[ -n ${phpunit_suite} ]]; then
30+
phpunit_options+=" --testsuite ${phpunit_suite}"
31+
fi
32+
33+
# Calculate the Behat options (tags, name) to use.
34+
behat_options=
35+
if [[ -n ${behat_tags} ]]; then
36+
behat_options="--tags ${behat_tags}"
37+
fi
38+
if [[ -n ${behat_name} ]]; then
39+
behat_options+=" --name \"${behat_name}\""
40+
fi
41+
42+
echo "PHPUnit options: ${phpunit_options}"
43+
echo "Behat options: ${behat_options}"
44+
1145
# We want to launch always a sqlsrv PHPUNIT
1246
if [[ "${jobtype}" == "all" ]] || [[ "${jobtype}" == "phpunit" ]]; then
1347
echo -n "PHPUnit (sqlsrv): " >> "${resultfile}.jenkinscli"
@@ -16,6 +50,8 @@ if [[ "${jobtype}" == "all" ]] || [[ "${jobtype}" == "phpunit" ]]; then
1650
-p BRANCH=${branch} \
1751
-p DATABASE=sqlsrv \
1852
-p PHPVERSION=${php_version} \
53+
-p TAGS=${phpunit_filter} \
54+
-p TESTSUITE=${phpunit_suite} \
1955
-p RUNNERVERSION=${runner} \
2056
-w >> "${resultfile}.jenkinscli" < /dev/null
2157
fi
@@ -48,6 +84,8 @@ if [[ "${jobtype}" == "all" ]] || [[ "${jobtype}" == "behat-all" ]] || [[ "${job
4884
-p PHPVERSION=${php_version} \
4985
-p BROWSER=goutte \
5086
-p BEHAT_SUITE=ALL \
87+
-p TAGS=${behat_tags} \
88+
-p NAME=${behat_name} \
5189
-p RUNNERVERSION=${runner} \
5290
-w >> "${resultfile}.jenkinscli" < /dev/null
5391
fi
@@ -61,6 +99,8 @@ if [[ "${jobtype}" == "all" ]] || [[ "${jobtype}" == "behat-all" ]] || [[ "${job
6199
-p DATABASE=pgsql \
62100
-p PHPVERSION=${php_version} \
63101
-p BROWSER=firefox \
102+
-p TAGS=${behat_tags} \
103+
-p NAME=${behat_name} \
64104
-p RUNNERVERSION=${runner} \
65105
-w >> "${resultfile}.jenkinscli" < /dev/null
66106
fi
@@ -75,6 +115,8 @@ if [[ "${jobtype}" == "all" ]] || [[ "${jobtype}" == "behat-all" ]] || [[ "${job
75115
-p PHPVERSION=${php_version} \
76116
-p BROWSER=firefox \
77117
-p BEHAT_SUITE=classic \
118+
-p TAGS=${behat_tags} \
119+
-p NAME=${behat_name} \
78120
-p RUNNERVERSION=${runner} \
79121
-w >> "${resultfile}.jenkinscli" < /dev/null
80122
fi

0 commit comments

Comments
 (0)