@@ -34,7 +34,7 @@ eks_container: &EKS_CONTAINER | |||
namespace: default | |||
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-m3-latest | |||
cpu: 1 | |||
memory: 2G | |||
memory: 4G | |||
ec2_instance: &EC2_INSTANCE_WINDOWS | |||
experimental: true # see https://github.com/cirruslabs/cirrus-ci-docs/issues/1051 | |||
@@ -77,11 +77,16 @@ linux_qa_java17_task: | |||
<<: *EKS_CONTAINER | |||
env: | |||
matrix: | |||
- SQ_VERSION: LATEST_RELEASE[8.9] | |||
- SQ_VERSION: LATEST_RELEASE[9.9] | |||
- SQ_VERSION: DEV | |||
maven_cache: | |||
folder: ${CIRRUS_WORKING_DIR}/.m2/repository | |||
qa_script: | |||
- nodeVersion=18.17.0 | |||
- nodeName=node-v${nodeVersion}-linux-x64 | |||
- wget https://nodejs.org/download/release/v${nodeVersion}/${nodeName}.tar.gz | |||
- tar xzf ${nodeName}.tar.gz -C /tmp | |||
- export PATH=$PATH:/tmp/${nodeName}/bin | |||
- source cirrus-env QA | |||
- source set_maven_build_version $BUILD_NUMBER | |||
- cd it | |||
@@ -98,7 +103,7 @@ win_qa_java17_task: | |||
env: | |||
CIRRUS_SHELL: bash | |||
matrix: | |||
- SQ_VERSION: LATEST_RELEASE[8.9] | |||
- SQ_VERSION: LATEST_RELEASE[9.9] | |||
- SQ_VERSION: DEV | |||
maven_cache: | |||
folder: ${CIRRUS_WORKING_DIR}/.m2/repository |
@@ -31,17 +31,6 @@ jobs: | |||
secrets: | | |||
development/github/token/SonarSource-sonar-scanner-cli-release token | GITHUB_TOKEN_RELEASE; | |||
development/kv/data/slack token | SLACK_BOT_TOKEN; | |||
- name: Create Release for Docker Image | |||
id: create_release | |||
uses: softprops/action-gh-release@v1 | |||
env: | |||
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN_RELEASE }} | |||
GITHUB_REPOSITORY: SonarSource/sonar-scanner-cli-docker | |||
with: | |||
tag_name: ${{ github.event.release.tag_name }} | |||
body: Release containing ScannerCLI version ${{ github.event.release.tag_name }} | |||
draft: false | |||
prerelease: false | |||
- name: Notify failures on Slack | |||
uses: slackapi/slack-github-action@v1.23.0 | |||
if: failure() |
@@ -26,6 +26,7 @@ | |||
<!-- following properties must be set in command-line : sonar.runtimeVersion and sonarRunner.version --> | |||
<maven.compiler.release>17</maven.compiler.release> | |||
<orchestrator.version>4.1.0.495</orchestrator.version> | |||
</properties> | |||
<dependencies> | |||
@@ -38,7 +39,14 @@ | |||
<dependency> | |||
<groupId>org.sonarsource.orchestrator</groupId> | |||
<artifactId>sonar-orchestrator</artifactId> | |||
<version>3.40.0.183</version> | |||
<version>${orchestrator.version}</version> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.sonarsource.orchestrator</groupId> | |||
<artifactId>sonar-orchestrator-junit4</artifactId> | |||
<version>${orchestrator.version}</version> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>junit</groupId> |
@@ -0,0 +1,3 @@ | |||
function msg(){ | |||
alert("Hello JS"); | |||
} |
@@ -52,6 +52,20 @@ public class ScannerTest extends ScannerTestCase { | |||
.isGreaterThan(1); | |||
} | |||
/** | |||
* SQSCANNER-117 | |||
*/ | |||
@Test | |||
public void analyzers_can_spawn_processes() { | |||
SonarScanner build = newScanner(new File("projects/simple-js")) | |||
.useNative() | |||
.setProjectKey("SAMPLE"); | |||
orchestrator.executeBuild(build); | |||
Map<String, Measure> projectMeasures = getMeasures("SAMPLE", "files", "ncloc"); | |||
assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(1); | |||
assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); | |||
} | |||
/** | |||
* Replace the maven format groupId:artifactId by a single key | |||
*/ |
@@ -22,6 +22,7 @@ package com.sonarsource.scanner.it; | |||
import com.sonar.orchestrator.Orchestrator; | |||
import com.sonar.orchestrator.build.SonarScanner; | |||
import com.sonar.orchestrator.http.HttpMethod; | |||
import com.sonar.orchestrator.junit4.OrchestratorRule; | |||
import com.sonar.orchestrator.version.Version; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
@@ -66,7 +67,7 @@ public abstract class ScannerTestCase { | |||
public ExpectedException thrown = ExpectedException.none(); | |||
@ClassRule | |||
public static Orchestrator orchestrator = SonarScannerTestSuite.ORCHESTRATOR; | |||
public static OrchestratorRule orchestrator = SonarScannerTestSuite.ORCHESTRATOR; | |||
private static Version artifactVersion; | |||
@@ -20,6 +20,8 @@ | |||
package com.sonarsource.scanner.it; | |||
import com.sonar.orchestrator.Orchestrator; | |||
import com.sonar.orchestrator.OrchestratorBuilder; | |||
import com.sonar.orchestrator.junit4.OrchestratorRule; | |||
import com.sonar.orchestrator.locator.MavenLocation; | |||
import org.junit.ClassRule; | |||
import org.junit.runner.RunWith; | |||
@@ -32,17 +34,17 @@ import org.junit.runners.Suite.SuiteClasses; | |||
public class SonarScannerTestSuite { | |||
@ClassRule | |||
public static final Orchestrator ORCHESTRATOR = createOrchestrator(); | |||
public static final OrchestratorRule ORCHESTRATOR = createOrchestrator(); | |||
private static Orchestrator createOrchestrator() { | |||
private static OrchestratorRule createOrchestrator() { | |||
String sonarVersion = System | |||
.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[7.9]"); | |||
return Orchestrator.builderEnv() | |||
.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[9.9]"); | |||
return OrchestratorRule.builderEnv() | |||
.useDefaultAdminCredentialsForBuilds(true) | |||
.setSonarVersion( | |||
sonarVersion).addPlugin(MavenLocation | |||
.of("org.sonarsource.sonarqube", "sonar-xoo-plugin", | |||
sonarVersion)).build(); | |||
.setSonarVersion(sonarVersion) | |||
.addBundledPluginToKeep("sonar-javascript") | |||
.addPlugin(MavenLocation.of("org.sonarsource.sonarqube", "sonar-xoo-plugin", sonarVersion)) | |||
.build(); | |||
} | |||
} |