-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathconfig.yml
207 lines (176 loc) · 5.92 KB
/
config.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# --------------------------------
# Integration test for run-java.sh
# --------------------------------
job_defaults: &job_defaults
environment:
JDK8_TAG: 8u181
JDK11_TAG: 11.0.2-jdk-stretch
version: 2
jobs:
# Create the Docker image used for running the tests
# Two versions for Java 8 and Java 11
test_runner_8:
<<: *job_defaults
docker:
- image: docker:17.09.0-ce-git
steps:
- checkout
- setup_remote_docker:
version: 17.09.0-ce
- restore_cache:
key: docker-8-{{ checksum "test/docker/Dockerfile" }}-{{ checksum "test/docker/run_tests.sh" }}
- run:
name: Create and push builder image for Java 8
working_directory: test/docker
command: |
if [ ! -f timestamp ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker build --build-arg JDK=${JDK8_TAG} -t fabric8/run-java-sh-test:${JDK8_TAG} .
docker push fabric8/run-java-sh-test:${JDK8_TAG}
docker tag fabric8/run-java-sh-test:${JDK8_TAG} fabric8/run-java-sh-test:openjdk8
docker push fabric8/run-java-sh-test:openjdk8
docker tag fabric8/run-java-sh-test:${JDK8_TAG} fabric8/run-java-sh-test:latest
docker push fabric8/run-java-sh-test:latest
touch timestamp
fi
- save_cache:
key: docker-8-{{ checksum "test/docker/Dockerfile" }}-{{ checksum "test/docker/run_tests.sh" }}
paths:
- test/docker/timestamp
test_runner_11:
<<: *job_defaults
docker:
- image: docker:17.09.0-ce-git
steps:
- checkout
- setup_remote_docker:
version: 17.09.0-ce
# Only build the docker image if not already build and pushed.
# This is determined by the checksums of Dockerfile and run_tests.sh
- restore_cache:
key: docker-9-{{ checksum "test/docker/Dockerfile" }}-{{ checksum "test/docker/run_tests.sh" }}
- run:
name: Create and push builder image for Java 11
working_directory: test/docker
command: |
if [ ! -f timestamp ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker build --build-arg JDK=${JDK11_TAG} -t fabric8/run-java-sh-test:${JDK11_TAG} .
docker push fabric8/run-java-sh-test:${JDK11_TAG}
docker tag fabric8/run-java-sh-test:${JDK11_TAG} fabric8/run-java-sh-test:openjdk11
docker push fabric8/run-java-sh-test:openjdk11
touch timestamp
fi
- save_cache:
key: docker-9-{{ checksum "test/docker/Dockerfile" }}-{{ checksum "test/docker/run_tests.sh" }}
paths:
- test/docker/timestamp
# Run all test in a machine in order to start Docker containers
# with various memory and CPU settings. In order to save time,
# run everything in a single job
vm_test:
<<: *job_defaults
machine: true
steps:
- checkout
- run:
name: Run tests for JDK 8 / unlimited
environment:
REPORT_DIR: reports/unlimited/jdk8
JDK_TAG: openjdk8
command: test/run_all.sh
- run:
name: Run tests for JDK 11 / unlimited
environment:
REPORT_DIR: reports/unlimited/jdk11
JDK_TAG: openjdk11
command: test/run_all.sh
- run:
name: Run tests for JDK 8 / 160m
environment:
MEMORY: 160m
REPORT_DIR: reports/160m/jdk8
JDK_TAG: openjdk8
command: test/run_all.sh
- run:
name: Run tests for JDK 11 / 160m
environment:
MEMORY: 160m
REPORT_DIR: reports/160m/jdk11
JDK_TAG: openjdk11
command: test/run_all.sh
- run:
name: Run tests for JDK 8 / 400m
environment:
MEMORY: 400m
REPORT_DIR: reports/400m/jdk8
JDK_TAG: openjdk8
command: test/run_all.sh
- run:
name: Run tests for JDK 11 / 400m
environment:
MEMORY: 400m
REPORT_DIR: reports/400m/jdk11
JDK_TAG: openjdk11
command: test/run_all.sh
- run:
name: Run tests for JDK 8 / 80m / 1.5 cpus
environment:
MEMORY: 80m
CPUS: "1.5"
REPORT_DIR: reports/80m-1.5cpus/jdk8
JDK_TAG: openjdk8
command: test/run_all.sh
- run:
name: Run tests for JDK 11 / 80m / 1.5 cpus
environment:
MEMORY: 80m
CPUS: "1.5"
REPORT_DIR: reports/80m-1.5cpus/jdk11
JDK_TAG: openjdk11
command: test/run_all.sh
- run:
name: Run tests for JDK 8 / 300m / 2 cpus
environment:
MEMORY: 300m
CPUS: "2"
REPORT_DIR: reports/300m-2cpus/jdk8
JDK_TAG: openjdk8
command: test/run_all.sh
- run:
name: Run tests for JDK 11 / 300m / 2 cpus
environment:
MEMORY: 300m
CPUS: "2"
REPORT_DIR: reports/300m-2cpus/jdk11
JDK_TAG: openjdk11
command: test/run_all.sh
- store_artifacts:
path: reports
destination: reports
# =======================================================
# Workflow for running all tests
workflows:
version: 2
# Run tests in a VM in order to tune memory constraints for the containers
# Container are started from within the VM
run_vm_tests:
jobs:
- test_runner_8:
filters:
tags:
only:
/v[0-9]+(\.[0-9]+)*/
- test_runner_11:
filters:
tags:
only:
/v[0-9]+(\.[0-9]+)*/
- vm_test:
requires:
- test_runner_8
- test_runner_11
filters:
tags:
only:
/v[0-9]+(\.[0-9]+)*/