1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
5 image: mcr.microsoft.com/dotnet/core/sdk:latest
7 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
8 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
10 key: "\${CI_JOB_NAME}"
15 - "apt-get install --yes openjdk-11-jre"
16 - "dotnet tool install --global dotnet-sonarscanner"
17 - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
18 - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.token=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
20 - "dotnet sonarscanner end /d:sonar.token=\\"$SONAR_TOKEN\\""
23 - if: $CI_COMMIT_BRANCH == 'main'
27 exports[`should follow and complete all steps: CFamily: gitlab-ci.yml 1`] = `
28 "image: <image ready for your build toolchain>
43 - curl -sSLo build-wrapper-linux-x86.zip $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
44 - unzip -o build-wrapper-linux-x86.zip -d .sonar
49 - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
54 - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
55 - unzip -o sonar-scanner.zip -d .sonar
56 - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
60 exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `
61 "sonar.projectKey=my-project
62 sonar.qualitygate.wait=true
66 exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
68 image: gradle:jre11-slim
70 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
71 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
73 key: "\${CI_JOB_NAME}"
79 - if: $CI_COMMIT_BRANCH == 'main'
83 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
85 id "org.sonarqube" version "4.2.1.3168"
90 property "sonar.projectKey", "my-project"
91 property "sonar.projectName", "MyProject"
92 property "sonar.qualitygate.wait", true
97 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
99 id ("org.sonarqube") version "4.2.1.3168"
104 property("sonar.projectKey", "my-project")
105 property("sonar.projectName", "MyProject")
106 property("sonar.qualitygate.wait", true)
111 exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
113 image: maven:3.6.3-jdk-11
115 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
116 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
118 key: "\${CI_JOB_NAME}"
122 - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
125 - if: $CI_COMMIT_BRANCH == 'main'
129 exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
131 <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
135 exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
138 name: sonarsource/sonar-scanner-cli:latest
141 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
142 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
144 key: "\${CI_JOB_NAME}"
151 - if: $CI_COMMIT_BRANCH == 'main'
155 exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
156 "sonar.projectKey=my-project
157 sonar.qualitygate.wait=true
161 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
163 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
165 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;