Skip to content

Commit c4a3521

Browse files
SCANMAVEN-315 Split invoker-based ITs and Orchestrator-based e2e
1 parent 1d568c1 commit c4a3521

File tree

687 files changed

+1562
-1537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

687 files changed

+1562
-1537
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
jobs:
1818
build:
1919
runs-on: github-ubuntu-latest-s # Public repo uses custom GitHub-hosted runners
20-
name: Build
20+
name: Build, UTs + ITs, SQ Analysis
2121
permissions:
2222
id-token: write # Required for Vault OIDC authentication
2323
contents: write # Required for repository access and tagging
@@ -32,28 +32,56 @@ jobs:
3232
artifactory-reader-role: private-reader # Override default public-reader
3333
artifactory-deployer-role: qa-deployer # Override default public-deployer
3434

35-
qa:
35+
invoker-integration-tests:
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
item:
40+
- {maven_version: 4.0.0-rc-4}
41+
- {maven_version: 3.9.11}
42+
- {maven_version: 3.8.9}
43+
- {maven_version: 3.6.3}
44+
- {maven_version: 3.5.4}
45+
- {maven_version: 3.3.9}
46+
- {maven_version: 3.2.5}
47+
runs-on: github-ubuntu-latest-s
48+
name: Invoker Integration Tests
49+
permissions:
50+
id-token: write # Required for Vault OIDC authentication
51+
contents: read
52+
steps:
53+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54+
- name: Download maven ${{ matrix.item.maven_version }}
55+
id: download_maven
56+
env:
57+
MAVEN_VERSION: ${{ matrix.item.maven_version }}
58+
run: |
59+
MAVEN_HOME_IT="${GITHUB_WORKSPACE}/target/downloaded-maven-${MAVEN_VERSION}"
60+
mkdir -p "${MAVEN_HOME_IT}"
61+
MAVEN_BINARY_URL="https://repo1.maven.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
62+
curl -sSL "${MAVEN_BINARY_URL}" | tar zx --strip-components 1 -C "${MAVEN_HOME_IT}"
63+
echo "maven_it_path=$MAVEN_HOME_IT" >> $GITHUB_OUTPUT
64+
- name: Configure Maven
65+
uses: SonarSource/ci-github-actions/config-maven@v1
66+
with:
67+
artifactory-reader-role: private-reader
68+
- name: Run Invoker Integration Tests
69+
run: >
70+
mvn verify -DskipTests -Dinvoker.mavenHome="${{ steps.download_maven.outputs.maven_it_path }}"
71+
72+
e2e-tests:
3673
needs:
3774
- build
3875
strategy:
3976
fail-fast: false
4077
matrix:
4178
item:
4279
- {sq_version: "DEV", maven_version: 4.0.0-rc-4}
43-
- {sq_version: "DEV", maven_version: 3.9.4}
44-
- {sq_version: "DEV", maven_version: 3.8.8}
45-
- {sq_version: "DEV", maven_version: 3.6.3}
46-
- {sq_version: "LATEST_RELEASE", maven_version: 3.9.4}
47-
- {sq_version: "LATEST_RELEASE", maven_version: 3.8.8}
48-
- {sq_version: "LATEST_RELEASE", maven_version: 3.6.3}
49-
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.9.4}
50-
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.8.8}
51-
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.6.3}
52-
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.5.4}
53-
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.3.9}
80+
- {sq_version: "LATEST_RELEASE", maven_version: 3.9.11}
81+
- {sq_version: "LATEST_RELEASE[2025.1]", maven_version: 3.8.9}
5482
- {sq_version: "LATEST_RELEASE[9.9]", maven_version: 3.2.5}
5583
runs-on: github-ubuntu-latest-s
56-
name: QA Tests
84+
name: E2E Tests
5785
permissions:
5886
id-token: write # Required for Vault OIDC authentication
5987
contents: read
@@ -73,24 +101,24 @@ jobs:
73101
uses: SonarSource/ci-github-actions/config-maven@v1
74102
with:
75103
artifactory-reader-role: private-reader
76-
common-mvn-flags: -Dmaven.home="${{ steps.download_maven.outputs.maven_it_path }}"
77-
- name: Run QA Tests
104+
- name: Run Orchestrator E2E Tests
78105
env:
79106
SQ_VERSION: LATEST_RELEASE
80107
# ProxyTest fails in GitHub actions environment, so it's disabled temporarily. See BUILD-9499.
81108
run: >
82-
mvn --batch-mode --errors
109+
mvn
83110
--projects '!sonar-maven-plugin'
84-
--activate-profiles its
111+
--activate-profiles e2e
85112
-Dsonar.runtimeVersion="${SQ_VERSION}"
86-
-Dmaven.test.redirectTestOutputToFile=false
113+
-Dmaven.home="${{ steps.download_maven.outputs.maven_it_path }}"
87114
'-Dtest=!ProxyTest'
88115
verify
89116
90117
promote:
91118
needs:
92119
- build
93-
- qa
120+
- invoker-integration-tests
121+
- e2e-tests
94122
runs-on: github-ubuntu-latest-s # Public repo uses custom GitHub-hosted runners
95123
name: Promote
96124
permissions:

cirrus/cirrus-qa.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set -euo pipefail
2929

3030
mvn --batch-mode --errors \
3131
--projects '!sonar-maven-plugin' \
32-
--activate-profiles its \
32+
--activate-profiles e2e \
3333
-Dsonar.runtimeVersion="${SQ_VERSION}" \
3434
-Dmaven.home="${MAVEN_HOME_IT}" \
3535
-Dmaven.test.redirectTestOutputToFile=false \

develop.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ There are 3 type of tests:
2424
#### Unit Tests
2525
The Unit Tests are located in `sonar-maven-plugin/src/test/java`, and they can be run with `mvn test`
2626

27-
#### Invoker Tests
27+
#### Invoker Integration Tests
2828
The Invoker tests are located in `sonar-maven-plugin/src/it`, and they can be run with `mvn verify`
2929

3030
The [maven-invoker-plugin](https://maven.apache.org/plugins/maven-invoker-plugin/) allows to debug single tests from the cli with `mvn invoker:run -Dinvoker.test=<test-name> -Dinvoker.mavenExecutable=mvnDebug`.
@@ -33,14 +33,11 @@ For example, in order to debug the test [java-compiler-executable](src/it/java-c
3333

3434
*Note* that you have to run `mvn invoker:install` to debug the latest changes in your code!
3535

36-
#### Integration Tests
37-
The Integration tests are located in `its`.
36+
#### End-to-end Tests
37+
The E2E tests are located in `e2e`.
3838

39-
* Configure Java 17
40-
* Execute: `./cirrus/cirrus-qa.sh`
41-
* Or, to use a specific version of SonarQube and Maven, you can also specify:
4239
```bash
43-
SQ_VERSION="LATEST_RELEASE[9.9]" MAVEN_VERSION="3.8.8" ./cirrus/cirrus-qa.sh
40+
mvn -P e2e -Dsonar.runtimeVersion="LATEST_RELEASE" verify
4441
```
4542

4643
### Change the maven scanner version
File renamed without changes.

its/pom.xml renamed to e2e/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<version>5.3.0-SNAPSHOT</version>
1010
</parent>
1111

12-
<artifactId>its</artifactId>
13-
<name>SonarSource :: IT :: SonarQube Maven</name>
12+
<artifactId>e2e</artifactId>
13+
<name>SonarSource :: E2E :: SonarQube Maven</name>
1414

1515
<properties>
1616
<jetty.version>9.4.51.v20230217</jetty.version>
@@ -129,7 +129,7 @@
129129

130130
<profiles>
131131
<profile>
132-
<id>its</id>
132+
<id>e2e</id>
133133
<properties>
134134
<skipTests>false</skipTests>
135135
</properties>

its/projects/batch/dependencies/multi-modules-with-deps/module_a/pom.xml renamed to e2e/projects/batch/dependencies/multi-modules-with-deps/module_a/pom.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<artifactId>module_a</artifactId>
5-
<packaging>jar</packaging>
6-
<name>Module A</name>
7-
8-
<parent>
9-
<groupId>com.sonarsource.it.samples</groupId>
10-
<artifactId>multi-modules-sample</artifactId>
11-
<version>1.0-SNAPSHOT</version>
12-
</parent>
13-
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>module_a</artifactId>
5+
<packaging>jar</packaging>
6+
<name>Module A</name>
7+
8+
<parent>
9+
<groupId>com.sonarsource.it.samples</groupId>
10+
<artifactId>multi-modules-sample</artifactId>
11+
<version>1.0-SNAPSHOT</version>
12+
</parent>
13+
1414
</project>

its/projects/batch/dependencies/multi-modules-with-deps/module_a/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java renamed to e2e/projects/batch/dependencies/multi-modules-with-deps/module_a/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java

File renamed without changes.

its/projects/batch/dependencies/multi-modules-with-deps/module_b/pom.xml renamed to e2e/projects/batch/dependencies/multi-modules-with-deps/module_b/pom.xml

File renamed without changes.

its/projects/batch/dependencies/multi-modules-with-deps/module_b/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java renamed to e2e/projects/batch/dependencies/multi-modules-with-deps/module_b/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java

File renamed without changes.

its/projects/batch/dependencies/multi-modules-with-deps/pom.xml renamed to e2e/projects/batch/dependencies/multi-modules-with-deps/pom.xml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.sonarsource.it.samples</groupId>
5-
<artifactId>multi-modules-sample</artifactId>
6-
<version>1.0-SNAPSHOT</version>
7-
<packaging>pom</packaging>
8-
<name>Sonar :: Integration Tests :: Multi-modules Sample</name>
9-
10-
<properties>
11-
<maven.compiler.source>1.8</maven.compiler.source>
12-
<maven.compiler.target>1.8</maven.compiler.target>
13-
<sonar.language>java</sonar.language>
14-
</properties>
15-
16-
<modules>
17-
<module>module_a</module>
18-
<module>module_b</module>
19-
</modules>
20-
21-
<dependencies>
22-
<dependency>
23-
<groupId>junit</groupId>
24-
<artifactId>junit</artifactId>
25-
<version>4.13.1</version>
26-
<scope>test</scope>
27-
</dependency>
28-
</dependencies>
29-
</project>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.sonarsource.it.samples</groupId>
5+
<artifactId>multi-modules-sample</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>pom</packaging>
8+
<name>Sonar :: Integration Tests :: Multi-modules Sample</name>
9+
10+
<properties>
11+
<maven.compiler.source>1.8</maven.compiler.source>
12+
<maven.compiler.target>1.8</maven.compiler.target>
13+
<sonar.language>java</sonar.language>
14+
</properties>
15+
16+
<modules>
17+
<module>module_a</module>
18+
<module>module_b</module>
19+
</modules>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>junit</groupId>
24+
<artifactId>junit</artifactId>
25+
<version>4.13.1</version>
26+
<scope>test</scope>
27+
</dependency>
28+
</dependencies>
29+
</project>

0 commit comments

Comments
 (0)