Skip to content

Commit 28e2cd0

Browse files
committed
chore: EXPOSED-53 Add test coverage configuration
1 parent 750d653 commit 28e2cd0

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

documentation-website/Writerside/topics/Contributing.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,14 @@ Test functions:
9191
[YouTrack issue](https://youtrack.jetbrains.com/issues/EXPOSED) code.
9292
* An example could be: `fix: EXPOSED-123 Fix a specific bug`
9393

94-
### Setup
94+
### Test Coverage
9595

96-
#### Testing on Apple Silicon
97-
To run Oracle XE tests, you need to install [Colima](https://github.com/abiosoft/colima) container runtime. It will work in pair with your docker installation.
98-
```shell
99-
brew install colima
100-
```
101-
102-
After installing, you need to start the colima daemon in arch x86_64 mode:
103-
```Bash
104-
colima start --arch x86_64 --memory 4 --network-address
105-
```
106-
107-
The test task can automatically use colima context when needed, and it's better to use default context for other tasks.
108-
To switch the context to default, run:
109-
```shell
110-
docker context use default
111-
```
96+
Exposed project has configures test coverage tasks.
11297

113-
Make sure that default is used as default docker context:
98+
To generate a test coverage report, run:
11499
```shell
115-
docker context list
100+
./gradlew :exposed-tests:koverHtmlReport
101+
./gradlew :exposed-r2dbc-tests:koverHtmlReport
116102
```
117103

118104
## Community Support

exposed-r2dbc-tests/build.gradle.kts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66

77
// exposed-json dependencies
88
alias(libs.plugins.serialization)
9+
alias(libs.plugins.kover)
910
}
1011

1112
kotlin {
@@ -23,18 +24,20 @@ dependencies {
2324
implementation(libs.kotlinx.coroutines.debug)
2425
implementation(libs.kotlinx.coroutines.test)
2526
implementation(libs.r2dbc.spi)
26-
27-
implementation(kotlin("test-junit"))
27+
implementation(libs.slf4j)
28+
implementation(libs.log4j.slf4j.impl)
29+
implementation(libs.log4j.api)
30+
implementation(libs.log4j.core)
2831
implementation(libs.junit)
32+
implementation(kotlin("test-junit"))
2933

3034
implementation(project(":exposed-core"))
3135
implementation(project(":exposed-r2dbc"))
3236
implementation(project(":exposed-kotlin-datetime"))
3337

34-
implementation(libs.slf4j)
35-
implementation(libs.log4j.slf4j.impl)
36-
implementation(libs.log4j.api)
37-
implementation(libs.log4j.core)
38+
kover(project(":exposed-core"))
39+
kover(project(":exposed-r2dbc"))
40+
kover(project(":exposed-kotlin-datetime"))
3841

3942
// non-exposed-tests module dependencies
4043
// --- start ---

exposed-tests/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import org.gradle.api.tasks.testing.logging.*
22

33
plugins {
44
kotlin("jvm") apply true
5+
alias(libs.plugins.kover)
56
}
67

78
kotlin {
@@ -27,6 +28,14 @@ dependencies {
2728
implementation(project(":exposed-money"))
2829
implementation(project(":exposed-migration"))
2930

31+
kover(project(":exposed-core"))
32+
kover(project(":exposed-jdbc"))
33+
kover(project(":exposed-dao"))
34+
kover(project(":exposed-json"))
35+
kover(project(":exposed-kotlin-datetime"))
36+
kover(project(":exposed-money"))
37+
kover(project(":exposed-migration"))
38+
3039
implementation(libs.slf4j)
3140
implementation(libs.log4j.slf4j.impl)
3241
implementation(libs.log4j.api)

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ binary-compatibility-validator = "0.17.0"
66
docker-compose = "0.17.5"
77
kotlinCoroutines = "1.10.2"
88
kotlinxSerialization = "1.8.1"
9+
kover = "0.9.1"
910

1011
slf4j = "2.0.9"
1112
log4j2 = "2.24.3"
@@ -109,3 +110,4 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
109110
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
110111
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
111112
docker-compose = { id = "com.avast.gradle.docker-compose", version.ref = "docker-compose" }
113+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }

0 commit comments

Comments
 (0)