Skip to content

Commit

Permalink
把单元测试和 UI 测试分开
Browse files Browse the repository at this point in the history
  • Loading branch information
tangshimin committed Sep 17, 2024
1 parent 502549e commit 1d5c1a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
name: Run Tests on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-13, macos-latest]
include:
Expand Down Expand Up @@ -40,9 +41,12 @@ jobs:
if: runner.os != 'Windows'
run: chmod +x ./gradlew

- name: Run tests
- name: Run unit tests
run: ./gradlew test

- name: Run UI tests
run: ./gradlew uiTest

- name: Package DMG on macOS
if: startsWith(matrix.os, 'macos')
run: ./gradlew packageDmg
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ tasks.named("compileKotlin") {
}
}

tasks.named<Test>("test") {
description = "Runs unit tests."
group = "verification"
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
exclude("**/ui/**")
}

tasks.register<Test>("uiTest") {
description = "Runs UI tests."
group = "verification"
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
include("**/ui/**")
}

project.afterEvaluate {
val os = System.getProperty("os.name", "generic").lowercase()
if(os.indexOf("windows") >= 0){
Expand Down

0 comments on commit 1d5c1a0

Please sign in to comment.