Commit e5df9c4a authored by Erik Kimmel's avatar Erik Kimmel Committed by Raphaël Flores
Browse files

Add sonarqube support. GNP-5622.

parent f0f1143a
......@@ -40,22 +40,11 @@ lint:
script: "./gradlew lint"
test-frontend:
test-and-sonarqube:
stage: test
tags:
- openstack
script: "./gradlew :frontend:test --parallel"
artifacts:
reports:
junit:
- "./frontend/karma-junit-tests-report/TEST*.xml"
test-backend:
stage: test
tags:
- openstack
script: "./gradlew :backend:test --parallel"
- openstack
# the backend tests need an elasticsearch instance
services:
# even if that would be ideal
# we can't just launch the service with just elasticsearch:6.3.1
......@@ -70,10 +59,19 @@ test-backend:
# especially the error regarding
# `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]`
command: ["bin/elasticsearch", "-Ediscovery.type=single-node"]
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
script:
- ./gradlew :frontend:test --parallel
- ./gradlew :backend:test --parallel
- find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \;
- export PATH="/tmp/node/:$PATH"
- ./gradlew sonarqube -x test
artifacts:
reports:
junit:
- "./backend/build/test-results/test/TEST-*.xml"
- ./backend/build/test-results/test/TEST-*.xml
- ./frontend/karma-junit-tests-report/TEST*.xml
# BUILD
......@@ -89,11 +87,6 @@ build:
paths:
- "$JAR_PATH"
expire_in: 1 week
only:
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
# DEPLOY
......
......@@ -10,9 +10,6 @@
<module name="faidare.backend.main" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="faidare.backend.main" target="1.8" />
<module name="faidare.backend.test" target="1.8" />
</bytecodeTargetLevel>
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
......@@ -16,6 +16,7 @@ plugins {
id("org.springframework.boot") version "2.1.2.RELEASE"
id("com.gorylenko.gradle-git-properties") version "1.5.2"
id("io.spring.dependency-management") version "1.0.6.RELEASE"
id("org.sonarqube")
}
......
plugins {
id("org.sonarqube") version "2.8"
}
......@@ -3,6 +3,7 @@ import com.moowork.gradle.node.npm.NpmTask
plugins {
base
id("com.moowork.node") version "1.2.0"
id("org.sonarqube")
}
val isCi = System.getenv("CI") != null
......
# gradle.properties
systemProp.sonar.host.url=https://urgi.versailles.inrae.fr/sonarqube
#----- Token generated from an account with 'publish analysis' permission
systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562
systemProp.sonar.sources=frontend/src
systemProp.sonar.language=typescript
systemProp.sonar.scm.provider=git
systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json
systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info
systemProp.sonar.typescript.node=/tmp/node/node
systemProp.sonar.typescript.exclusions=**/*.spec.ts
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment