Compare commits

...

8 Commits

Author SHA1 Message Date
dff1c45fa7 gitlab-ci: Run tests on merge requests and tags 2021-01-07 15:18:01 +01:00
279e643688 gitlab-ci: Replace check job with test
I can't see what other things `check` is running besides tests.
2021-01-07 14:42:09 +01:00
6bb0974774 gitlab-ci: Install grep instead of using busybox version 2021-01-07 14:30:13 +01:00
29e24568d0 gitlab-ci: Try adding code coverage 2021-01-07 14:19:38 +01:00
e61ed7d784 gitlab-ci: Gradle command typo
Step 1: Learn how to type
2021-01-07 12:53:26 +01:00
5e31e2f78c gitlab-ci: Keep cache only on branch and tag
Sharing caches across branches surely isn't a good idea.
2021-01-07 12:49:38 +01:00
c25decb272 gitlab-ci: first attempt 2021-01-07 12:47:27 +01:00
2c5fe22710 test: fix I2PSocketExceptionTest::testUnknownStatus
In non-English environments, the message is translated.
2021-01-07 12:36:01 +01:00
2 changed files with 25 additions and 1 deletions

24
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,24 @@
image: openjdk:8-alpine
stages:
- test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- .gradle
test:
stage: test
coverage: '/Total.*?([0-9]{1,3})%/'
before_script:
- apk add --no-cache grep
script:
- ./gradlew codeCoverageReport
# The actual output that will be parsed by the code coverage
- grep -oP "Total.*?%" build/reports/jacoco/html/index.html
only:
- merge_requests
- tags

View File

@@ -60,6 +60,6 @@ public class I2PSocketExceptionTest {
public void testUnknownStatus() {
I2PSocketException e = new I2PSocketException(255);
assertThat(e.getStatus(), is(255));
assertThat(e.getMessage(), is("Failure code: 255"));
assertThat(e.getMessage(), endsWith(": 255"));
}
}