Skip to content

Commit

Permalink
Extract UI tests into the separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Feb 8, 2024
1 parent 8e6c490 commit 27a689e
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 50 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/runUiOctopusTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
- uses: actions/checkout@v4
- name: Apply Patch
run: |
git apply src/test/java/ui/octopus.patch
git apply tests/ij-ui-tests/src/test/kotlin/ui/octopus.patch
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
Expand All @@ -30,15 +30,15 @@ jobs:
- name: Run Idea
run: |
mkdir -p build/reports
gradle :runIdeForUiTests > build/reports/idea.log &
gradle :tests:ij-ui-tests:runIdeForUiTests > build/reports/idea.log &
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
url: http://127.0.0.1:8082
max-attempts: 20
retry-delay: 10s
- name: Tests
run: gradle :testUi
run: gradle :tests:ij-ui-tests:testUi
- name: Move video
if: always()
run: mv video build/reports
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/runUiTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
Expand All @@ -27,15 +27,15 @@ jobs:
- name: Run Idea
run: |
mkdir -p build/reports
gradle :runIdeForUiTests > build/reports/idea.log &
gradle :tests:ij-ui-tests:runIdeForUiTests > build/reports/idea.log &
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
url: http://127.0.0.1:8082
max-attempts: 20
retry-delay: 10s
- name: Tests
run: gradle :testUi
run: gradle :tests:ij-ui-tests:testUi
- name: Move video
if: always()
run: mv video build/reports
Expand Down
31 changes: 0 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ val ideaVersion: String by project
val ideaType: String by project
val downloadIdeaSources: String by project
val instrumentPluginCode: String by project
val remoteRobotVersion: String by project
val antlrVersion: String by project

val publishChannels: String by project
Expand Down Expand Up @@ -144,11 +143,6 @@ dependencies {
// https://mvnrepository.com/artifact/org.mockito.kotlin/mockito-kotlin
testImplementation("org.mockito.kotlin:mockito-kotlin:5.2.1")

testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:ide-launcher:$remoteRobotVersion")
testImplementation("com.automation-remarks:video-recorder-junit5:2.0")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
Expand Down Expand Up @@ -244,10 +238,6 @@ intellij {
}

tasks {
downloadRobotServerPlugin {
version.set(remoteRobotVersion)
}

publishPlugin {
channels.set(publishChannels.split(","))
token.set(publishToken)
Expand All @@ -259,14 +249,6 @@ tasks {
password.set(providers.environmentVariable("PRIVATE_KEY_PASSWORD"))
}

runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
systemProperty("ide.show.tips.on.startup.default.value", "false")
}

runPluginVerifier {
downloadDir.set("${project.buildDir}/pluginVerifier/ides")
teamCityOutputFormat.set(true)
Expand Down Expand Up @@ -348,12 +330,6 @@ tasks {
}
}

tasks.register<Test>("testUi") {
group = "verification"
useJUnitPlatform()
include("/ui/**")
}

// --- Changelog

changelog {
Expand All @@ -372,13 +348,6 @@ koverMerged {
enable()
}

kover {
instrumentation {
// set of test tasks names to exclude from instrumentation. The results of their execution will not be presented in the report
excludeTasks += "testUi"
}
}

// --- Slack notification

tasks.register("slackNotification") {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ include 'annotation-processors'
include 'tests:java-tests'
include 'tests:property-tests'
include 'tests:long-running-tests'
include 'tests:ij-ui-tests'
74 changes: 74 additions & 0 deletions tests/ij-ui-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
plugins {
java
kotlin("jvm")
id("org.jetbrains.intellij")
}

group = "org.example"
version = "SNAPSHOT"

repositories {
mavenCentral()
maven { url = uri("https://cache-redirector.jetbrains.com/intellij-dependencies") }
}

val kotlinVersion: String by project
val ideaVersion: String by project
val javaVersion: String by project
val remoteRobotVersion: String by project

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation(testFixtures(project(":"))) // The root project

testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:ide-launcher:$remoteRobotVersion")
testImplementation("com.automation-remarks:video-recorder-junit5:2.0")
}

tasks {
// This task is disabled because it should be excluded from `gradle test` run (because it's slow)
// I didn't find a better way to exclude except disabling and defining a new task with a different name
test {
useJUnitPlatform()
enabled = false
}

register<Test>("testUi") {
group = "verification"
useJUnitPlatform()
}

downloadRobotServerPlugin {
version.set(remoteRobotVersion)
}

runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
systemProperty("ide.show.tips.on.startup.default.value", "false")
}
}

intellij {
version.set(ideaVersion)
type.set("IC")
plugins.set(listOf("java"))
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2023 The IdeaVim authors
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
Expand Down
File renamed without changes.

0 comments on commit 27a689e

Please sign in to comment.