Add Test coverage

This commit is contained in:
小海
2019-12-04 11:35:42 +08:00
parent d9aac0fbd8
commit 900d84b15e
2 changed files with 21 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ test:
stage: test stage: test
script: script:
- cp "$APP_TEST" ./src/main/resources/application-test.properties - cp "$APP_TEST" ./src/main/resources/application-test.properties
- mvn test - mvn clean test && cat target/site/jacoco/index.html
deploy: deploy:
stage: deploy stage: deploy

20
pom.xml
View File

@@ -156,6 +156,26 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>