From 742d96c5000e19fd87167592283dbb990877e116 Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 15:06:29 +0200 Subject: [PATCH 01/11] fix mocks in test --- .../wiki/infrastructure/ScmGitDirectoryRepositoryTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/ScmGitDirectoryRepositoryTest.java b/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/ScmGitDirectoryRepositoryTest.java index 1a9ab6d4..116b1fbb 100644 --- a/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/ScmGitDirectoryRepositoryTest.java +++ b/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/ScmGitDirectoryRepositoryTest.java @@ -7,8 +7,10 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; import java.io.File; import java.io.IOException; @@ -18,6 +20,7 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.when; +@RunWith(MockitoJUnitRunner.class) public class ScmGitDirectoryRepositoryTest { @Rule From 5ce78dd54d79ea29d3eedf9a45680d4140b7b2ad Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 15:28:59 +0200 Subject: [PATCH 02/11] bump jacoco version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4840e144..1728e7e9 100644 --- a/pom.xml +++ b/pom.xml @@ -319,7 +319,7 @@ org.jacoco jacoco-maven-plugin - 0.8.4 + 0.8.8 From 70669791c5c3e8ec07548999d29f3d8c3973d4de Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 15:54:34 +0200 Subject: [PATCH 03/11] fix test coverage report generation --- pom.xml | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 1728e7e9..974dbfbd 100644 --- a/pom.xml +++ b/pom.xml @@ -311,20 +311,35 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + + + + prepare-agent + + + + + report + + + test + + report + + + + - - - - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - - - smeagol From d6e4339db4a4c97502671ee8e8df753615b158fc Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 15:58:57 +0200 Subject: [PATCH 04/11] revert changes for test coverage as it works with the jenkins maven profile --- pom.xml | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 974dbfbd..9eed6ac6 100644 --- a/pom.xml +++ b/pom.xml @@ -311,35 +311,18 @@ - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - - - - prepare-agent - - - - - report - - - test - - report - - - - + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + + smeagol From 1a5fc95c39b3a9d4ef2fcb3eb181251fc0feae1b Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 16:07:03 +0200 Subject: [PATCH 05/11] exclude Junit5 as there are only junit4 tests in smeagol --- pom.xml | 10 ++++++++++ .../TimeBasedPullChangesStrategyTest.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9eed6ac6..e7ac26a4 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,16 @@ org.springframework.boot spring-boot-starter-test test + + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + + diff --git a/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/TimeBasedPullChangesStrategyTest.java b/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/TimeBasedPullChangesStrategyTest.java index cb91bea8..93178aaa 100644 --- a/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/TimeBasedPullChangesStrategyTest.java +++ b/src/test/java/com/cloudogu/smeagol/wiki/infrastructure/TimeBasedPullChangesStrategyTest.java @@ -1,7 +1,7 @@ package com.cloudogu.smeagol.wiki.infrastructure; import com.cloudogu.smeagol.wiki.domain.WikiId; -import org.junit.jupiter.api.Test; +import org.junit.Test; import static com.cloudogu.smeagol.wiki.DomainTestData.WIKI_ID_42; import static org.assertj.core.api.Assertions.assertThat; From c57efed1d18fc957498bbcf2af1c468d48d9e8dc Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 16:42:58 +0200 Subject: [PATCH 06/11] fix failing RepositoryControllerTest findById --- .../infrastructure/RepositoryControllerTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/cloudogu/smeagol/repository/infrastructure/RepositoryControllerTest.java b/src/test/java/com/cloudogu/smeagol/repository/infrastructure/RepositoryControllerTest.java index 45c3e9a2..e5644118 100644 --- a/src/test/java/com/cloudogu/smeagol/repository/infrastructure/RepositoryControllerTest.java +++ b/src/test/java/com/cloudogu/smeagol/repository/infrastructure/RepositoryControllerTest.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Optional; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -91,10 +90,10 @@ public void findById() throws Exception { .andExpect(jsonPath("$.id", is("4xQfahsId3"))) .andExpect(jsonPath("$.name", is("hitchhiker/heartOfGold"))) .andExpect(jsonPath("$._links.self.href", is("http://localhost/api/v1/repositories/4xQfahsId3"))) - .andExpect(jsonPath("$._embedded.branches.[0].name", is("develop"))) - .andExpect(jsonPath("$._embedded.branches.[0]._links.self.href", is("http://localhost/api/v1/repositories/4xQfahsId3/branches/develop"))) - .andExpect(jsonPath("$._embedded.branches.[1].name", is("master"))) - .andExpect(jsonPath("$._embedded.branches.[1]._links.self.href", is("http://localhost/api/v1/repositories/4xQfahsId3/branches/master"))); + .andExpect(jsonPath("$._embedded.branches._embedded.branchResourceList[0].name", is("develop"))) + .andExpect(jsonPath("$._embedded.branches._embedded.branchResourceList[0]._links.self.href", is("http://localhost/api/v1/repositories/4xQfahsId3/branches/develop"))) + .andExpect(jsonPath("$._embedded.branches._embedded.branchResourceList[1].name", is("master"))) + .andExpect(jsonPath("$._embedded.branches._embedded.branchResourceList[1]._links.self.href", is("http://localhost/api/v1/repositories/4xQfahsId3/branches/master"))); } @Test From 5d3dd6cced1886df32e04331a6736b4ef681026f Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 17:03:25 +0200 Subject: [PATCH 07/11] fix maintainer in dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2863d2b8..ae20d4a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN set -x \ FROM registry.cloudogu.com/official/java:17.0.6-1 LABEL NAME="official/smeagol" \ VERSION="1.7.0-1" \ - maintainer="Sebastian Sdorra " + maintainer="hello@cloudogu.com" ENV SERVICE_TAGS=webapp \ SMEAGOL_HOME=/var/lib/smeagol From 00e25454be7e6f8ac20b02bf30eeb808efbbfc15 Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 17:04:24 +0200 Subject: [PATCH 08/11] add comment in build process --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 751277d7..07535562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- [#209] Fix execution of tests in build process ## [v1.7.0-1] - 2023-03-31 ### Fixed From 62debfeb54aa216b314ad400b583a62d1e0b3b0a Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Fri, 31 Mar 2023 17:04:55 +0200 Subject: [PATCH 09/11] add comment in build process --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07535562..0703137b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed - [#209] Fix execution of tests in build process ## [v1.7.0-1] - 2023-03-31 From d5488e97549bea9171574b8119734eeb27db02e1 Mon Sep 17 00:00:00 2001 From: Jeremias Weber Date: Fri, 31 Mar 2023 17:11:29 +0200 Subject: [PATCH 10/11] Bump version --- Dockerfile | 2 +- dogu.json | 2 +- package.json | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae20d4a6..4d1067d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN set -x \ FROM registry.cloudogu.com/official/java:17.0.6-1 LABEL NAME="official/smeagol" \ - VERSION="1.7.0-1" \ + VERSION="1.7.1-1" \ maintainer="hello@cloudogu.com" ENV SERVICE_TAGS=webapp \ diff --git a/dogu.json b/dogu.json index a005f07f..66d0ec69 100644 --- a/dogu.json +++ b/dogu.json @@ -1,6 +1,6 @@ { "Name": "official/smeagol", - "Version": "1.7.0-1", + "Version": "1.7.1-1", "DisplayName": "Smeagol", "Description": "Store your technical documentation with in your git repositories", "Category": "Development Apps", diff --git a/package.json b/package.json index aa0c05e5..1bc0938b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smeagol", - "version": "1.7.0-1", + "version": "1.7.1-1", "private": true, "dependencies": { "ces-theme": "https://github.com/cloudogu/ces-theme.git#39ad0799afc9e3f4a888192c6cd27b16f7161a84", diff --git a/pom.xml b/pom.xml index e7ac26a4..af70ff16 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.cloudogu.wiki smeagol - 1.7.0-1 + 1.7.1-1 smeagol war From d8d59daa4d44aa7b2ab367a7842656b4144e3223 Mon Sep 17 00:00:00 2001 From: Jeremias Weber Date: Fri, 31 Mar 2023 17:20:41 +0200 Subject: [PATCH 11/11] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0703137b..08dbe4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v1.7.1-1] - 2023-03-31 ### Fixed - [#209] Fix execution of tests in build process