Merge pull request #1063 from scm-manager/feature/speed_up_ci

Feature/speed up ci
This commit is contained in:
René Pfeuffer
2020-03-20 10:53:04 +01:00
committed by GitHub
8 changed files with 78 additions and 24 deletions

27
Jenkinsfile vendored
View File

@@ -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

17
pom.xml
View File

@@ -399,12 +399,6 @@
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
@@ -480,6 +474,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<!--
skips surefire tests without skipping failsafe tests.
Property value seems to magically default to false
-->
<skipTests>${skipUnitTests}</skipTests>
</configuration>
</plugin>
<plugin>
@@ -881,7 +882,9 @@
<sonar.nodejs.executable>./scm-ui/target/frontend/buildfrontend-node/node-v${nodejs.version}-linux-x64/bin/node</sonar.nodejs.executable>
<!-- Possibility to skip only the unit test. Can be useful when running only integration tests.
This can be used from the command line as follows: mvn <goals> -DskipUnitTests -->
<skipUnitTests>${skipTests}</skipUnitTests>
</properties>
</project>

View File

@@ -152,11 +152,6 @@
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>

View File

@@ -212,6 +212,10 @@
<name>sonia.scm.classloading.lifecycle</name>
<value>simple</value>
</systemProperty>
<systemProperty>
<name>logback.configurationFile</name>
<value>${scm-it.logbackConfiguration}</value>
</systemProperty>
</systemProperties>
<webApp>
<contextPath>/scm</contextPath>
@@ -245,10 +249,10 @@
<properties>
<scm.stage>DEVELOPMENT</scm.stage>
<scm.home>target/scm-it</scm.home>
<scm-it.logbackConfiguration>${project.basedir}/../scm-webapp/src/main/resources/logback.default.xml</scm-it.logbackConfiguration>
</properties>
</profile>
</profiles>
</project>

View File

@@ -18,8 +18,9 @@
<properties>
<build.script>build</build.script>
<skipTests>false</skipTests>
<skipTypecheck>false</skipTypecheck>
<skipFrontendTests>${skipTests}</skipFrontendTests>
<skipFrontendBuild>false</skipFrontendBuild>
<sonar.language>typescript</sonar.language>
<sonar.sources>ui-extensions/src,ui-components/src,ui-webapp/src</sonar.sources>
<sonar.test.exclusions>**/*.test.js,src/tests/**</sonar.test.exclusions>
@@ -88,6 +89,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skipFrontendBuild}</skip>
<script>${build.script}</script>
</configuration>
</execution>
@@ -99,7 +101,7 @@
</goals>
<configuration>
<script>test</script>
<skip>${skipTests}</skip>
<skip>${skipFrontendTests}</skip>
</configuration>
</execution>
<execution>

View File

@@ -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: {

View File

@@ -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"]

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, Sebastian Sdorra
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of SCM-Manager; nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http://bitbucket.org/sdorra/scm-manager
-->
<configuration>
<root level="OFF" />
</configuration>