-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.docker-compose.yaml
51 lines (45 loc) · 1.7 KB
/
tests.docker-compose.yaml
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
version: "3.6"
services:
# Test cases declared
tests:
image: registry.gitlab.com/supercash/services/parkinglot-service/tests:local
build:
context: .
dockerfile: tests.Dockerfile
cache_from:
- registry.gitlab.com/supercash/services/parkinglot-service/tests
environment:
- SPRING_PROFILES_ACTIVE=test
volumes:
- ./build:/builder/build/
# Merge the test reports under build/test-results/test/TEST-*.xml into test-results/junit-testsuites.xml
merge-tests-reports:
image: marcellodesales/java-junit-xml-merger
command: -i=/test-results/test -o=/test-results/junit-testsuites.xml -s="Supercash Tests Suite"
volumes:
- ./build/test-results:/test-results
# Generate the text report of the tests for the report stage
generate-tests-report-text:
image: marcellodesales/java-junit-xml-merger
volumes:
- ./build/test-results:/test-results
environment:
- REPORT_FILE_NAME=/test-results/junit-report.txt
- TEST_SUITES_FILE_NAME=/test-results/junit-testsuites.xml
# Translates the jacoco report to cobertura.xml so we can use it in Gitlab's reports
generate-cobertura-report:
image: marcellodesales/cover2cover
volumes:
- .:/app
environment:
- JACOCO_XML=/app/build/reports/jacoco/test/jacocoTestReport.xml
- SRC_MAIN_JAVA_DIR=/app/src/main/java
- COBERTURA_XML_FILE=/app/build/reports/cobertura.xml
# Prints the cobertura report to a file at build/reports/cobertura.txt
save-cobertura-report:
image: marcellodesales/pycobertura-reports
command: show /reports/cobertura.xml
environment:
- REPORT_FILE=/reports/cobertura.txt
volumes:
- ./build/reports:/reports