From 9aa5927de65c140114084182bf3b9ca292ffdee5 Mon Sep 17 00:00:00 2001 From: Felipe Zorzo Date: Fri, 23 Feb 2024 13:02:48 -0300 Subject: [PATCH] build: Reintroduce integration tests with the upcoming SonarQube version --- .github/workflows/build.yml | 15 ++++++++++++++- .../kotlin/org/sonar/plsqlopen/it/Tests.kt | 9 ++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dab7e549..0f39e92b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ jobs: sqVersion: - LATEST_RELEASE[9.9] - LATEST_RELEASE[10.4] + - SNAPSHOT steps: - uses: actions/checkout@v4 with: @@ -37,9 +38,21 @@ jobs: - name: Build custom rules example run: ./gradlew build -p plsql-custom-rules - - name: Run integration test + - if: matrix.sqVersion != 'SNAPSHOT' + name: Run integration test run: ./gradlew integrationTest -Dsonar.runtimeVersion=${{ matrix.sqVersion }} --info + - if: matrix.sqVersion == 'SNAPSHOT' + name: Run integration test + run: | + SQ_VERSION=10.5 + curl -L "https://nexus.felipezorzo.com.br/service/rest/v1/search/assets/download?repository=maven-snapshots&maven.groupId=org.sonarsource.sonarqube&maven.artifactId=sonar-application&maven.extension=zip&sort=version&maven.baseVersion=$SQ_VERSION-SNAPSHOT" \ + -u "$AUTH_REPOSITORY" \ + -o sonar-application-$SQ_VERSION.zip + ./gradlew integrationTest -Dsonar.zipFile=sonar-application-$SQ_VERSION.zip --info + env: + AUTH_REPOSITORY: ${{ secrets.AUTH_REPOSITORY }} + windows-build: name: Test on Windows runs-on: windows-latest diff --git a/sonar-zpa-plugin/src/integrationTest/kotlin/org/sonar/plsqlopen/it/Tests.kt b/sonar-zpa-plugin/src/integrationTest/kotlin/org/sonar/plsqlopen/it/Tests.kt index 4ddb3de8..0af0e6fb 100644 --- a/sonar-zpa-plugin/src/integrationTest/kotlin/org/sonar/plsqlopen/it/Tests.kt +++ b/sonar-zpa-plugin/src/integrationTest/kotlin/org/sonar/plsqlopen/it/Tests.kt @@ -36,7 +36,14 @@ object Tests { val ORCHESTRATOR: OrchestratorExtension = OrchestratorExtension.builderEnv() .useDefaultAdminCredentialsForBuilds(true) - .setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[9.9]")) + .apply { + val zipFile = System.getProperty("sonar.zipFile") + if (zipFile != null) { + setZipFile(File(zipFile)) + } else { + setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[9.9]")) + } + } .setOrchestratorProperty("orchestrator.artifactory.url", "https://repo1.maven.org/maven2") .addPlugin(FileLocation.byWildcardMavenFilename( File("build/libs"),