-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtest_projects
More file actions
executable file
·93 lines (76 loc) · 2.48 KB
/
test_projects
File metadata and controls
executable file
·93 lines (76 loc) · 2.48 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
set -eo pipefail
AGENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${AGENT_DIR}"
mkdir -p build/fixtures
# shellcheck source=../test/helper.bash
source "test/helper.bash"
ANNOTATION_JAR="$(find_annotation_jar)"
export ANNOTATION_JAR
function install_petclinic() {
local repo="$1"; shift
local ref=${1:-main}
local pkg
pkg="$(basename "$repo")"
if [[ -d "build/fixtures/${pkg}" ]]; then
echo "Fixture already exists: ${pkg}"
return
fi
cd build/fixtures
rm -rf "${pkg}"
if [[ "${#ref}" == 40 ]]; then
# It's a commit hash, download archive
echo "Downloading archive for ${repo} at commit ${ref}"
curl -L "https://github.com/${repo}/archive/${ref}.tar.gz" | tar xz
mv "${pkg}-${ref}" "${pkg}"
cd "${pkg}"
# The archive doesn't include git history, but the tests rely on it for
# metadata. We create a fresh git repo to satisfy the tests.
git init
git config user.email "test@example.com"
git config user.name "Test User"
git remote add origin "https://github.com/${repo}.git"
git add .
git commit -m "Initial commit"
else
# It's a branch, use git clone
echo "Cloning ${repo} at branch ${ref}"
git clone https://github.com/"${repo}".git --depth 1 --branch "${ref}"
cd "${pkg}"
fi
cd ../../..
}
function install_scala_test_app {
if [[ -d "test/scala/play-samples" ]]; then
echo "Fixture already exists: play-samples"
return
fi
cd test/scala
rm -rf play-samples
local branch=3.0.x
if is_java 17; then
branch=3.0.x
elif is_java 11; then
branch=2.9.x
else
branch=2.8.x
fi
git clone --no-checkout https://github.com/playframework/play-samples.git --depth 1 --branch $branch
cd play-samples
git sparse-checkout set play-scala-rest-api-example
git checkout
cp ../logback-test.xml play-scala-rest-api-example/conf/.
cd ../../..
}
if is_java 25; then
install_petclinic "spring-projects/spring-petclinic" "main"
install_petclinic "spring-petclinic/spring-framework-petclinic"
elif is_java 17; then
# The spring-petclinic main branch now requires Java 25. This is the last commit that supports Java 17.
install_petclinic "spring-projects/spring-petclinic" "3aa79e3944ab1b626288f5d0629e61643ab8fb4a"
install_petclinic "spring-petclinic/spring-framework-petclinic"
else
install_petclinic "land-of-apps/spring-petclinic" old-java-support
fi
patch -N -p1 -d build/fixtures/spring-petclinic < test/petclinic/pom.patch
install_scala_test_app