Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLI-1566 JaCoCo on UI tests #1150

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
slack_notification_script: |
source slack-failure-notification

validate_task:

Check warning on line 116 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L116

task "validate" depends on task "build", but their only_if conditions are different

Check warning on line 116 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L116

task "validate" depends on task "build", but their only_if conditions are different
# name: "Run UTs and trigger SonarQube analysis"
depends_on:
- build
Expand Down Expand Up @@ -141,7 +141,7 @@
slack_notification_script: |
source slack-failure-notification

validate_windows_task:

Check warning on line 144 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L144

task "validate_windows" depends on task "build", but their only_if conditions are different

Check warning on line 144 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L144

task "validate_windows" depends on task "build", but their only_if conditions are different
# name: "Run unit tests on Windows"
depends_on:
- build
Expand Down Expand Up @@ -210,7 +210,7 @@
slack_notification_script: |
source slack-failure-notification

qa_task:

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different
# name: "Run ITs"
depends_on:
- build
Expand Down Expand Up @@ -359,7 +359,7 @@
base64 --decode its/build/idea-sandbox/config-uiTest/webstorm.key.b64 > its/build/idea-sandbox/config-uiTest/webstorm.key
metacity --sm-disable --replace &
sleep 10 # give metacity some time to start
gradle :its:runIdeForUiTests --stacktrace -i -PijVersion=${IDEA_VERSION} -PslPluginDirectory=${CIRRUS_WORKING_DIR}/staged-plugin > ${CIRRUS_WORKING_DIR}/runIdeGradle.log &
gradle :its:runIdeForUiTests --stacktrace -i -PijVersion=${IDEA_VERSION} -PslPluginDirectory=${CIRRUS_WORKING_DIR}/staged-plugin > ${CIRRUS_WORKING_DIR}/runIdeGradle.log sonar jacocoTestReport &
wait_ide_script: |
echo "Wait for IDE to start"
.cirrus/wait-for-endpoint.sh http://127.0.0.1:8082 -t 500
Expand All @@ -382,18 +382,18 @@
path: "${CIRRUS_WORKING_DIR}/recording_${IDEA_VERSION}.mp4"
log_artifacts:
path: "its/build/idea-sandbox/system/log"
reports_artifacts:
path: "**/reports/**/*"
on_failure:
xvfb_log_artifacts:
path: "${CIRRUS_WORKING_DIR}/Xvfb.out"
reports_artifacts:
path: "**/reports/**/*"
junit_artifacts:
path: "**/test-results/**/*.xml"
format: junit
slack_notification_script: |
source slack-failure-notification

inspect_orchestrator_cache_task:

Check warning on line 396 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L396

task "inspect_orchestrator_cache" depends on task "build", but their only_if conditions are different

Check warning on line 396 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L396

task "inspect_orchestrator_cache" depends on task "build", but their only_if conditions are different
<<: *ONLY_PR_AND_MAINTAINED_BRANCHES
depends_on: build
eks_container:
Expand Down Expand Up @@ -437,7 +437,7 @@
slack_notification_script: |
source slack-failure-notification

promote_task:

Check warning on line 440 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L440

task "promote" depends on task "mend_scan", but their only_if conditions are different

Check warning on line 440 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L440

task "promote" depends on task "build", but their only_if conditions are different

Check warning on line 440 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L440

task "promote" depends on task "mend_scan", but their only_if conditions are different

Check warning on line 440 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L440

task "promote" depends on task "build", but their only_if conditions are different
depends_on:
- build
- validate
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ allprojects {
}
}


tasks.cyclonedxBom {
setIncludeConfigs(listOf("runtimeClasspath", "sqplugins_deps"))
inputs.files(configurations.runtimeClasspath, configurations.archives.get())
Expand Down
25 changes: 24 additions & 1 deletion its/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("org.jetbrains.intellij")
kotlin("jvm")
jacoco
}

group = "org.sonarsource.sonarlint.intellij.its"
Expand Down Expand Up @@ -46,6 +47,11 @@ tasks.test {
}
}
testLogging.showStandardStreams = true

// we need the coverage from Idea process, not from test task
configure<JacocoTaskExtension> {
isEnabled = false
}
}

license {
Expand Down Expand Up @@ -75,11 +81,14 @@ intellij {
if (!project.hasProperty("slPluginDirectory")) {
plugins.set(listOf(rootProject))
}
instrumentCode.set(false)
}

val runIdeDirectory: String by project

jacoco {
applyTo(tasks.runIdeForUiTests.get())
}

tasks.runIdeForUiTests {
systemProperty("sonarlint.internal.sonarcloud.url", "https://sc-staging.io")
systemProperty("sonarlint.internal.sonarcloud.websocket.url", "wss://events-api.sc-staging.io/")
Expand All @@ -103,4 +112,18 @@ tasks.runIdeForUiTests {
}
}
}
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}

tasks {
jacocoTestReport {
classDirectories.setFrom(files("../build/instrumented/instrumentCode"))

reports {
xml.required.set(true)
}
}
}
3 changes: 3 additions & 0 deletions its/src/test/kotlin/org/sonarlint/intellij/its/BaseUiTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.sonarlint.intellij.its

import com.intellij.remoterobot.RemoteRobot
import com.intellij.remoterobot.steps.CommonSteps
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.fail
Expand Down Expand Up @@ -101,6 +102,8 @@ open class BaseUiTest {
it.close()
}
}

private val steps = CommonSteps(remoteRobot)
}


Expand Down