forked from jenkinsci/bom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pct.sh
executable file
·43 lines (37 loc) · 1.29 KB
/
pct.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
43
#!/usr/bin/env bash
set -euxo pipefail
cd "$(dirname "$0")"
# expects: excludes.txt, target/megawar-$LINE.war, target/pct.jar, $PLUGINS, $LINE
rm -rf target/pct-work
PCT_D_ARGS=
if [[ -n ${EXTRA_MAVEN_PROPERTIES-} ]]; then
for prop in ${EXTRA_MAVEN_PROPERTIES//:/ }; do
PCT_D_ARGS+="-D${prop} "
done
fi
if ! [[ $PLUGINS =~ blueocean || $PLUGINS =~ lockable-resources || $PLUGINS =~ pipeline-maven ]]; then
#
# The Blue Ocean, Lockable Resources, and Pipeline Maven Integration
# test suites use a lot of memory and cannot handle parallelism.
#
PCT_D_ARGS+='-DforkCount=.75C '
fi
#
# jenkinsci/workflow-cps-plugin#877 depends on jenkinsci/jenkins#9012, but only
# on Java 17 and newer. The 2.426.x line is the only remaining line to which
# jenkinsci/jenkins#9012 has not been backported. When we drop support for
# 2.426.x, this should be deleted.
#
if [[ $PLUGINS =~ pipeline-groovy-lib && $LINE == 2.426.x ]]; then
echo 'org.jenkinsci.plugins.workflow.libs.LibraryMemoryTest#loaderReleased' >>excludes.txt
fi
exec java \
-jar target/pct.jar \
test-plugins \
--war "$(pwd)/target/megawar-$LINE.war" \
--include-plugins "${PLUGINS}" \
--working-dir "$(pwd)/target/pct-work" \
$PCT_D_ARGS \
${PCT_OPTS-} \
-Dsurefire.excludesFile="$(pwd)/excludes.txt"
# produces: **/target/surefire-reports/TEST-*.xml