From 18f243fe8011b8c65b2d8dc6b367aeb177807d64 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 26 Mar 2021 12:38:01 +0100 Subject: [PATCH 1/2] Add gitlab-ci --- .gitlab-ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c9a08d1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,40 @@ +image: maven:3-openjdk-15-slim + +variables: + MAVEN_OPTS: " \ + -Dhttps.protocols=TLSv1.2 \ + -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Djava.awt.headless=true" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" + +cache: + paths: + - .m2/repository + +stages: + - build + - test + +build: + stage: build + script: + - "mvn clean compile $MAVEN_CLI_OPTS" + artifacts: + paths: + - target/ + +unittest: + stage: test + needs: [build] + script: + - "mvn package $MAVEN_CLI_OPTS" + artifacts: + paths: + - target/ + when: always + reports: + junit: + - target/surefire-reports/TEST-*.xml + - target/failsafe-reports/TEST-*.xml \ No newline at end of file From 4c9be54f64d7deb8ca9935dcabccf6979ee38e59 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 26 Mar 2021 12:53:58 +0100 Subject: [PATCH 2/2] Fix tests --- src/main/java/stateandbehavior/StopWatch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/stateandbehavior/StopWatch.java b/src/main/java/stateandbehavior/StopWatch.java index 0fa837b..d25b373 100644 --- a/src/main/java/stateandbehavior/StopWatch.java +++ b/src/main/java/stateandbehavior/StopWatch.java @@ -43,7 +43,7 @@ public class StopWatch { /** forteller klokken at ticks antall tikk har gått. */ public void tick(int ticks) { - // this.totalTicks += ticks; + this.totalTicks += ticks; if (this.hasBeenStarted ^ this.hasBeenStopped) this.totalTime += ticks; }