Skip to content

Commit dac74a0

Browse files
SONARJAVA-5742 Add sonar.sca.exclusions, fix integration tests
1 parent 5bdbce4 commit dac74a0

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

.cirrus.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,8 @@ plugin_qa_task:
149149
cpu: 14
150150
memory: 6G
151151
<<: *ORCHESTRATOR_CACHE_PREPARATION_DEFINITION
152-
matrix:
153-
- env:
154-
SQ_VERSION: LATEST_RELEASE[2025.1]
155-
orchestrator_LATEST_RELEASE_cache:
156-
<<: *ORCHESTRATOR_CACHE_ELEMENTS_DEFINITION
157-
- env:
158-
SQ_VERSION: DEV[2025.1]
159-
orchestrator_DEV_cache:
160-
<<: *ORCHESTRATOR_CACHE_ELEMENTS_DEFINITION
152+
orchestrator_LATEST_RELEASE_cache:
153+
<<: *ORCHESTRATOR_CACHE_ELEMENTS_DEFINITION
161154

162155
maven_cache:
163156
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
@@ -168,7 +161,7 @@ plugin_qa_task:
168161
- source cirrus-env QA
169162
- source set_maven_build_version $BUILD_NUMBER
170163
- cd its/plugin
171-
- mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true
164+
- mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=LATEST_RELEASE[2025.1] -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true
172165
cleanup_before_cache_script: cleanup_maven_repository
173166

174167
sanity_task:

.cirrus/Dockerfile.jdk17AndLatest

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ ENV DEBIAN_FRONTEND=noninteractive
1111
# Use a similar method to install Java 23 copied from https://github.com/adoptium/containers/blob/main/22/jdk/ubuntu/jammy/Dockerfile
1212

1313
ENV JAVA_LATEST_HOME /opt/java/openjdk23
14-
ENV JAVA_LATEST_VERSION jdk-23.0.1+11
14+
ENV JAVA_LATEST_VERSION jdk-23.0.2+7
1515

1616
RUN set -eux; \
1717
ARCH="$(dpkg --print-architecture)"; \
1818
case "${ARCH}" in \
1919
amd64) \
20-
ESUM='2400267e4e9c0f6ae880a4d763af6caf18c673714bdee5debf8388b0b5d52886'; \
21-
BINARY_URL='https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jdk_x64_linux_hotspot_23.0.1_11.tar.gz'; \
20+
ESUM='870ac8c05c6fe563e7a3878a47d0234b83c050e83651d2c47e8b822ec74512dd'; \
21+
BINARY_URL='https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.2%2B7/OpenJDK23U-jdk_x64_linux_hotspot_23.0.2_7.tar.gz'; \
2222
;; \
2323
arm64) \
24-
ESUM='0b498a5b673cb50fe9cfd0a13bd39c7259b4fad4d930d614e1563aeb8bca7f0e'; \
25-
BINARY_URL='https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jre_aarch64_linux_hotspot_23.0.1_11.tar.gz'; \
24+
ESUM='b2a8a287ebd2d2a1d5d32eb6b79768cf2b5e02f1b4d6d4791297feb8636b9e2f'; \
25+
BINARY_URL='https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.2%2B7/OpenJDK23U-jre_aarch64_linux_hotspot_23.0.2_7.tar.gz'; \
2626
;; \
2727
*) \
2828
echo "Unsupported arch: ${ARCH}"; \

its/autoscan/src/test/java/org/sonar/java/it/AutoScanTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ public void javaCheckTestSources() throws Exception {
195195
SoftAssertions softly = new SoftAssertions();
196196
softly.assertThat(newDiffs).containsExactlyInAnyOrderElementsOf(knownDiffs.values());
197197
softly.assertThat(newTotal).isEqualTo(knownTotal);
198-
softly.assertThat(rulesCausingFPs).hasSize(9);
199-
softly.assertThat(rulesNotReporting).hasSize(11);
198+
softly.assertThat(rulesCausingFPs).hasSize(11);
199+
softly.assertThat(rulesNotReporting).hasSize(10);
200200

201201
/**
202202
* 4. Check total number of differences (FPs + FNs)

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106

107107
<!-- Overrides parent pom to use a more recent version of jacoco -->
108108
<version.jacoco.plugin>0.8.11</version.jacoco.plugin>
109+
<!-- To avoid having security vulnerabilities reported on sample files and projects -->
110+
<sonar.sca.exclusions>**/test/files/**, **/test/resources/**, its/plugin/projects/**, java-checks-test-sources/**, its/sources/**</sonar.sca.exclusions>
109111
</properties>
110112

111113
<distributionManagement>

0 commit comments

Comments
 (0)