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

KON-158 Extract Tests To Integration Test Source Set #105

Merged
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 28 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: JUnit Test Report
path: ./**/build/reports/tests/
name: junit-test-report
path: ./lib/build/test-results/test/
konsist-test:
name: Konsist Test
continue-on-error: true
Expand All @@ -51,8 +51,31 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: Konsist Test Report
path: ./**/build/reports/tests/
name: konsist-test-report
path: ./lib/build/test-results/konsistTest/
integration-test:
name: Integration Test
continue-on-error: true
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 19
distribution: 'zulu'

- name: Integration Test
run: ./gradlew lib:integrationTest

- uses: actions/upload-artifact@v3
with:
name: integration-test-report
path: ./lib/build/test-results/integrationTest/
spotless:
name: Spotless
continue-on-error: true
Expand Down Expand Up @@ -118,7 +141,7 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: lib.jar Artifact
name: konsist.jar
path: lib/build/libs/lib.jar
publish:
name: Publish Local
Expand Down
5 changes: 5 additions & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ testing {
api(libs.mockk)
api(libs.kluent)
}
register("integrationTest", JvmTestSuite::class) {
dependencies {
implementation(project(":lib"))
}
}
register("konsistTest", JvmTestSuite::class) {
dependencies {
implementation(project(":lib"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.io.File

object TestSnippetProvider {
val modulePath = File("").absoluteFile.path
private val testSourceSetPath = "$modulePath/src/test/kotlin/com/lemonappdev/konsist/"
private val testSourceSetPath = "$modulePath/src/integrationTest/kotlin/com/lemonappdev/konsist/"

fun getSnippetKoScope(snippetRelativePath: String, fileName: String): KoScope {
val snippetPath = "$testSourceSetPath$snippetRelativePath$fileName.kttxt"
Expand Down
Loading