Execute ChatGpt test only when GitHub is running coverage
This commit is contained in:
parent
33a3e3c7ef
commit
4f9ff1b641
3 changed files with 16 additions and 4 deletions
6
pom.xml
6
pom.xml
|
@ -57,6 +57,12 @@
|
|||
<version>1.2.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>1.9.23</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlinx</groupId>
|
||||
<artifactId>kotlinx-coroutines-core</artifactId>
|
||||
|
|
|
@ -91,6 +91,7 @@ public class MobibotBuild extends Project {
|
|||
.include(dependency("com.google.guava", "guava", "33.1.0-jre"))
|
||||
.include(dependency("com.google.cloud", "google-cloud-vertexai", "1.2.0"))
|
||||
// Kotlin
|
||||
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
|
||||
.include(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.8.0"))
|
||||
.include(dependency("org.jetbrains.kotlinx", "kotlinx-cli-jvm", "0.3.6"))
|
||||
// Logging
|
||||
|
|
|
@ -47,6 +47,15 @@ class ChatGptTest : LocalProperties() {
|
|||
.hasNoCause()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testChatOnCoverage() {
|
||||
if (System.getenv("CI") == null || System.getenv("COVERAGE_SDK") != null) {
|
||||
assertThat(
|
||||
ChatGpt.chat("how do I encode a URL in java?", getProperty(ChatGpt.API_KEY_PROP), 60)
|
||||
).contains("URLEncoder")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableOnCi
|
||||
fun testChat() {
|
||||
|
@ -55,10 +64,6 @@ class ChatGptTest : LocalProperties() {
|
|||
ChatGpt.chat("how do I make an HTTP request in Javascript?", apiKey, 100)
|
||||
).contains("XMLHttpRequest")
|
||||
|
||||
assertThat(
|
||||
ChatGpt.chat("how do I encode a URL in java?", apiKey, 60)
|
||||
).contains("URLEncoder")
|
||||
|
||||
assertFailure { ChatGpt.chat("1 liter to gallon", apiKey, -1) }
|
||||
.isInstanceOf(ModuleException::class.java)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue