diff --git a/Jenkinsfile b/Jenkinsfile index eb12ebf17f..39173ab389 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,15 +64,20 @@ node('docker') { mvn 'clean install -DskipTests' } - stage('Unit Test') { - mvn 'test -Pcoverage -Dmaven.test.failure.ignore=true' - junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml,**/target/jest-reports/TEST-*.xml' - } - - stage('Integration Test') { - mvn 'verify -Pit -pl :scm-webapp,:scm-it -Dmaven.test.failure.ignore=true -Dscm.git.core.supportsatomicfilecreation=false' - junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml' - } + parallel( + unitTest: { + stage('Unit Test') { + mvn 'test -DskipFrontendBuild -DskipTypecheck -Pcoverage -pl !scm-it -Dmaven.test.failure.ignore=true' + junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml,**/target/jest-reports/TEST-*.xml' + } + }, + integrationTest: { + stage('Integration Test') { + mvn 'verify -Pit -DskipUnitTests -pl :scm-webapp,:scm-it -Dmaven.test.failure.ignore=true' + junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml' + } + } + ) stage('SonarQube') { @@ -203,6 +208,10 @@ String mainBranch Maven setupMavenBuild() { Maven mvn = new MavenWrapperInDocker(this, "scmmanager/java-build:11.0.6_10") + // disable logging durring the build + def logConf = "scm-webapp/src/main/resources/logback.ci.xml" + mvn.additionalArgs += " -Dlogback.configurationFile=${logConf}" + mvn.additionalArgs += " -Dscm-it.logbackConfiguration=${logConf}" if (isMainBranch() || isReleaseBranch()) { // Release starts javadoc, which takes very long, so do only for certain branches diff --git a/pom.xml b/pom.xml index ae2abd7a70..4fe6c4f475 100644 --- a/pom.xml +++ b/pom.xml @@ -200,7 +200,7 @@ de.otto.edison edison-hal - 2.0.1 + 2.1.0 @@ -323,7 +323,7 @@ org.junit-pioneer junit-pioneer - 0.3.0 + 0.5.4 test @@ -358,7 +358,7 @@ org.assertj assertj-core - 3.10.0 + 3.15.0 test @@ -399,12 +399,6 @@ ${jaxb.version} - - com.sun.xml.bind - jaxb-impl - ${jaxb.version} - - org.glassfish.jaxb jaxb-runtime @@ -422,7 +416,7 @@ commons-codec commons-codec - 1.13 + 1.14 @@ -480,6 +474,13 @@ org.apache.maven.plugins maven-surefire-plugin 2.22.0 + + + ${skipUnitTests} + @@ -838,21 +839,21 @@ 2.1.1 4.4.2.Final 1.19.4 - 2.10.0 + 2.10.2 4.2.2 - 2.3.0 - 6.1.0.Final + 2.3.1 + 6.1.2.Final 1.6.2 - 9.4.26.v20200117 + 9.4.27.v20200227 9.4.22.v20191022 1.2.0 - 1.4.1 + 1.5.1 5.6.1.202002131546-r-scm1 @@ -871,7 +872,7 @@ UTF-8 SCM-BSD - 1.2.0.Final + 1.3.1.Final @@ -881,7 +882,9 @@ ./scm-ui/target/frontend/buildfrontend-node/node-v${nodejs.version}-linux-x64/bin/node - + + ${skipTests} diff --git a/scm-annotation-processor/src/main/java/sonia/scm/annotation/ScmAnnotationProcessor.java b/scm-annotation-processor/src/main/java/sonia/scm/annotation/ScmAnnotationProcessor.java index ec3e2cb10b..7ff46057a3 100644 --- a/scm-annotation-processor/src/main/java/sonia/scm/annotation/ScmAnnotationProcessor.java +++ b/scm-annotation-processor/src/main/java/sonia/scm/annotation/ScmAnnotationProcessor.java @@ -208,10 +208,12 @@ public final class ScmAnnotationProcessor extends AbstractProcessor { return doc; } + @SuppressWarnings("java:S2755") // we need to process https dtd, to avoid breaking intellij compilation on plugins private DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "https"); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); + factory.setAttribute(XMLConstants.FEATURE_SECURE_PROCESSING, true); return factory.newDocumentBuilder(); } @@ -338,9 +340,10 @@ public final class ScmAnnotationProcessor extends AbstractProcessor { } } + @SuppressWarnings("java:S2755") // we need to process https dtd, to avoid breaking intellij compilation on plugins private Transformer createTransformer() throws TransformerConfigurationException { TransformerFactory factory = TransformerFactory.newInstance(); - factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "https"); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = factory.newTransformer(); diff --git a/scm-core/pom.xml b/scm-core/pom.xml index ec3b884fd6..3c7d67c2d8 100644 --- a/scm-core/pom.xml +++ b/scm-core/pom.xml @@ -152,11 +152,6 @@ jaxb-api - - com.sun.xml.bind - jaxb-impl - - org.glassfish.jaxb jaxb-runtime diff --git a/scm-it/pom.xml b/scm-it/pom.xml index e2038e2816..6f41e1f1b6 100644 --- a/scm-it/pom.xml +++ b/scm-it/pom.xml @@ -212,6 +212,10 @@ sonia.scm.classloading.lifecycle simple + + logback.configurationFile + ${scm-it.logbackConfiguration} + /scm @@ -245,10 +249,10 @@ DEVELOPMENT target/scm-it + ${project.basedir}/../scm-webapp/src/main/resources/logback.default.xml - diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java index a561914b42..b0cada14b1 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java @@ -224,7 +224,7 @@ public class GitConfigResourceTest { assertThat(configurationStoreCaptor.getValue()) .isInstanceOfSatisfying(GitRepositoryConfig.class, x -> { }) .extracting("defaultBranch") - .containsExactly("new"); + .isEqualTo("new"); } private MockHttpResponse get() throws URISyntaxException { diff --git a/scm-ui/pom.xml b/scm-ui/pom.xml index 851d2afd37..28b922cbc2 100644 --- a/scm-ui/pom.xml +++ b/scm-ui/pom.xml @@ -18,8 +18,9 @@ build - false false + ${skipTests} + false typescript ui-extensions/src,ui-components/src,ui-webapp/src **/*.test.js,src/tests/** @@ -88,6 +89,7 @@ run + ${skipFrontendBuild} @@ -99,7 +101,7 @@ - ${skipTests} + ${skipFrontendTests} diff --git a/scm-ui/ui-scripts/src/createPluginConfig.js b/scm-ui/ui-scripts/src/createPluginConfig.js index 3e210fa022..6057ccc997 100644 --- a/scm-ui/ui-scripts/src/createPluginConfig.js +++ b/scm-ui/ui-scripts/src/createPluginConfig.js @@ -19,6 +19,7 @@ module.exports = function(mode) { [name]: [path.resolve(__dirname, "webpack-public-path.js"), packageJSON.main || "src/main/js/index.js"] }, mode, + stats: "minimal", devtool: "source-map", target: "web", node: { diff --git a/scm-ui/ui-scripts/src/webpack.config.js b/scm-ui/ui-scripts/src/webpack.config.js index cf63c1da3c..e6cc362a67 100644 --- a/scm-ui/ui-scripts/src/webpack.config.js +++ b/scm-ui/ui-scripts/src/webpack.config.js @@ -25,6 +25,7 @@ console.log(`build ${mode} bundles`); module.exports = [ { mode, + stats: "minimal", context: root, entry: { webapp: [path.resolve(__dirname, "webpack-public-path.js"), "./ui-webapp/src/index.tsx"] diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index d987b2fcf3..b95f84ef40 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -161,7 +161,7 @@ org.hibernate.validator hibernate-validator - 6.1.0.Final + 6.1.2.Final @@ -632,7 +632,7 @@ DEVELOPMENT target/scm-it default - 0.10.5 + 0.11.0 2.53.1 1.0 0.9.6-scm1 diff --git a/scm-webapp/src/main/resources/logback.ci.xml b/scm-webapp/src/main/resources/logback.ci.xml new file mode 100644 index 0000000000..428d3e1350 --- /dev/null +++ b/scm-webapp/src/main/resources/logback.ci.xml @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ChangesetCollectionToDtoMapperTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ChangesetCollectionToDtoMapperTest.java index 7653fbe122..8748be3a7e 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ChangesetCollectionToDtoMapperTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/ChangesetCollectionToDtoMapperTest.java @@ -53,8 +53,8 @@ public class ChangesetCollectionToDtoMapperTest { assertThat(collectionDto.getEmbedded().getItemsBy("branch")) .hasSize(1) .first().matches(b -> b.getLinks().getLinkBy("self").isPresent()) - .extracting(b -> b.getLinks().getLinkBy("self").get().getHref()).first().isEqualTo("/v2/repositories/space/name/branches/someBranch"); + .extracting(b -> b.getLinks().getLinkBy("self").get().getHref()).isEqualTo("/v2/repositories/space/name/branches/someBranch"); assertThat(collectionDto.getEmbedded().getItemsBy("branch")) - .first().extracting("name").first().isEqualTo("someBranch"); + .first().extracting("name").isEqualTo("someBranch"); } } diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/DiffResultToDiffResultDtoMapperTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/DiffResultToDiffResultDtoMapperTest.java index da78d3b652..f19e66fbae 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/DiffResultToDiffResultDtoMapperTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/DiffResultToDiffResultDtoMapperTest.java @@ -55,7 +55,7 @@ class DiffResultToDiffResultDtoMapperTest { .isPresent() .get() .extracting("href") - .contains("/scm/api/v2/repositories/space/X/diff/123/parsed"); + .isEqualTo("/scm/api/v2/repositories/space/X/diff/123/parsed"); } @Test @@ -67,7 +67,7 @@ class DiffResultToDiffResultDtoMapperTest { .isPresent() .get() .extracting("href") - .contains("/scm/api/v2/repositories/space/X/incoming/feature%2Fsome/master/diff/parsed"); + .isEqualTo("/scm/api/v2/repositories/space/X/incoming/feature%2Fsome/master/diff/parsed"); } private DiffResult createResult() {