Skip to content

Commit 3712749

Browse files
committed
feat: add integration_test_template.sh
1 parent e70b589 commit 3712749

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.gitignore

13 Bytes
Binary file not shown.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
set -eEuo pipefail
3+
cd "$(dirname "$(readlink -f "$0")")"
4+
5+
source FIXME/lib/trap_error_info.sh
6+
source FIXME/lib/common_utils.sh
7+
8+
################################################################################
9+
# prepare
10+
################################################################################
11+
12+
# shellcheck disable=SC2034
13+
PREPARE_JDKS_INSTALL_BY_SDKMAN=(
14+
8.322.06.1-amzn
15+
11.0.14-ms
16+
17.0.2.8.1-amzn
17+
)
18+
19+
source FIXME/lib/prepare_jdks.sh
20+
21+
source FIXME/lib/java_build_utils.sh
22+
23+
################################################################################
24+
# ci build logic
25+
################################################################################
26+
27+
FIXME PROJECT_ROOT_DIR=/path/to/project/root/dir
28+
cd "$PROJECT_ROOT_DIR"
29+
30+
########################################
31+
# default jdk 11, do build and test
32+
########################################
33+
default_build_jdk_version=11
34+
35+
prepare_jdks::switch_java_home_to_jdk "$default_build_jdk_version"
36+
37+
cu::head_line_echo "build and test with Java: $JAVA_HOME"
38+
jvb::mvn_cmd clean install
39+
40+
########################################
41+
# test multi-version java
42+
# shellcheck disable=SC2154
43+
########################################
44+
for jhome_var_name in "${JDK_HOME_VAR_NAMES[@]}"; do
45+
# already tested by above `mvn install`
46+
[ "JDK${default_build_jdk_version}_HOME" = "$jhome_var_name" ] && continue
47+
48+
prepare_jdks::switch_java_home_to_jdk "${!jhome_var_name}"
49+
50+
cu::head_line_echo "test with Java: $JAVA_HOME"
51+
# just test without build
52+
jvb::mvn_cmd surefire:test
53+
done

0 commit comments

Comments
 (0)