From 4b101e50fe6e4b532d8e15b3f530d6b7a7238ba7 Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Tue, 19 Sep 2023 13:55:14 +0200 Subject: [PATCH] don't build custom plugin on axis without node (with embedded node) --- .cirrus.yml | 26 ++++++++++++------- .../it/plugin/OrchestratorStarter.java | 13 +++++++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5424d54dc58..fcefb6232af 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -68,7 +68,7 @@ plugin_qa_body: &PLUGIN_QA_BODY qa_script: - source cirrus-env QA - source set_maven_build_version $BUILD_NUMBER - - mvn -f its/plugin/pom.xml -Dsonar.runtimeVersion=${SQ_VERSION} -B -e -V verify surefire-report:report + - mvn -f its/plugin/pom.xml -Dsonar.runtimeVersion=${SQ_VERSION} ${MVN_TEST} -B -e -V verify surefire-report:report cleanup_before_cache_script: cleanup_maven_repository build_task: @@ -143,23 +143,30 @@ ws_scan_task: ws_artifacts: path: 'whitesource/**/*' -plugin_qa_task: +plugin_qa_task_with_node: <<: *PLUGIN_QA_BODY eks_container: - matrix: - - dockerfile: .cirrus/nodejs.jdk17.Dockerfile - docker_arguments: - NODE_VERSION: 14 - - image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest + dockerfile: .cirrus/nodejs.jdk17.Dockerfile + env: + SQ_VERSION: LATEST_RELEASE + MVN_TEST: '' + +plugin_qa_task_no_node: + <<: *PLUGIN_QA_BODY + eks_container: + image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest env: SQ_VERSION: LATEST_RELEASE + SONARJS_ARTIFACT: multi + MVN_TEST: "-Dtest=!EslintCustomRulesTest --projects '!org.sonarsource.javascript:eslint-custom-rules-plugin'" plugin_qa_sq_dev_task: <<: *PLUGIN_QA_BODY eks_container: - dockerfile: .cirrus/nodejs.jdk17.Dockerfile + image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest env: SQ_VERSION: DEV + SONARJS_ARTIFACT: multi # Plugin QA for Windows is splint into 2 parts to make it faster plugin_qa_win_task: @@ -215,7 +222,8 @@ promote_task: depends_on: - ws_scan - build_win - - plugin_qa + - plugin_qa_with_node + - plugin_qa_no_node - plugin_qa_sq_dev - plugin_qa_win - ruling diff --git a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/OrchestratorStarter.java b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/OrchestratorStarter.java index c14cfed636a..28ab1af9641 100644 --- a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/OrchestratorStarter.java +++ b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/OrchestratorStarter.java @@ -46,11 +46,22 @@ public final class OrchestratorStarter implements BeforeAllCallback, ExtensionContext.Store.CloseableResource { static final String SCANNER_VERSION = "5.0.1.3006"; + static final FileLocation JAVASCRIPT_PLUGIN_LOCATION = FileLocation.byWildcardMavenFilename( new File("../../../sonar-plugin/sonar-javascript-plugin/target"), - "sonar-javascript-plugin-*-multi.jar" + artifact() ); + /** + * This is used to test artifact with and without embedded runtime during plugin QA integration tests + * + */ + private static String artifact() { + return "multi".equals(System.getenv("SONARJS_ARTIFACT")) + ? "sonar-javascript-plugin-*-multi.jar" + : "sonar-javascript-plugin-*.jar"; + } + public static final OrchestratorExtension ORCHESTRATOR = OrchestratorExtension .builderEnv() .useDefaultAdminCredentialsForBuilds(true)